27 * @summary Test proper handling of the --release option.
28 * @modules
29 * jdk.compiler/com.sun.tools.javac.jvm
30 * jdk.compiler/com.sun.tools.javac.platform
31 * jdk.jdeps/com.sun.tools.jdeprscan
32 * @build jdk.jdeprscan.TestRelease
33 * @run testng jdk.jdeprscan.TestRelease
34 */
35
36 package jdk.jdeprscan;
37
38 import com.sun.tools.javac.platform.JDKPlatformProvider;
39 import com.sun.tools.jdeprscan.Main;
40 import org.testng.annotations.Test;
41
42 import static org.testng.Assert.assertFalse;
43 import static org.testng.Assert.assertTrue;
44
45 public class TestRelease {
46 static boolean invoke(String arg) {
47 return Main.call(System.out, System.err, "--list", "--release", arg);
48 }
49
50 @Test
51 public void testSuccess() {
52 for (String target : new JDKPlatformProvider().getSupportedPlatformNames()) {
53 assertTrue(invoke(target));
54 }
55 }
56
57 @Test
58 public void testFailure() {
59 assertFalse(invoke("5"));
60 }
61 }
|
27 * @summary Test proper handling of the --release option.
28 * @modules
29 * jdk.compiler/com.sun.tools.javac.jvm
30 * jdk.compiler/com.sun.tools.javac.platform
31 * jdk.jdeps/com.sun.tools.jdeprscan
32 * @build jdk.jdeprscan.TestRelease
33 * @run testng jdk.jdeprscan.TestRelease
34 */
35
36 package jdk.jdeprscan;
37
38 import com.sun.tools.javac.platform.JDKPlatformProvider;
39 import com.sun.tools.jdeprscan.Main;
40 import org.testng.annotations.Test;
41
42 import static org.testng.Assert.assertFalse;
43 import static org.testng.Assert.assertTrue;
44
45 public class TestRelease {
46 static boolean invoke(String arg) {
47 System.err.println(">>> invoking Main.call with arguments: --list --release " + arg);
48 boolean r = Main.call(System.out, System.err, "--list", "--release", arg);
49 System.err.println(">>> Main.call returned " + r);
50 return r;
51 }
52
53 @Test
54 public void testSuccess() {
55 for (String target : new JDKPlatformProvider().getSupportedPlatformNames()) {
56 assertTrue(invoke(target));
57 }
58 }
59
60 @Test
61 public void testFailure() {
62 assertFalse(invoke("5"));
63 }
64 }
|