Skip to content

Commit 3df1852

Browse files
author
Amos Shi
committed
8210338: Better output for GenerationTests.java
Backport-of: a5f7028
1 parent 9ba9dd2 commit 3df1852

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

test/jdk/javax/xml/crypto/dsig/GenerationTests.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public static void main(String args[]) throws Exception {
352352
try (Http server = Http.startServer()) {
353353
server.start();
354354

355-
// tests for XML documents
355+
System.out.println("\ntests for XML documents");
356356
Arrays.stream(canonicalizationMethods).forEach(c ->
357357
Arrays.stream(allSignatureMethods).forEach(s ->
358358
Arrays.stream(allDigestMethods).forEach(d ->
@@ -366,7 +366,7 @@ public static void main(String args[]) throws Exception {
366366
}
367367
})))));
368368

369-
// tests for text data with no transform
369+
System.out.println("\ntests for text data with no transform");
370370
Arrays.stream(canonicalizationMethods).forEach(c ->
371371
Arrays.stream(allSignatureMethods).forEach(s ->
372372
Arrays.stream(allDigestMethods).forEach(d ->
@@ -379,7 +379,7 @@ public static void main(String args[]) throws Exception {
379379
}
380380
}))));
381381

382-
// tests for base64 data
382+
System.out.println("\ntests for base64 data");
383383
Arrays.stream(canonicalizationMethods).forEach(c ->
384384
Arrays.stream(allSignatureMethods).forEach(s ->
385385
Arrays.stream(allDigestMethods).forEach(d ->
@@ -396,7 +396,7 @@ public static void main(String args[]) throws Exception {
396396

397397
// negative tests
398398

399-
// unknown CanonicalizationMethod
399+
System.out.println("\nunknown CanonicalizationMethod");
400400
test_create_detached_signature(
401401
CanonicalizationMethod.EXCLUSIVE + BOGUS,
402402
SignatureMethod.DSA_SHA1,
@@ -408,7 +408,7 @@ public static void main(String args[]) throws Exception {
408408
true,
409409
NoSuchAlgorithmException.class);
410410

411-
// unknown SignatureMethod
411+
System.out.println("\nunknown SignatureMethod");
412412
test_create_detached_signature(
413413
CanonicalizationMethod.EXCLUSIVE,
414414
SignatureMethod.DSA_SHA1 + BOGUS,
@@ -419,7 +419,7 @@ public static void main(String args[]) throws Exception {
419419
true,
420420
NoSuchAlgorithmException.class);
421421

422-
// unknown DigestMethod
422+
System.out.println("\nunknown DigestMethod");
423423
test_create_detached_signature(
424424
CanonicalizationMethod.EXCLUSIVE,
425425
SignatureMethod.DSA_SHA1,
@@ -430,7 +430,7 @@ public static void main(String args[]) throws Exception {
430430
true,
431431
NoSuchAlgorithmException.class);
432432

433-
// unknown Transform
433+
System.out.println("\nunknown Transform");
434434
test_create_detached_signature(
435435
CanonicalizationMethod.EXCLUSIVE,
436436
SignatureMethod.DSA_SHA1,
@@ -441,7 +441,7 @@ public static void main(String args[]) throws Exception {
441441
true,
442442
NoSuchAlgorithmException.class);
443443

444-
// no source document
444+
System.out.println("\nno source document");
445445
test_create_detached_signature(
446446
CanonicalizationMethod.EXCLUSIVE,
447447
SignatureMethod.DSA_SHA1,
@@ -453,7 +453,7 @@ public static void main(String args[]) throws Exception {
453453
true,
454454
XMLSignatureException.class);
455455

456-
// wrong transform for text data
456+
System.out.println("\nwrong transform for text data");
457457
test_create_detached_signature(
458458
CanonicalizationMethod.EXCLUSIVE,
459459
SignatureMethod.DSA_SHA1,
@@ -1823,6 +1823,7 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
18231823
throws Exception {
18241824

18251825
System.out.print("-S");
1826+
System.out.flush();
18261827

18271828
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
18281829
dbf.setNamespaceAware(true);
@@ -1907,6 +1908,7 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
19071908
}
19081909

19091910
System.out.print("V");
1911+
System.out.flush();
19101912
try (ByteArrayInputStream bis = new ByteArrayInputStream(
19111913
signatureString.getBytes())) {
19121914
doc = dbf.newDocumentBuilder().parse(bis);
@@ -1930,12 +1932,14 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
19301932
boolean success = signature.validate(vc);
19311933
if (!success) {
19321934
System.out.print("x");
1935+
System.out.flush();
19331936
return false;
19341937
}
19351938

19361939
success = signature.getSignatureValue().validate(vc);
19371940
if (!success) {
19381941
System.out.print("X");
1942+
System.out.flush();
19391943
return false;
19401944
}
19411945

0 commit comments

Comments
 (0)