< prev index next >

test/jdk/com/sun/tools/jextract/Runner.java

Print this page

        

*** 59,69 **** import static org.testng.Assert.fail; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Factory; import org.testng.annotations.Test; ! import com.sun.tools.jextract.*; /* * @test * @summary Main test runner created all cases * @modules java.base/jdk.internal.org.objectweb.asm --- 59,69 ---- import static org.testng.Assert.fail; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Factory; import org.testng.annotations.Test; ! import com.sun.tools.jextract.Context; /* * @test * @summary Main test runner created all cases * @modules java.base/jdk.internal.org.objectweb.asm
*** 84,94 **** private Map<String, byte[]> actualClz; private ClassLoader actualCL; private Object[][] clz_data; public Runner(Path nativeSrc, String pkg, Path[] javaSrcFiles) { ! ctx = Context.newInstance(); this.nativeSrc = nativeSrc; this.pkg = pkg; this.javaSrcFiles = javaSrcFiles; } --- 84,94 ---- private Map<String, byte[]> actualClz; private ClassLoader actualCL; private Object[][] clz_data; public Runner(Path nativeSrc, String pkg, Path[] javaSrcFiles) { ! this.ctx = new Context(); this.nativeSrc = nativeSrc; this.pkg = pkg; this.javaSrcFiles = javaSrcFiles; }
*** 97,107 **** throw new IllegalArgumentException("Cannot read the file: " + nativeSrc); } Path p = nativeSrc.toAbsolutePath(); ctx.usePackageForFolder(p.getParent(), pkg); ctx.addSource(p); ! ctx.parse(AsmCodeFactory::new); return ctx.collectClasses(pkg); } private InMemoryFileManager<StandardJavaFileManager> compileJavaCode() { JavaCompiler cl = ToolProvider.getSystemJavaCompiler(); --- 97,107 ---- throw new IllegalArgumentException("Cannot read the file: " + nativeSrc); } Path p = nativeSrc.toAbsolutePath(); ctx.usePackageForFolder(p.getParent(), pkg); ctx.addSource(p); ! ctx.parse(); return ctx.collectClasses(pkg); } private InMemoryFileManager<StandardJavaFileManager> compileJavaCode() { JavaCompiler cl = ToolProvider.getSystemJavaCompiler();
< prev index next >