changeset 56628:184b05daf50f

8225386: test for JDK-8216261 fails in Windows Reviewed-by: jjg
author vromero
date Wed, 05 Jun 2019 21:50:29 -0400
parents e2987b9baa93
children 261cd181eb50
files test/langtools/tools/javap/default_methods/JavapNotPrintingDefaultModifierTest.java
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javap/default_methods/JavapNotPrintingDefaultModifierTest.java	Wed Jun 05 16:10:08 2019 -0700
+++ b/test/langtools/tools/javap/default_methods/JavapNotPrintingDefaultModifierTest.java	Wed Jun 05 21:50:29 2019 -0400
@@ -46,11 +46,12 @@
         void foo();
     }
 
-    private static final String expectedOutput =
-            "interface JavapNotPrintingDefaultModifierTest$SimpleInterface {\n" +
-            "  public default void defaultMethod();\n" +
-            "  public abstract void foo();\n" +
-            "}";
+    private static final List<String> expectedOutput = List.of(
+            "Compiled from \"JavapNotPrintingDefaultModifierTest.java\"",
+            "interface JavapNotPrintingDefaultModifierTest$SimpleInterface {",
+            "  public default void defaultMethod();",
+            "  public abstract void foo();",
+            "}");
 
     JavapNotPrintingDefaultModifierTest() throws Exception {
         super(System.err);
@@ -68,12 +69,13 @@
     @Test
     public void testMain(Path base) throws Exception {
         Path testClassesPath = Paths.get(System.getProperty("test.classes"));
-        String output = new JavapTask(tb)
+        List<String> output = new JavapTask(tb)
                 .options("-p", testClassesPath.resolve(this.getClass().getSimpleName() + "$SimpleInterface.class").toString())
                 .run()
                 .writeAll()
-                .getOutput(Task.OutputKind.DIRECT);
-        if (!output.contains(expectedOutput)) {
+                .getOutputLines(Task.OutputKind.DIRECT);
+        System.out.println(output);
+        if (!output.equals(expectedOutput)) {
             throw new AssertionError(String.format("unexpected output:\n %s", output));
         }
     }