178 }
179
180 static boolean compareInternalStrings() {
181 int failcount = 0;
182 String bStr = refVersion.substring(refVersion.lastIndexOf("build") +
183 "build".length() + 1,
184 refVersion.lastIndexOf(")"));
185
186 String[] vStr = bStr.split("\\.|-|_");
187 String jdkMajor = vStr[0];
188 String jdkMinor = vStr[1];
189 String jdkMicro = vStr[2];
190 String jdkBuild = vStr[vStr.length - 1];
191
192 String expectedDotVersion = "dotversion:" + jdkMajor + "." + jdkMinor;
193 String expectedFullVersion = "fullversion:" + bStr;
194
195 Map<String, String> envMap = new HashMap<>();
196 envMap.put(TestHelper.JLDEBUG_KEY, "true");
197 TestHelper.TestResult tr = doExec(envMap, javaCmd, "-version");
198 List<String> alist = new ArrayList<>();
199 alist.addAll(tr.testOutput);
200 for (String x : tr.testOutput) {
201 alist.add(x.trim());
202 }
203 if (!alist.contains(expectedDotVersion)) {
204 System.out.println("Error: could not find " + expectedDotVersion);
205 failcount++;
206 }
207
208 if (!alist.contains(expectedFullVersion)) {
209 System.out.println("Error: could not find " + expectedFullVersion);
210 failcount++;
211 }
212 System.out.println("Internal Strings Test: " + failcount);
213 return failcount == 0;
214 }
215
216 // Initialize
217 static void init() {
|
178 }
179
180 static boolean compareInternalStrings() {
181 int failcount = 0;
182 String bStr = refVersion.substring(refVersion.lastIndexOf("build") +
183 "build".length() + 1,
184 refVersion.lastIndexOf(")"));
185
186 String[] vStr = bStr.split("\\.|-|_");
187 String jdkMajor = vStr[0];
188 String jdkMinor = vStr[1];
189 String jdkMicro = vStr[2];
190 String jdkBuild = vStr[vStr.length - 1];
191
192 String expectedDotVersion = "dotversion:" + jdkMajor + "." + jdkMinor;
193 String expectedFullVersion = "fullversion:" + bStr;
194
195 Map<String, String> envMap = new HashMap<>();
196 envMap.put(TestHelper.JLDEBUG_KEY, "true");
197 TestHelper.TestResult tr = doExec(envMap, javaCmd, "-version");
198 System.out.println(tr.toString());
199 List<String> alist = new ArrayList<>();
200 alist.addAll(tr.testOutput);
201 for (String x : tr.testOutput) {
202 alist.add(x.trim());
203 }
204 if (!alist.contains(expectedDotVersion)) {
205 System.out.println("Error: could not find " + expectedDotVersion);
206 failcount++;
207 }
208
209 if (!alist.contains(expectedFullVersion)) {
210 System.out.println("Error: could not find " + expectedFullVersion);
211 failcount++;
212 }
213 System.out.println("Internal Strings Test: " + failcount);
214 return failcount == 0;
215 }
216
217 // Initialize
218 static void init() {
|