2014-03-17 20:05:12 +01:00
|
|
|
package parser;
|
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
import java.io.File;
|
2016-12-16 00:00:37 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
2014-03-17 20:05:12 +01:00
|
|
|
|
2017-02-03 15:20:26 +01:00
|
|
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
2014-03-17 20:05:12 +01:00
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
2014-09-02 10:33:54 +02:00
|
|
|
|
2014-03-17 20:05:12 +01:00
|
|
|
/**
|
2015-05-12 19:49:27 +02:00
|
|
|
* Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden.
|
2014-03-17 20:05:12 +01:00
|
|
|
* Der dabei erstellte Syntaxbaum wird nicht kontrolliert.
|
|
|
|
* @author janulrich
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class GeneralParserTest{
|
|
|
|
private static final String rootDirectory = System.getProperty("user.dir")+"/test/parser/";
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void run(){
|
2015-05-12 19:49:27 +02:00
|
|
|
|
|
|
|
|
2016-12-16 00:00:37 +01:00
|
|
|
List<String> filenames = new ArrayList<String>();
|
2017-04-07 02:33:20 +02:00
|
|
|
filenames.add("NewTest.jav");
|
2014-04-23 12:05:57 +02:00
|
|
|
filenames.add("FieldInitializationTest.jav");
|
2014-07-09 15:07:40 +02:00
|
|
|
filenames.add("ImportTest.jav");
|
2017-04-06 11:23:25 +02:00
|
|
|
filenames.add("CastTest.jav");
|
2017-02-17 16:34:40 +01:00
|
|
|
filenames.add("StatementsTest.jav");
|
2017-04-20 18:55:34 +02:00
|
|
|
<<<<<<< HEAD
|
2017-04-18 21:06:04 +02:00
|
|
|
//filenames.add("Methods.jav");
|
2017-04-20 18:55:34 +02:00
|
|
|
=======
|
|
|
|
>>>>>>> f05222fb563282945ba395047f54f6b3059b10c5
|
2017-02-15 16:29:11 +01:00
|
|
|
filenames.add("ImportTestGeneric.jav");
|
2017-04-06 11:23:25 +02:00
|
|
|
filenames.add("CastTest.jav");
|
2017-02-03 15:20:26 +01:00
|
|
|
//filenames.add("BoundedParameter.jav");
|
|
|
|
//filenames.add("GenericFieldVarTest.jav");
|
2014-09-18 16:26:02 +02:00
|
|
|
filenames.add("FieldVarTest.jav");
|
2017-02-03 15:20:26 +01:00
|
|
|
filenames.add("StructuralTypes.jav");
|
|
|
|
JavaTXParser parser = new JavaTXParser();
|
2014-03-17 20:05:12 +01:00
|
|
|
try{
|
2016-12-16 00:00:37 +01:00
|
|
|
for(String filename : filenames) {
|
2017-02-03 15:20:26 +01:00
|
|
|
System.out.println("Teste: "+filename);
|
|
|
|
parser.parse(new File(rootDirectory + filename));
|
2016-12-16 00:00:37 +01:00
|
|
|
//TODO: Test ANTLR Parser
|
|
|
|
}
|
2014-03-17 20:05:12 +01:00
|
|
|
}catch(Exception exc){
|
|
|
|
exc.printStackTrace();
|
|
|
|
fail();
|
|
|
|
}
|
|
|
|
assertTrue("Tests durchlaufen",filenames.size()>0);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|