< prev index next >

test/jdk/tools/jpackage/JPackageHelpTest.java

Print this page




  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  * @summary jpackage help test
  27  * @library helpers
  28  * @build JPackageHelper
  29  * @build JPackagePath
  30  * @modules jdk.jpackage
  31  * @run main/othervm -Xmx512m JPackageHelpTest
  32  */
  33 public class JPackageHelpTest {
  34 
  35     // Platform specific help messages.
  36     private static final String WINDOWS_HELP =
  37             "The following options are valid for Windows platforms";
  38     private static final String OSX_HELP =
  39             "The following options are valid for Mac OS X platforms";
  40     private static final String LINUX_HELP =
  41             "The following options are valid for Linux platforms";
  42 
  43     private static void validate(String output1, String output2)
  44             throws Exception {
  45         if (output1.split("\n").length < 25) {
  46             throw new AssertionError("jpacakger --help failed");
  47         }
  48 
  49         if (output2.split("\n").length < 25) {
  50             throw new AssertionError("jpacakger -h failed");
  51         }
  52 
  53         // Make sure output matches for --help and -h
  54         if (!output1.equals(output2)) {
  55             System.err.println("================= --help =================");
  56             System.err.println(output1);
  57 
  58             System.err.println("=================== -h ===================");
  59             System.err.println(output2);
  60 
  61             throw new AssertionError(




  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  * @summary jpackage help test
  27  * @library helpers
  28  * @build JPackageHelper
  29  * @build JPackagePath
  30  * @modules jdk.jpackage
  31  * @run main/othervm -Xmx512m JPackageHelpTest
  32  */
  33 public class JPackageHelpTest {
  34 
  35     // Platform specific help messages.
  36     private static final String WINDOWS_HELP =
  37             "--win-dir-chooser";
  38     private static final String OSX_HELP =
  39             "--mac-bundle-identifier";
  40     private static final String LINUX_HELP =
  41             "--linux-bundle-name";
  42 
  43     private static void validate(String output1, String output2)
  44             throws Exception {
  45         if (output1.split("\n").length < 25) {
  46             throw new AssertionError("jpacakger --help failed");
  47         }
  48 
  49         if (output2.split("\n").length < 25) {
  50             throw new AssertionError("jpacakger -h failed");
  51         }
  52 
  53         // Make sure output matches for --help and -h
  54         if (!output1.equals(output2)) {
  55             System.err.println("================= --help =================");
  56             System.err.println(output1);
  57 
  58             System.err.println("=================== -h ===================");
  59             System.err.println(output2);
  60 
  61             throw new AssertionError(


< prev index next >