RFR: 8209935: Test to cover CodeSource.getCodeSigners()

Sean Mullan mullan at openjdk.java.net
Mon Apr 18 12:59:41 UTC 2022


On Mon, 18 Apr 2022 09:46:06 GMT, Sibabrata Sahoo <ssahoo at openjdk.org> wrote:

> A Test updated to cover the getCodeSigners.

test/jdk/java/security/CodeSource/Implies.java line 60:

> 58:                 = new CodeSource(thatURL, (java.security.cert.Certificate[]) null);
> 59:         if (thisCs.implies(thatCs) != result) {
> 60:             throw new SecurityException("test failed");

Can you add a more descriptive error message here, ex: `"CodeSource.implies() returned " + !result " instead of " + result`

test/jdk/java/security/CodeSource/Implies.java line 63:

> 61:         }
> 62:         if (thisCs.getCodeSigners() != null && thatCs.getCodeSigners() != null) {
> 63:             throw new RuntimeException("Both getCodeSigners should be null");

This test should probably throw SecurityException to be consistent.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8286



More information about the security-dev mailing list