test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java	Mon Apr  9 12:06:52 2018
--- new/test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java	Mon Apr  9 12:06:52 2018

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 67,138 **** --- 67,136 ---- private ArrayList<TestCase> testCaseTable = new ArrayList<TestCase>(); public static String infoDuringDump(String option) { ! return "Info: the " + option + " option is ignored when dumping the shared archive"; ! return "Cannot use the following option when dumping the shared archive: " + option; } public void runTests() throws Exception { testCaseTable.add(new TestCase( "basic: Basic dump and execute, to verify the test plumbing works", "", "", 0, ! "", "", 0, true) ); String bcpArg = "-Xbootclasspath/a:" + TestCommon.getTestJar("hello_more.jar"); testCaseTable.add(new TestCase( "Xbootclasspath/a: is OK for both dump and run time", bcpArg, "", 0, ! bcpArg, "", 0, true) ); testCaseTable.add(new TestCase( "module-path-01: --module-path is ignored for dump time", ! "--module-path mods", "", 0, infoDuringDump("--module-path"), 0, null, null, 0) ); + null, null, 0, true) ); testCaseTable.add(new TestCase( "module-path-02: --module-path is ok for run time", "", "", 0, ! "--module-path mods", "", 0, true) ); testCaseTable.add(new TestCase( "add-modules-01: --add-modules is ok at dump time", "--add-modules java.management", "", 0, ! null, null, 0, true) ); testCaseTable.add(new TestCase( "add-modules-02: --add-modules is ok at run time", "", "", 0, ! "--add-modules java.management", "", 0, true) ); testCaseTable.add(new TestCase( "limit-modules-01: --limit-modules is ignored at dump time", "--limit-modules java.base", ! infoDuringDump("--limit-modules"), 0, ! null, null, 0) ); ! infoDuringDump("--limit-modules"), 1, ! null, null, 0, true) ); testCaseTable.add(new TestCase( "limit-modules-02: --limit-modules is ok at run time", "", "", 0, ! "--limit-modules java.base", "", 0, false) ); testCaseTable.add(new TestCase( "upgrade-module-path-01: --upgrade-module-path is ignored at dump time", "--upgrade-module-path mods", ! infoDuringDump("--upgrade-module-path"), 0, ! null, null, 0) ); ! infoDuringDump("--upgrade-module-path"), 1, ! null, null, 0, true) ); testCaseTable.add(new TestCase( "-upgrade-module-path-module-path-02: --upgrade-module-path is ok at run time", "", "", 0, ! "--upgrade-module-path mods", "", 0, false) ); for (TestCase tc : testCaseTable) tc.execute(); }
*** 143,168 **** --- 141,169 ---- String dumpTimeExpectedOutput; int dumpTimeExpectedExitValue; String runTimeArgs; String runTimeExpectedOutput; int runTimeExpectedExitValue; + boolean sharingOn; private String appJar = TestCommon.getTestJar("hello.jar"); private String appClasses[] = {"Hello"}; public TestCase(String description, String dumpTimeArgs, String dumpTimeExpectedOutput, int dumpTimeExpectedExitValue, ! String runTimeArgs, String runTimeExpectedOutput, int runTimeExpectedExitValue) { ! String runTimeArgs, String runTimeExpectedOutput, int runTimeExpectedExitValue, + boolean sharingOn) { this.description = description; this.dumpTimeArgs = dumpTimeArgs; this.dumpTimeExpectedOutput = dumpTimeExpectedOutput; this.dumpTimeExpectedExitValue = dumpTimeExpectedExitValue; this.runTimeArgs = runTimeArgs; this.runTimeExpectedOutput = runTimeExpectedOutput; this.runTimeExpectedExitValue = runTimeExpectedExitValue; + this.sharingOn = sharingOn; } public void execute() throws Exception { System.out.println("Description: " + description);
*** 181,192 **** --- 182,199 ---- // ===== exec step - use the archive if (runTimeArgs != null) { OutputAnalyzer execOutput = TestCommon.exec(appJar, getRunOptions()); if (runTimeExpectedExitValue == 0) { + if (sharingOn) { TestCommon.checkExec(execOutput, runTimeExpectedOutput, "Hello World"); } else { + execOutput.shouldHaveExitValue(0) + .shouldContain(runTimeExpectedOutput) + .shouldContain("Hello World"); + } + } else { execOutput.shouldMatch(dumpTimeExpectedOutput); execOutput.shouldHaveExitValue(dumpTimeExpectedExitValue); } } }

test/hotspot/jtreg/runtime/appcds/jigsaw/JigsawOptionsCombo.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File