56 lines
1.4 KiB
Java
56 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 java.util.stream.Collectors;
|
|
|
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
|
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");
|
|
*/
|
|
// filenames.add("ExtendsTest.jav");
|
|
filenames.add("OpratorTest.jav");
|
|
try{
|
|
new JavaTXCompiler(filenames.stream().map(s -> new File(rootDirectory + s)).collect(Collectors.toList()));
|
|
}catch(Exception exc){
|
|
exc.printStackTrace();
|
|
fail();
|
|
}
|
|
assertTrue("Tests durchlaufen",filenames.size()>0);
|
|
}
|
|
|
|
}
|