Skip to content

Commit 3b9e84e

Browse files
author
duke
committedFeb 22, 2022
Automatic merge of jdk:master into master
2 parents 7da0408 + 58e1882 commit 3b9e84e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎test/jdk/java/lang/System/FileEncodingTest.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, 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
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8260265
26+
* @bug 8260265 8282042
2727
* @summary Test file.encoding system property
2828
* @library /test/lib
2929
* @build jdk.test.lib.process.*
@@ -40,7 +40,7 @@
4040
import org.testng.annotations.Test;
4141

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

4545
@DataProvider
4646
public Object[][] fileEncodingToDefault() {
@@ -56,14 +56,16 @@ public Object[][] fileEncodingToDefault() {
5656
@Test(dataProvider = "fileEncodingToDefault")
5757
public void testFileEncodingToDefault(String fileEncoding, String expected) throws Exception {
5858
if (fileEncoding.equals("COMPAT")) {
59-
if (IS_WINDOWS) {
59+
if (OS_NAME.startsWith("Windows")) {
6060
// Only tests on English locales
6161
if (Locale.getDefault().getLanguage().equals("en")) {
6262
expected = "windows-1252";
6363
} else {
6464
System.out.println("Tests only run on Windows with English locales");
6565
return;
6666
}
67+
} else if (OS_NAME.startsWith("AIX")) {
68+
expected = "ISO-8859-1";
6769
} else {
6870
expected = "US-ASCII";
6971
}

0 commit comments

Comments
 (0)
Please sign in to comment.