forked from JavaTX/JavaCompilerCore
55 lines
1.4 KiB
Java
55 lines
1.4 KiB
Java
package parser;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
/**
|
|
* Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden.
|
|
* 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>();
|
|
filenames.add("NewTest.jav");
|
|
filenames.add("FieldInitializationTest.jav");
|
|
filenames.add("ImportTest.jav");
|
|
filenames.add("CastTest.jav");
|
|
filenames.add("StatementsTest.jav");
|
|
//filenames.add("Methods.jav");
|
|
filenames.add("ImportTestGeneric.jav");
|
|
filenames.add("CastTest.jav");
|
|
//filenames.add("BoundedParameter.jav");
|
|
//filenames.add("GenericFieldVarTest.jav");
|
|
filenames.add("FieldVarTest.jav");
|
|
filenames.add("StructuralTypes.jav");
|
|
JavaTXParser parser = new JavaTXParser();
|
|
try{
|
|
for(String filename : filenames) {
|
|
System.out.println("Teste: "+filename);
|
|
parser.parse(new File(rootDirectory + filename));
|
|
//TODO: Test ANTLR Parser
|
|
}
|
|
}catch(Exception exc){
|
|
exc.printStackTrace();
|
|
fail();
|
|
}
|
|
assertTrue("Tests durchlaufen",filenames.size()>0);
|
|
}
|
|
|
|
}
|