forked from JavaTX/JavaCompilerCore
74 lines
1.5 KiB
Java
74 lines
1.5 KiB
Java
package strucTypes5;
|
|
|
|
import de.dhbwstuttgart.parser.JavaTXParser;
|
|
import de.dhbwstuttgart.strucTypes5.algo.TI;
|
|
import de.dhbwstuttgart.strucTypes5.assumptions.AssumptionMap;
|
|
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
|
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
|
import org.junit.Test;
|
|
|
|
import java.io.File;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
import static org.junit.Assert.fail;
|
|
|
|
/**
|
|
* Dieser Test pr�ft nur, ob .java-Dateien fehlerfrei geparst werden. Der
|
|
* dabei erstellte Syntaxbaum wird nicht kontrolliert.
|
|
*
|
|
* @author janulrich
|
|
*
|
|
*/
|
|
public class SolveTest {
|
|
private static final String rootDirectory = System.getProperty("user.dir") + "/test/strucTypes5/";
|
|
|
|
@Test
|
|
public void run() {
|
|
|
|
|
|
List<String> filenames = new ArrayList<String>();
|
|
filenames.add("SolveTest.jav");
|
|
|
|
JavaTXParser parser = new JavaTXParser();
|
|
try {
|
|
for (String filename : filenames) {
|
|
|
|
System.out.println("Teste: " + filename);
|
|
|
|
SourceFile sf = parser.parse(new File(rootDirectory + filename));
|
|
|
|
SourceFile sfdebug = sf;
|
|
|
|
ClassOrInterface mainClass = sf.getClasses().get(0);
|
|
ClassOrInterface aClass = sf.getClasses().get(1);
|
|
|
|
|
|
AssumptionMap assumptionMap = new AssumptionMap();
|
|
|
|
TI ti = new TI(assumptionMap, aClass);
|
|
|
|
TI ti1 = new TI(ti.assresult, mainClass);
|
|
|
|
// Take The Generatet Constraints from ti:
|
|
// Try To Solve
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception exc) {
|
|
exc.printStackTrace();
|
|
fail();
|
|
}
|
|
assertTrue("Tests durchlaufen", filenames.size() > 0);
|
|
}
|
|
}
|