65 } |
65 } |
66 |
66 |
67 private static final String VM_SETTINGS = "VM settings:"; |
67 private static final String VM_SETTINGS = "VM settings:"; |
68 private static final String PROP_SETTINGS = "Property settings:"; |
68 private static final String PROP_SETTINGS = "Property settings:"; |
69 private static final String LOCALE_SETTINGS = "Locale settings:"; |
69 private static final String LOCALE_SETTINGS = "Locale settings:"; |
|
70 private static final String SYSTEM_SETTINGS = "Operating System Metrics:"; |
70 |
71 |
71 static void containsAllOptions(TestResult tr) { |
72 static void containsAllOptions(TestResult tr) { |
72 checkContains(tr, VM_SETTINGS); |
73 checkContains(tr, VM_SETTINGS); |
73 checkContains(tr, PROP_SETTINGS); |
74 checkContains(tr, PROP_SETTINGS); |
74 checkContains(tr, LOCALE_SETTINGS); |
75 checkContains(tr, LOCALE_SETTINGS); |
|
76 if (System.getProperty("os.name").contains("Linux")) { |
|
77 checkContains(tr, SYSTEM_SETTINGS); |
|
78 } |
75 } |
79 } |
76 |
80 |
77 static void runTestOptionDefault() throws IOException { |
81 static void runTestOptionDefault() throws IOException { |
78 int stackSize = 256; // in kb |
82 int stackSize = 256; // in kb |
79 if (getArch().equals("ppc64") || getArch().equals("ppc64le")) { |
83 if (getArch().equals("ppc64") || getArch().equals("ppc64le")) { |
121 checkNotContains(tr, VM_SETTINGS); |
125 checkNotContains(tr, VM_SETTINGS); |
122 checkNotContains(tr, PROP_SETTINGS); |
126 checkNotContains(tr, PROP_SETTINGS); |
123 checkContains(tr, LOCALE_SETTINGS); |
127 checkContains(tr, LOCALE_SETTINGS); |
124 } |
128 } |
125 |
129 |
|
130 static void runTestOptionSystem() throws IOException { |
|
131 TestResult tr = doExec(javaCmd, "-XshowSettings:system"); |
|
132 if (System.getProperty("os.name").contains("Linux")) { |
|
133 checkNotContains(tr, VM_SETTINGS); |
|
134 checkNotContains(tr, PROP_SETTINGS); |
|
135 checkNotContains(tr, LOCALE_SETTINGS); |
|
136 checkContains(tr, SYSTEM_SETTINGS); |
|
137 } else { |
|
138 // -XshowSettings prints all available settings when |
|
139 // settings argument is not recognized. |
|
140 containsAllOptions(tr); |
|
141 } |
|
142 } |
|
143 |
126 static void runTestBadOptions() throws IOException { |
144 static void runTestBadOptions() throws IOException { |
127 TestResult tr = doExec(javaCmd, "-XshowSettingsBadOption"); |
145 TestResult tr = doExec(javaCmd, "-XshowSettingsBadOption"); |
128 checkNotContains(tr, VM_SETTINGS); |
146 checkNotContains(tr, VM_SETTINGS); |
129 checkNotContains(tr, PROP_SETTINGS); |
147 checkNotContains(tr, PROP_SETTINGS); |
130 checkNotContains(tr, LOCALE_SETTINGS); |
148 checkNotContains(tr, LOCALE_SETTINGS); |
144 runTestOptionAll(); |
162 runTestOptionAll(); |
145 runTestOptionDefault(); |
163 runTestOptionDefault(); |
146 runTestOptionVM(); |
164 runTestOptionVM(); |
147 runTestOptionProperty(); |
165 runTestOptionProperty(); |
148 runTestOptionLocale(); |
166 runTestOptionLocale(); |
|
167 runTestOptionSystem(); |
149 runTestBadOptions(); |
168 runTestBadOptions(); |
150 runTest7123582(); |
169 runTest7123582(); |
151 if (testExitValue != 0) { |
170 if (testExitValue != 0) { |
152 throw new Error(testExitValue + " tests failed"); |
171 throw new Error(testExitValue + " tests failed"); |
153 } |
172 } |