JavaTXCompilerInJavaTXNoMaven/tests/TestPackages.java
2024-05-27 22:38:59 +02:00

52 lines
1.5 KiB
Java

import de.dhbwstuttgart.core.JavaTXCompiler;
import org.junit.Ignore;
import org.junit.Test;
import java.io.File;
import java.util.List;
public class TestPackages {
private static final String bytecodeDirectory = System.getProperty("user.dir") + "/targetTest";
@Test
public void testPackages() throws Exception {
var cmp = new JavaTXCompiler(
List.of(
new File("resources/packageTest/pkg/sub/Test1.jav") // This should pull in Test2
//new File("resources/packageTest/pkg/sub2/Test2.jav")
),
List.of(new File("resources/packageTest")),
new File(bytecodeDirectory)
);
cmp.generateBytecode();
}
@Test
@Ignore("This doesn't work")
public void testPackagesCircular() throws Exception {
var cmp = new JavaTXCompiler(
List.of(
new File("resources/packageTest/pkg/sub/Cycle1.jav")
//new File("resources/packageTest/pkg/sub2/Cycle2.jav")
),
List.of(new File("resources/packageTest")),
new File(bytecodeDirectory)
);
cmp.generateBytecode();
}
@Test
public void testPackageInterface() throws Exception {
var cmp = new JavaTXCompiler(
List.of(new File("resources/packageTest/pkg/sub/Interface.jav")),
List.of(new File("resources/packageTest")),
new File(bytecodeDirectory)
);
cmp.generateBytecode();
}
}