< prev index next >

test/java/lang/invoke/modules/ModuleAccessControlTest.java

Print this page

        

*** 24,44 **** import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; ! import static jdk.testlibrary.ProcessTools.executeTestJava; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.Assert.*; /** * @test * @library /lib/testlibrary * @modules jdk.compiler ! * @build CompilerUtils jdk.testlibrary.* * @run testng ModuleAccessControlTest * @summary Driver for testing module access checking by MethodHandles.Lookup */ public class ModuleAccessControlTest { --- 24,44 ---- import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; ! import jdk.testlibrary.tasks.JavaTask; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.Assert.*; /** * @test * @library /lib/testlibrary * @modules jdk.compiler ! * @build CompilerUtils jdk.testlibrary.tasks.JavaTask * @run testng ModuleAccessControlTest * @summary Driver for testing module access checking by MethodHandles.Lookup */ public class ModuleAccessControlTest {
*** 67,81 **** /** * Launch the test */ @Test public void runTest() throws Exception { ! int exitValue = executeTestJava("--module-path", MODS_DIR.toString(), ! "-m", "m1/p1.Main") ! .outputTo(System.out) ! .errorTo(System.out) ! .getExitValue(); ! ! assertTrue(exitValue == 0); } } --- 67,77 ---- /** * Launch the test */ @Test public void runTest() throws Exception { ! new JavaTask().ignoreStandardModuleOptions() ! .modulepath(MODS_DIR.toString()) ! .moduleName("m1").className("p1.Main").run(); } }
< prev index next >