8210338: Better output for GenerationTests.java
authorweijun
Tue, 04 Sep 2018 14:47:55 +0800
changeset 51623 3ee917225506
parent 51622 de1a82a239e2
child 51624 7ed777a14094
8210338: Better output for GenerationTests.java Reviewed-by: xuelei
test/jdk/javax/xml/crypto/dsig/GenerationTests.java
--- a/test/jdk/javax/xml/crypto/dsig/GenerationTests.java	Tue Sep 04 08:06:31 2018 +0200
+++ b/test/jdk/javax/xml/crypto/dsig/GenerationTests.java	Tue Sep 04 14:47:55 2018 +0800
@@ -314,7 +314,7 @@
         try (Http server = Http.startServer()) {
             server.start();
 
-            // tests for XML documents
+            System.out.println("\ntests for XML documents");
             Arrays.stream(canonicalizationMethods).forEach(c ->
                 Arrays.stream(allSignatureMethods).forEach(s ->
                     Arrays.stream(allDigestMethods).forEach(d ->
@@ -326,7 +326,7 @@
                                 }
                         })))));
 
-            // tests for text data with no transform
+            System.out.println("\ntests for text data with no transform");
             Arrays.stream(canonicalizationMethods).forEach(c ->
                 Arrays.stream(allSignatureMethods).forEach(s ->
                     Arrays.stream(allDigestMethods).forEach(d ->
@@ -337,7 +337,7 @@
                             }
                         }))));
 
-            // tests for base64 data
+            System.out.println("\ntests for base64 data");
             Arrays.stream(canonicalizationMethods).forEach(c ->
                 Arrays.stream(allSignatureMethods).forEach(s ->
                     Arrays.stream(allDigestMethods).forEach(d ->
@@ -352,7 +352,7 @@
 
             // negative tests
 
-            // unknown CanonicalizationMethod
+            System.out.println("\nunknown CanonicalizationMethod");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE + BOGUS,
                     SignatureMethod.DSA_SHA1,
@@ -364,7 +364,7 @@
                     true,
                     NoSuchAlgorithmException.class);
 
-            // unknown SignatureMethod
+            System.out.println("\nunknown SignatureMethod");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE,
                     SignatureMethod.DSA_SHA1 + BOGUS,
@@ -375,7 +375,7 @@
                     true,
                     NoSuchAlgorithmException.class);
 
-            // unknown DigestMethod
+            System.out.println("\nunknown DigestMethod");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE,
                     SignatureMethod.DSA_SHA1,
@@ -386,7 +386,7 @@
                     true,
                     NoSuchAlgorithmException.class);
 
-            // unknown Transform
+            System.out.println("\nunknown Transform");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE,
                     SignatureMethod.DSA_SHA1,
@@ -397,7 +397,7 @@
                     true,
                     NoSuchAlgorithmException.class);
 
-            // no source document
+            System.out.println("\nno source document");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE,
                     SignatureMethod.DSA_SHA1,
@@ -409,7 +409,7 @@
                     true,
                     XMLSignatureException.class);
 
-            // wrong transform for text data
+            System.out.println("\nwrong transform for text data");
             test_create_detached_signature(
                     CanonicalizationMethod.EXCLUSIVE,
                     SignatureMethod.DSA_SHA1,
@@ -1608,6 +1608,7 @@
             throws Exception {
 
         System.out.print("-S");
+        System.out.flush();
 
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
@@ -1720,6 +1721,7 @@
         }
 
         System.out.print("V");
+        System.out.flush();
         try (ByteArrayInputStream bis = new ByteArrayInputStream(
                 signatureString.getBytes())) {
             doc = dbf.newDocumentBuilder().parse(bis);
@@ -1743,12 +1745,14 @@
         boolean success = signature.validate(vc);
         if (!success) {
             System.out.print("x");
+            System.out.flush();
             return false;
         }
 
         success = signature.getSignatureValue().validate(vc);
         if (!success) {
             System.out.print("X");
+            System.out.flush();
             return false;
         }