Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8282042: [testbug] FileEncodingTest.java depends on default encoding #7525

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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