Skip to content

Commit c30b38c

Browse files
committed
Update according to code review
1 parent 31c8af3 commit c30b38c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

closed/test/jdk/openj9/internal/security/TestProperties.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.junit.jupiter.params.provider.Arguments;
3434
import org.junit.jupiter.params.provider.MethodSource;
3535

36+
import java.io.File;
3637
import java.security.Provider;
3738
import java.security.Security;
3839

@@ -43,7 +44,7 @@
4344

4445
public class TestProperties {
4546

46-
static String fileSep = java.io.File.pathSeparator;
47+
static String fileSep = File.pathSeparator;
4748

4849
private static Stream<Arguments> patternMatches_expectedExitValue0() {
4950
return Stream.of(
@@ -166,21 +167,31 @@ private static Stream<Arguments> patternMatches_expectedExitValue1() {
166167
);
167168
}
168169

169-
private static Stream<Arguments> patternMatches_PropertiesList() {
170+
private static Stream<Arguments> patternMatches_propertiesList() {
170171
return Stream.of(
172+
// "-Djava.security.propertiesList=" test 1: the profile in propertyListA-java.security
173+
// extends the profile in the main java.security file, which lists 4 providers.
171174
Arguments.of("Test-Profile-Property-List.A",
172175
System.getProperty("test.src") + "/propertyListA-java.security",
173176
"(?s)(?=.*OpenJCEPlusFIPS)(?=.*Sun)(?=.*SunJSSE)(?=.*SunEC)",
174177
0),
178+
// "-Djava.security.propertiesList=" test 2: The profile in propertyListB-java.security
179+
// extends the profile in propertyListA-java.security, which in turn extends the profile
180+
// in the main java.security file, listing 5 providers.
175181
Arguments.of("Test-Profile-Property-List.B",
176182
System.getProperty("test.src") + "/propertyListA-java.security" + fileSep
177183
+ System.getProperty("test.src") + "/propertyListB-java.security",
178184
"(?s)(?=.*OpenJCEPlusFIPS)(?=.*Sun)(?=.*SunJSSE)(?=.*SunEC)(?=.*SunJCE)",
179185
0),
186+
// "-Djava.security.propertiesList=" test 3: The profile in propertyListB-java.security
187+
// extends the profile in propertyListA-java.security, which in turn extends the main
188+
// java.security profile, but propertyListB-java.security file is missing.
180189
Arguments.of("Test-Profile-Property-List.B",
181190
System.getProperty("test.src") + "/propertyListB-java.security",
182191
"is not present in the java.security file or any appended files",
183192
1),
193+
// "-Djava.security.propertiesList=" test 4: The -Djava.security.propertiesList option
194+
// does not support using a leading '=' prefix.
184195
Arguments.of("Test-Profile-Property-List.A",
185196
"=" + System.getProperty("test.src") + "/propertyListA-java.security",
186197
"java.security.propertiesList does not support '=' prefix",
@@ -215,8 +226,8 @@ public void shouldContain_expectedExitValue1(String customprofile, String securi
215226
}
216227

217228
@ParameterizedTest
218-
@MethodSource("patternMatches_PropertiesList")
219-
public void shouldContain_PropertiesList(String customprofile, String securityPropertyFileList,
229+
@MethodSource("patternMatches_propertiesList")
230+
public void shouldContain_propertiesList(String customprofile, String securityPropertyFileList,
220231
String expected, int exitValue) throws Exception {
221232
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
222233
"-Dsemeru.fips=true",

0 commit comments

Comments
 (0)