Skip to content

Commit

Permalink
8311081: KeytoolReaderP12Test.java fail on localized Windows platform
Browse files Browse the repository at this point in the history
Backport-of: b4b2fecb42d9f14d73e8d79a9e59dee4d697f9cf
  • Loading branch information
tkiriyama authored and Paul Hohensee committed Dec 20, 2023
1 parent bd552ef commit 9aad573
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/jdk/java/security/KeyStore/PKCS12/Utils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -59,11 +59,14 @@ public static OutputAnalyzer executeKeytoolCommand(String[] command) {

public static OutputAnalyzer executeKeytoolCommand(String[] command,
int exitCode) {
String[] keytoolCmd = new String[command.length + 1];
String[] keytoolCmd = new String[command.length + 3];
OutputAnalyzer output = null;
try {
keytoolCmd[0] = JDKToolFinder.getJDKTool(KEYTOOL);
System.arraycopy(command, 0, keytoolCmd, 1, command.length);
// Ensure the keytool process is always ran under English locale
keytoolCmd[1] = "-J-Duser.language=en";
keytoolCmd[2] = "-J-Duser.country=US";
System.arraycopy(command, 0, keytoolCmd, 3, command.length);
output = ProcessTools.executeCommand(keytoolCmd);
output.shouldHaveExitValue(exitCode);
out.println("Executed keytool command sucessfully:"
Expand Down

1 comment on commit 9aad573

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.