1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
24
24
/*
25
25
* @test
26
- * @bug 8260265
26
+ * @bug 8260265 8282042
27
27
* @summary Test file.encoding system property
28
28
* @library /test/lib
29
29
* @build jdk.test.lib.process.*
40
40
import org .testng .annotations .Test ;
41
41
42
42
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" );
44
44
45
45
@ DataProvider
46
46
public Object [][] fileEncodingToDefault () {
@@ -56,14 +56,16 @@ public Object[][] fileEncodingToDefault() {
56
56
@ Test (dataProvider = "fileEncodingToDefault" )
57
57
public void testFileEncodingToDefault (String fileEncoding , String expected ) throws Exception {
58
58
if (fileEncoding .equals ("COMPAT" )) {
59
- if (IS_WINDOWS ) {
59
+ if (OS_NAME . startsWith ( "Windows" ) ) {
60
60
// Only tests on English locales
61
61
if (Locale .getDefault ().getLanguage ().equals ("en" )) {
62
62
expected = "windows-1252" ;
63
63
} else {
64
64
System .out .println ("Tests only run on Windows with English locales" );
65
65
return ;
66
66
}
67
+ } else if (OS_NAME .startsWith ("AIX" )) {
68
+ expected = "ISO-8859-1" ;
67
69
} else {
68
70
expected = "US-ASCII" ;
69
71
}
0 commit comments