test/jdk/tools/jpackage/JPackageNoArgTest.java
branchJDK-8200758-branch
changeset 57071 94e9270166f0
parent 57039 98d3963b0b7b
child 57106 ea870b9ce89a
--- a/test/jdk/tools/jpackage/JPackageNoArgTest.java	Tue Dec 11 12:54:18 2018 -0500
+++ b/test/jdk/tools/jpackage/JPackageNoArgTest.java	Wed Dec 12 08:27:16 2018 -0500
@@ -33,8 +33,8 @@
 public class JPackageNoArgTest {
 
     private static final String RESULT1 = "Usage: jpackage <mode> <options>";
-    private static final String RESULT2 =
-            "Use --help for a list of possible options";
+    private static final String[] EXPECTED =
+            {"--help", "list of possible options"};
 
     private static void validate(String output) throws Exception {
         String[] result = output.split("\n");
@@ -50,10 +50,12 @@
             throw new AssertionError("Unexpected line 1");
         }
 
-        if (!result[1].trim().equals(RESULT2)) {
-            System.err.println("Expected: " + RESULT2);
-            System.err.println("Actual: " + result[1]);
-            throw new AssertionError("Unexpected line 2");
+        for (String expected : EXPECTED) {
+            if (!result[1].contains(expected)) {
+                System.err.println("Expected to contain: " + expected);
+                System.err.println("Actual: " + result[1]);
+                throw new AssertionError("Unexpected line 2");
+            }
         }
     }