Tests auslagern

This commit is contained in:
JanUlrich 2017-09-19 18:51:44 +02:00
parent f81496fe1f
commit 6e03d24582
10 changed files with 95 additions and 4 deletions

View File

@ -3,7 +3,9 @@ package de.dhbwstuttgart.core;
/** /**
* Stellt die Java-Environment dar * Stellt die Java-Environment dar
* Speichert alle Typen, Klassen aus den benutzen SourceFiles und Librarys * Speichert alle Typen, Klassen aus den benutzen SourceFiles und Librarys
*
* Ersetzt die JavaClassNameRegistry
*/ */
public class CompilationEnvironment { public class CompilationEnvironment {
//
} }

15
test/javFiles/test.jav Normal file
View File

@ -0,0 +1,15 @@
class Test{
methode(param1, param2, param3) {
return param1.meth(param2.meth(param3));
}
}
interface Klasse1{
Klasse1 meth(Klasse1 p);
Klasse1 meth(Klasse2 p);
}
interface Klasse2{
Klasse1 meth(Klasse1 p):
Klasse2 meth(Klasse2 p):
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class FacultyTest extends JavaTXCompilerTest{
public FacultyTest() {
this.fileToTest = new File(rootDirectory+"Faculty.jav");
}
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class GenericsTest extends JavaTXCompilerTest{
public GenericsTest() {
this.fileToTest = new File(rootDirectory+"Generics.jav");
}
}

View File

@ -10,6 +10,8 @@ import org.junit.Test;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
@ -20,14 +22,22 @@ import java.util.Set;
public class JavaTXCompilerTest extends JavaTXCompiler { public class JavaTXCompilerTest extends JavaTXCompiler {
private static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/"; public static final String rootDirectory = System.getProperty("user.dir")+"/test/javFiles/";
private static final List<File> filesToTest = new ArrayList<>(); private static final List<File> filesToTest = new ArrayList<>();
protected File fileToTest = null;
public JavaTXCompilerTest(){
}
@Test @Test
public void test() throws IOException, java.lang.ClassNotFoundException { public void test() throws IOException, java.lang.ClassNotFoundException {
for(URL url : ((URLClassLoader) (Thread.currentThread().getContextClassLoader())).getURLs()){
System.out.println(url );
}
if(fileToTest != null)filesToTest.add(fileToTest);
//filesToTest.add(new File(rootDirectory+"Faculty.jav")); //filesToTest.add(new File(rootDirectory+"Faculty.jav"));
//filesToTest.add(new File(rootDirectory+"mathStruc.jav")); //filesToTest.add(new File(rootDirectory+"mathStruc.jav"));
filesToTest.add(new File(rootDirectory+"test.jav")); //filesToTest.add(new File(rootDirectory+"test.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda.jav")); //filesToTest.add(new File(rootDirectory+"Lambda.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda2.jav")); //filesToTest.add(new File(rootDirectory+"Lambda2.jav"));
//filesToTest.add(new File(rootDirectory+"Lambda3.jav")); //filesToTest.add(new File(rootDirectory+"Lambda3.jav"));
@ -57,3 +67,4 @@ public class JavaTXCompilerTest extends JavaTXCompiler {
} }
} }

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class Lambda2Test extends JavaTXCompilerTest{
public Lambda2Test() {
this.fileToTest = new File(rootDirectory+"Lambda2.jav");
}
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class Lambda3Test extends JavaTXCompilerTest{
public Lambda3Test() {
this.fileToTest = new File(rootDirectory+"Lambda3.jav");
}
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class LambdaTest extends JavaTXCompilerTest{
public LambdaTest() {
this.fileToTest = new File(rootDirectory+"Lambda.jav");
}
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class VectorTest extends JavaTXCompilerTest{
public VectorTest() {
this.fileToTest = new File(rootDirectory+"Vector.jav");
}
}

View File

@ -0,0 +1,9 @@
package typeinference;
import java.io.File;
public class mathStrucTest extends JavaTXCompilerTest{
public mathStrucTest() {
this.fileToTest = new File(rootDirectory+"mathStruc.jav");
}
}