Alle Bytecode Tests in SourceBytecodeTests transformiert

This commit is contained in:
Enrico Schrödter 2016-04-29 09:43:36 +02:00
parent bbb79b1a1d
commit dad06a5626
39 changed files with 455 additions and 286 deletions

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class AssignTest { public class AssignTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Assign.jav"; testName = "Assign";
public final static String outputFile = "Assign.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class BinaryTest { public class BinaryTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Binary.jav"; testName = "Binary";
public final static String outputFile = "Binary.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class BinaryTest2 { public class BinaryTest2 extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Binary2.jav"; testName = "Binary2";
public final static String outputFile = "Binary2.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class BoolLitTest { public class BoolLitTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "BoolLit.jav"; testName = "BoolLit";
public final static String outputFile = "BoolLit.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class CharLitTest { public class CharLitTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "CharLitTest.jav"; testName = "CharLit";
public final static String outputFile = "CharLitTest.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class ConditionTest { public class ConditionTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Condition.jav"; testName = "Condition";
public final static String outputFile = "Condition.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class EmptyClassTest { public class EmptyClassTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "EmptyClass.jav"; testName = "EmptyClass";
public final static String outputFile = "EmptyClass.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class FieldDeclarationTest { public class FieldDeclarationTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "FieldDeclaration.jav"; protected void init() {
public final static String outputFile = "FieldDeclaration.class"; testName = "FieldDeclaration";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -3,14 +3,20 @@ package bytecode;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
public class ForTest { public class ForTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "ForTest.jav"; protected void init() {
public final static String outputFile = "ForTest.class"; testName = "ForTest";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
@Ignore public void testConstruct() throws Exception{
public void test() { ClassLoader classLoader = getClassLoader();
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IdTest { public class IdTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Id.jav"; protected void init() {
public final static String outputFile = "Id.class"; testName = "Id";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -1,3 +1,3 @@
class Id { class IdentityField {
<GPM, FNF extends GPM> Fun1<? extends GPM, ? super FNF> op = (x) -> x; <GPM, FNF extends GPM> Fun1<? extends GPM, ? super FNF> op = (x) -> x;
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IdentityFieldTest { public class IdentityFieldTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "IdentityField.jav"; protected void init() {
public final static String outputFile = "IdentityField.class"; testName = "IdentityField";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IdentityTest { public class IdentityTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Identity.jav"; protected void init() {
public final static String outputFile = "Identity.class"; testName = "Identity";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -4,6 +4,8 @@ class IfElseIfStatement{
return 0; return 0;
}else if(flag){ }else if(flag){
return 1; return 1;
}else{
return 2;
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IfElseIfStatementTest { public class IfElseIfStatementTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "IfElseIfStatement.jav"; protected void init() {
public final static String outputFile = "IfElseIfStatement.class"; testName = "IfElseIfStatement";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IfElseStatementTest { public class IfElseStatementTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "IfElseStatement.jav"; protected void init() {
public final static String outputFile = "IfElseStatement.class"; testName = "IfElseStatement";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class IfStatementTest { public class IfStatementTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "IfStatement.jav"; protected void init() {
public final static String outputFile = "IfStatement.class"; testName = "IfStatement";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -21,16 +21,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class LambdaExpr2 { public class LambdaExpr2Test extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "LambdaExpr2.jav"; testName = "LambdaExpr";
public final static String outputFile = "LambdaExpr2.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
@Ignore public void testConstruct() throws Exception{
public void test() { ClassLoader classLoader = getClassLoader();
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class LambdaExpr { public class LambdaExprTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "LambdaExpr.jav"; testName = "LambdaExpr";
public final static String outputFile = "LambdaExpr.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class MainTest { public class MainTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Main.jav"; testName = "Main";
public final static String outputFile = "Main.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -1,5 +1,5 @@
import java.util.Vector; import java.util.Vector;
class Matrix extends Vector<Vector<Integer>> { class Matrix_lambda extends Vector<Vector<Integer>> {
op = (Matrix m) -> (f) -> f.apply(this, m); op = (Matrix m) -> (f) -> f.apply(this, m);
} }

View File

@ -1,4 +1,4 @@
class Matrix2 { class Matrix_lambda2 {
op = (f) -> f.apply(2); op = (f) -> f.apply(2);
} }

View File

@ -1,4 +1,4 @@
class Matrix3 { class Matrix_lambda3 {
op = (f) -> f.apply(); op = (f) -> f.apply();
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class Matrix_lambdaTest { public class Matrix_lambdaTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Matrix_lambda.jav"; protected void init() {
public final static String outputFile = "Matrix_lambda.class"; testName = "Matrix_lambda";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class Matrix_lambdaTest2 { public class Matrix_lambdaTest2 extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Matrix_lambda2.jav"; protected void init() {
public final static String outputFile = "Matrix2.class"; testName = "Matrix_lambda2";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class Matrix_lambdaTest3 { public class Matrix_lambdaTest3 extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Matrix_lambda3.jav"; protected void init() {
public final static String outputFile = "Matrix3.class"; testName = "Matrix_lambda3";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class MethodCallTest { public class MethodCallTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "MethodCall.jav"; testName = "MethodCall";
public final static String outputFile = "MethodCall.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class MethodEmpty { public class MethodEmpty extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "MethodEmpty.jav"; testName = "MethodEmpty";
public final static String outputFile = "MethodEmpty.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class MethodEmptyRetType { public class MethodEmptyRetType extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "MethodEmptyRetType.jav"; testName = "MethodEmptyRetType";
public final static String outputFile = "MethodEmptyRetType.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -23,35 +23,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class NewStatementTest { public class NewStatementTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "NewStatement.jav"; testName = "NewStatement";
public final static String outputFile = "NewStatement.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory); ClassLoader classLoader = getClassLoader();
}
/*
@Test
public void testUntypedVectorDeclaredMethods() {
try{
File file = new File(System.getProperty("user.dir")+"/test/bytecode/types/");
URL url = file.toURL();
URL[] urls = new URL[]{url};
ClassLoader classLoader = new URLClassLoader(urls); Class cls = classLoader.loadClass(testName);
Class untypedVectorTest = classLoader.loadClass("UntypedVector"); Object obj = cls.newInstance();
assertTrue(true);
for(Method method: untypedVectorTest.getDeclaredMethods()){
System.out.println(method.toGenericString());
}
}catch(Exception e){
throw new RuntimeException(e);
}
} }
*/
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class ParameterTest { public class ParameterTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Parameter.jav"; testName = "Parameter";
public final static String outputFile = "Parameter.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -21,16 +21,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class PostDecrement { public class PostDecrement extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "PostDecrement.jav"; testName = "PostDecrement";
public final static String outputFile = "PostDecrement.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
@Ignore public void testConstruct() throws Exception{
public void test() { ClassLoader classLoader = getClassLoader();
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -21,16 +21,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class PostIncrement { public class PostIncrement extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "PostIncrement.jav"; testName = "PostIncrement";
public final static String outputFile = "PostIncrement.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
@Ignore public void testConstruct() throws Exception{
public void test() { ClassLoader classLoader = getClassLoader();
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile);
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class ReturnTest { public class ReturnTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "Return.jav"; testName = "Return";
public final static String outputFile = "Return.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class RunnableTest { public class RunnableTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "Runnable.jav"; protected void init() {
public final static String outputFile = "Runnable.class"; testName = "Runnable";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class StringLitTest { public class StringLitTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "StringLitTest.jav"; testName = "StringLitTest";
public final static String outputFile = "StringLitTest.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -20,15 +20,20 @@ import de.dhbwstuttgart.typeinference.Menge;
import de.dhbwstuttgart.typeinference.TypeinferenceResultSet; import de.dhbwstuttgart.typeinference.TypeinferenceResultSet;
import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet; import de.dhbwstuttgart.typeinference.typedeployment.TypeInsertSet;
public class SystemOutPrintlnTest { public class SystemOutPrintlnTest extends SourceFileBytecodeTest{
@Override
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; protected void init() {
public final static String testFile = "SystemOutPrintln.jav"; testName = "SystemOutPrintln";
public final static String outputFile = "SystemOutPrintln.class"; rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
}
} Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
}
}

View File

@ -1,6 +1,6 @@
class Test3{ class Test3{
public static void main(String[] args){ public static void main(String[] args){
System.out.println(new LambdaExpr2().op.apply()); System.out.println(new LambdaExpr2Test().op.apply());
} }
} }

View File

@ -2,13 +2,20 @@ package bytecode;
import org.junit.Test; import org.junit.Test;
public class WhileTest { public class WhileTest extends SourceFileBytecodeTest{
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/"; @Override
public final static String testFile = "WhileTest.jav"; protected void init() {
public final static String outputFile = "WhileTest.class"; testName = "WhileTest";
rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
}
@Test @Test
public void test() { public void testConstruct() throws Exception{
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputFile); ClassLoader classLoader = getClassLoader();
Class cls = classLoader.loadClass(testName);
Object obj = cls.newInstance();
assertTrue(true);
} }
} }