Skip to content

Commit 308357c

Browse files
committed
8345578: New test in JDK-8343622 fails with a promoted build
Reviewed-by: mullan
1 parent 84240cc commit 308357c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/jdk/sun/security/krb5/NullStringToKey.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@
2424
* @test
2525
* @bug 8343622
2626
* @summary KerberosKey created with null key bytes
27-
* @library /test/lib
2827
* @run main/othervm NullStringToKey
2928
*/
3029

31-
import jdk.test.lib.Utils;
32-
3330
import javax.security.auth.kerberos.KerberosKey;
3431
import javax.security.auth.kerberos.KerberosPrincipal;
3532
import java.security.Security;
@@ -47,8 +44,16 @@ public static void main(String[] args) throws Exception {
4744
"aes128-cts-hmac-sha1-96", "aes256-cts-hmac-sha1-96",
4845
"aes128-cts-hmac-sha256-128", "aes256-cts-hmac-sha384-192")) {
4946
System.out.println(alg);
50-
Utils.runAndCheckException(() -> new KerberosKey(name, pass, alg),
51-
IllegalArgumentException.class);
47+
// Do not use Utils.runAndCheckException as it might call
48+
// MessageDigest.getInstance("MD5") at class initialization
49+
// and we have already removed the SUN provider.
50+
try {
51+
new KerberosKey(name, pass, alg);
52+
throw new RuntimeException("Didn't get expected exception");
53+
} catch (IllegalArgumentException e) {
54+
// expected
55+
System.out.println(e);
56+
}
5257
}
5358
}
5459
}

0 commit comments

Comments
 (0)