JavaCompilerCore/test/parser/GeneralParserTest.java

55 lines
1.4 KiB
Java
Raw Permalink Normal View History

2014-03-17 19:05:12 +00:00
package parser;
import static org.junit.Assert.*;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
2014-03-17 19:05:12 +00:00
import de.dhbwstuttgart.parser.JavaTXParser;
2014-03-17 19:05:12 +00:00
import org.junit.Test;
2014-09-02 08:33:54 +00:00
2014-03-17 19:05:12 +00:00
/**
* Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden.
2014-03-17 19:05:12 +00: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(){
List<String> filenames = new ArrayList<String>();
2017-04-07 00:33:20 +00:00
filenames.add("NewTest.jav");
filenames.add("FieldInitializationTest.jav");
2014-07-09 13:07:40 +00:00
filenames.add("ImportTest.jav");
2017-04-06 09:23:25 +00:00
filenames.add("CastTest.jav");
filenames.add("StatementsTest.jav");
//filenames.add("Methods.jav");
filenames.add("ImportTestGeneric.jav");
2017-04-06 09:23:25 +00:00
filenames.add("CastTest.jav");
//filenames.add("BoundedParameter.jav");
//filenames.add("GenericFieldVarTest.jav");
filenames.add("FieldVarTest.jav");
filenames.add("StructuralTypes.jav");
JavaTXParser parser = new JavaTXParser();
2014-03-17 19:05:12 +00:00
try{
for(String filename : filenames) {
System.out.println("Teste: "+filename);
parser.parse(new File(rootDirectory + filename));
//TODO: Test ANTLR Parser
}
2014-03-17 19:05:12 +00:00
}catch(Exception exc){
exc.printStackTrace();
fail();
}
assertTrue("Tests durchlaufen",filenames.size()>0);
}
}