Skip to content

Commit c5ac3c4

Browse files
fgualliniRajan Halade
authored andcommitted
8249831: Test sun/security/mscapi/nonUniqueAliases/NonUniqueAliases.java is marked with @ignore
Reviewed-by: hchao, rhalade
1 parent 336d0d8 commit c5ac3c4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test/jdk/sun/security/mscapi/nonUniqueAliases/NonUniqueAliases.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 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
@@ -27,20 +27,32 @@
2727
* @requires os.family == "windows"
2828
* @library /test/lib
2929
* @summary Test "keytool -list" displays correctly same named certificates
30-
* @ignore Uses certutil.exe that isn't guaranteed to be installed
3130
*/
3231

3332
import jdk.test.lib.process.ProcessTools;
3433

34+
import java.io.IOException;
3535
import java.security.KeyStore;
3636
import java.util.Collections;
37+
import jtreg.SkippedException;
3738

3839
public class NonUniqueAliases {
3940
public static void main(String[] args) throws Throwable {
40-
4141
try {
42-
String testSrc = System.getProperty("test.src", ".");
42+
runTest();
43+
} catch (IOException ex) {
44+
// It uses certutil.exe that isn't guaranteed to be installed
45+
String certutilMsg = "Cannot run program \"certutil\"";
46+
if (ex.getMessage().contains(certutilMsg)) {
47+
throw new SkippedException("certutil is not installed");
48+
}
49+
throw ex;
50+
}
51+
}
4352

53+
private static void runTest() throws Exception {
54+
String testSrc = System.getProperty("test.src", ".");
55+
try {
4456
// removing the alias NonUniqueName if it already exists
4557
ProcessTools.executeCommand("certutil", "-user", "-delstore", "MY",
4658
"NonUniqueName");

0 commit comments

Comments
 (0)