7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @modules java.xml
27 * @library /lib/testlibrary
28 * @build DescribeModuleTest jdk.testlibrary.*
29 * @run testng DescribeModuleTest
30 * @summary Basic test for java --describe-module
31 */
32
33 import jdk.testlibrary.ProcessTools;
34
35 import org.testng.annotations.Test;
36 import static org.testng.Assert.*;
37
38 @Test
39 public class DescribeModuleTest {
40
41 /**
42 * Test that the output describes java.base
43 */
44 private void expectJavaBase(String... args) throws Exception {
45 int exitValue = ProcessTools.executeTestJava(args)
46 .outputTo(System.out)
47 .errorTo(System.out)
48 .stdoutShouldContain("java.base")
49 .stdoutShouldContain("exports java.lang")
50 .stdoutShouldContain("uses java.nio.file.spi.FileSystemProvider")
51 .stdoutShouldContain("contains sun.launcher")
52 .stdoutShouldNotContain("requires ")
53 .getExitValue();
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @modules java.xml
27 * @library /test/lib
28 * @build DescribeModuleTest
29 * @run testng DescribeModuleTest
30 * @summary Basic test for java --describe-module
31 */
32
33 import jdk.test.lib.process.ProcessTools;
34
35 import org.testng.annotations.Test;
36 import static org.testng.Assert.*;
37
38 @Test
39 public class DescribeModuleTest {
40
41 /**
42 * Test that the output describes java.base
43 */
44 private void expectJavaBase(String... args) throws Exception {
45 int exitValue = ProcessTools.executeTestJava(args)
46 .outputTo(System.out)
47 .errorTo(System.out)
48 .stdoutShouldContain("java.base")
49 .stdoutShouldContain("exports java.lang")
50 .stdoutShouldContain("uses java.nio.file.spi.FileSystemProvider")
51 .stdoutShouldContain("contains sun.launcher")
52 .stdoutShouldNotContain("requires ")
53 .getExitValue();
|