forked from JavaTX/JavaCompilerCore
new file: ../../../java/bytecode/mathStrucMatrixOPTest.java.txt new file: ../../../java/bytecode/mathStrucVectorAddTest.java.txt new file: ../../../java/packages/mathStrucMatrixOPTest.java.txt new file: ../../AllgemeinTest/FCTest1.jav new file: ../../AllgemeinTest/FCTest2.jav new file: ../../AllgemeinTest/FCTest3.jav new file: ../../AllgemeinTest/GenTest.jav new file: ../../AllgemeinTest/Generics.jav new file: ../../AllgemeinTest/OverloadingMain.jav new file: ../../AllgemeinTest/Overloading_Generics.jav new file: ../../AllgemeinTest/OverrideMain.jav new file: ../../AllgemeinTest/OverrideMainRet.jav new file: ../../AllgemeinTest/Pair.java
41 lines
1.3 KiB
Plaintext
41 lines
1.3 KiB
Plaintext
package bytecode;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import java.io.File;
|
|
import java.lang.reflect.Field;
|
|
import java.net.URL;
|
|
import java.net.URLClassLoader;
|
|
|
|
import org.junit.BeforeClass;
|
|
import org.junit.Test;
|
|
|
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
|
|
|
public class mathStrucMatrixOPTest {
|
|
|
|
private static String path;
|
|
private static File fileToTest;
|
|
private static JavaTXCompiler compiler;
|
|
private static ClassLoader loader;
|
|
private static Class<?> classToTest;
|
|
private static String pathToClassFile;
|
|
private static Object instanceOfClass;
|
|
|
|
|
|
@Test
|
|
public void test() throws Exception {
|
|
//PL 2019-10-24: laeuft nicht durch deshalb ersetzt
|
|
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/mathStrucMatrixOp.jav";
|
|
//path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/mathStrucInteger.jav";
|
|
fileToTest = new File(path);
|
|
compiler = new JavaTXCompiler(fileToTest);
|
|
compiler.generateBytecode(System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/");
|
|
pathToClassFile = System.getProperty("user.dir")+"/src/test/resources/testBytecode/generatedBC/";
|
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
|
classToTest = loader.loadClass("mathStrucMatrixOP");
|
|
instanceOfClass = classToTest.getDeclaredConstructor(Object.class).newInstance("A");
|
|
}
|
|
|
|
}
|