--- old/test/jdk/java/util/prefs/ExportSubtree.java 2019-01-25 16:10:12.152826728 +0000 +++ new/test/jdk/java/util/prefs/ExportSubtree.java 2019-01-25 16:10:11.832825601 +0000 @@ -23,7 +23,7 @@ /* @test - * @bug 6203576 4700020 7197662 + * @bug 6203576 4700020 7197662 8217777 * @summary checks if the output of exportSubtree() is identical to * the output from previous release. * @run main/othervm -Djava.util.prefs.userRoot=. ExportSubtree @@ -34,22 +34,15 @@ public class ExportSubtree { public static void main(String[] args) throws Exception { - try - { - //File f = new File(System.getProperty("test.src", "."), "TestPrefs.xml"); - ByteArrayInputStream bais = new ByteArrayInputStream(importPrefs.getBytes("utf-8")); - Preferences.importPreferences(bais); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - Preferences.userRoot().node("testExportSubtree").exportSubtree(baos); - Preferences.userRoot().node("testExportSubtree").removeNode(); - if (!expectedResult.equals(baos.toString())) { - //System.out.print(baos.toString()); - //System.out.print(expectedResult); - throw new IOException("exportSubtree does not output expected result"); - } - } - catch( Exception e ) { - e.printStackTrace(); + ByteArrayInputStream bais = new ByteArrayInputStream(importPrefs.getBytes("utf-8")); + Preferences.importPreferences(bais); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + Preferences.userRoot().node("testExportSubtree").exportSubtree(baos); + Preferences.userRoot().node("testExportSubtree").removeNode(); + if (!expectedResult.equals(baos.toString())) { + System.out.print("Actual: \n"+baos.toString()); + System.out.print("Expected: \n"+expectedResult); + throw new IOException("exportSubtree does not output expected result"); } } @@ -76,7 +69,7 @@ + ""; static String expectedResult = - "" + "" + ls + "" + ls + "" + ls + " "