modified: ../resources/AllgemeinTest/Box.jav
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 6m43s

modified:   ../resources/bytecode/javFiles/Box.jav
	modified:   ../src/test/java/AllgemeinTest.java
	modified:   ../src/test/java/TestComplete.java
This commit is contained in:
pl@gohorb.ba-horb.de 2024-05-15 14:26:42 +02:00
parent 39f04b1a1b
commit c3343959c5
4 changed files with 19 additions and 15 deletions

View File

@ -2,9 +2,7 @@ class Box<A> {
A a;
Box(A a) {
public Box(A a) {
this.a = a;
}
}
}

View File

@ -1,7 +1,9 @@
class B { }
class Box_Main extends B {
m(b) {
b.m(new Box_Main());
b.m(new B());
}
}
class Box<A> {
A a;
Box() { }
Box(A a) {
//this.a = a;
}
}

View File

@ -1,6 +1,7 @@
import static org.junit.Assert.*;
import static targetast.TestCodegen.generateClassFiles;
import java.io.File;
import java.lang.reflect.Field;
@ -14,6 +15,7 @@ import org.junit.Test;
import com.google.common.collect.Lists;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.environment.ByteArrayClassLoader;
public class AllgemeinTest {
@ -62,7 +64,9 @@ public class AllgemeinTest {
//String className = "Cycle";
//String className = "TripleTest";
//String className = "WildcardList";
String className = "List";
//String className = "List";
//String className = "Box";
String className = "GenBox";
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav";
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
@ -74,7 +78,7 @@ public class AllgemeinTest {
Lists.newArrayList(new File(System.getProperty("user.dir")+"/resources/bytecode/classFiles/")),
new File(System.getProperty("user.dir")+"/resources/bytecode/classFiles/"));
//*/
compiler.generateBytecode(new File(path));
compiler.generateBytecode();
pathToClassFile = System.getProperty("user.dir")+"/resources/bytecode/classFiles/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass(className);

View File

@ -606,10 +606,10 @@ public class TestComplete {
}
@Test
@Ignore("This one isn't working")
//@Ignore("This one isn't working")
public void boxTest() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Box.jav");
var instance = classFiles.get("Box_Main").getDeclaredConstructor().newInstance();
var instance = classFiles.get("Box").getDeclaredConstructor().newInstance();
}
@Test