Skip to content

Commit 291d43a

Browse files
committed
JDK-8365608: Test is skipped without skip exception /test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java
1 parent 0ad919c commit 291d43a

File tree

8 files changed

+20
-15
lines changed

8 files changed

+20
-15
lines changed

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8245654 8256895
2727
* @summary Interoperability tests with Certigna Root CAs from Dhimyotis
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=certpath CertignaCA OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath CertignaCA CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DTrustCA.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
2626
* @bug 8189131
2727
* @summary Interoperability tests with "D-Trust Root Class 3 CA 2 2009" and
2828
* "D-Trust Root Class 3 CA 2 EV 2009" CAs
29+
* @library /test/lib/
2930
* @build ValidatePathWithParams
3031
* @run main/othervm/manual -Djava.security.debug=certpath DTrustCA OCSP
3132
* @run main/othervm/manual -Djava.security.debug=certpath DTrustCA CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8318759
2727
* @summary Interoperability tests with Digicert CS Root G5 certificates
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath DigicertCSRootG5 CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8319187
2727
* @summary Interoperability tests with eMudhra emSign Root CA G2 CS root
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=certpath EmSignRootG2CA OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath EmSignRootG2CA CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/HaricaCA.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8256421
2727
* @summary Interoperability tests with Harica CAs
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=certpath HaricaCA OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath HaricaCA CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8232019 8256895
2727
* @summary Interoperability tests with LuxTrust Global Root 2 CA
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=certpath LuxTrustCA OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath LuxTrustCA CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SectigoCSRootCAs.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8359170
2727
* @summary Interoperability tests with Sectigo Public Code Signing Root CAs
28+
* @library /test/lib/
2829
* @build ValidatePathWithParams
2930
* @run main/othervm/manual -Djava.security.debug=ocsp,certpath SectigoCSRootCAs OCSP
3031
* @run main/othervm/manual -Djava.security.debug=certpath SectigoCSRootCAs CRL

test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithParams.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,8 @@
2121
* questions.
2222
*/
2323

24+
import jtreg.SkippedException;
25+
2426
import java.io.ByteArrayInputStream;
2527
import java.io.FileInputStream;
2628
import java.io.IOException;
@@ -144,22 +146,19 @@ public void validate(String[] certsToValidate,
144146
} catch (IOException ioe) {
145147
// Some machines don't have network setup correctly to be able to
146148
// reach outside world, skip such failures
147-
out.println("WARNING: Network setup issue, skip this test");
148149
ioe.printStackTrace(System.err);
149-
return;
150+
throw new SkippedException("WARNING: Network setup issue, skip this test");
150151
} catch (CertPathValidatorException cpve) {
151152
out.println("Received exception: " + cpve);
152153

153154
if (cpve.getCause() instanceof IOException) {
154-
out.println("WARNING: CertPathValidatorException caused by IO"
155+
throw new SkippedException("WARNING: CertPathValidatorException caused by IO"
155156
+ " error, skip this test");
156-
return;
157157
}
158158

159159
if (cpve.getReason() == CertPathValidatorException.BasicReason.ALGORITHM_CONSTRAINED) {
160-
out.println("WARNING: CertPathValidatorException caused by"
160+
throw new SkippedException("WARNING: CertPathValidatorException caused by"
161161
+ " restricted algorithm, skip this test");
162-
return;
163162
}
164163

165164
if (cpve.getReason() == CertPathValidatorException.BasicReason.REVOKED
@@ -185,8 +184,7 @@ public void validate(String[] certsToValidate,
185184
// Don't want test to fail in case certificate is expired when not expected
186185
// Simply skip the test.
187186
if (expectedStatus != Status.EXPIRED && certStatus == Status.EXPIRED) {
188-
out.println("WARNING: Certificate expired, skip the test");
189-
return;
187+
throw new SkippedException("WARNING: Certificate expired, skip the test");
190188
}
191189

192190
if (certStatus != expectedStatus) {

0 commit comments

Comments
 (0)