Skip to content

Commit

Permalink
Changes FileEncodingTest to include hardcoded value for AIX
Browse files Browse the repository at this point in the history
  • Loading branch information
backwaterred committed Feb 18, 2022
1 parent 83b6e4b commit 56f0145
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/jdk/java/lang/System/FileEncodingTest.java
Expand Up @@ -40,7 +40,7 @@
import org.testng.annotations.Test;

public class FileEncodingTest {
private static final boolean IS_WINDOWS = System.getProperty("os.name").startsWith("Windows");
private static final String OS_NAME = System.getProperty("os.name");

@DataProvider
public Object[][] fileEncodingToDefault() {
Expand All @@ -56,14 +56,16 @@ public Object[][] fileEncodingToDefault() {
@Test(dataProvider = "fileEncodingToDefault")
public void testFileEncodingToDefault(String fileEncoding, String expected) throws Exception {
if (fileEncoding.equals("COMPAT")) {
if (IS_WINDOWS) {
if (OS_NAME.startsWith("Windows")) {
// Only tests on English locales
if (Locale.getDefault().getLanguage().equals("en")) {
expected = "windows-1252";
} else {
System.out.println("Tests only run on Windows with English locales");
return;
}
} else if (OS_NAME.startsWith("AIX")) {
expected = "ISO-8859-1";
} else {
expected = "US-ASCII";
}
Expand Down

0 comments on commit 56f0145

Please sign in to comment.