< prev index next >
test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
Print this page
@@ -28,21 +28,21 @@
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 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 ProxyClassAccessTest q.NP CompilerUtils jdk.testlibrary.*
+ * @build ProxyClassAccessTest q.NP CompilerUtils jdk.testlibrary.tasks.JavaTask
* @run testng ProxyClassAccessTest
* @summary Driver for testing proxy class doesn't have access to
* types referenced by proxy interfaces
*/
@@ -70,25 +70,22 @@
/**
* Run the modular test
*/
@Test
- public void runTest() throws Exception {
- int exitValue = executeTestJava("--module-path", MODS_DIR.toString(),
- "-m", "test/jdk.test.ProxyClassAccess")
- .outputTo(System.out)
- .errorTo(System.out)
- .getExitValue();
-
- assertTrue(exitValue == 0);
+ public void runTest() {
+ new JavaTask().ignoreStandardModuleOptions()
+ .modulePath(MODS_DIR)
+ .module("test", "jdk.test.ProxyClassAccess")
+ .run();
}
/**
* Test unnamed module has no access to other proxy interface
*/
@Test
- public void testNoReadAccess() throws Exception {
+ public void testNoReadAccess() throws ClassNotFoundException {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
Layer bootLayer = Layer.boot();
Configuration cf = bootLayer
.configuration()
.resolveRequiresAndUses(ModuleFinder.of(), finder, modules);
< prev index next >