8146435: [TESTBUG] Logging tests are failing intermittently on windows when executed by JPRT

Improved robustness of UL tests by removing reliance on "java -version" and replacing with explicit code to trigger logging in all environments

Reviewed-by: dholmes, iklam, mockner
This commit is contained in:
Rachel Protacio 2016-01-21 12:11:20 -05:00
parent e8e6b0e6f0
commit 6ee07f50c8
11 changed files with 128 additions and 60 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,6 @@
* @bug 8139564
* @summary defaultmethods=debug should have logging from each of the statements in the code
* @library /testlibrary
* @ignore 8146435
* @modules java.base/sun.misc
* java.management
* @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools
@ -38,8 +37,8 @@ import jdk.test.lib.ProcessTools;
public class DefaultMethodsTest {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xlog:defaultmethods=debug", "-version");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:defaultmethods=debug",
InnerClass.class.getName());
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("Slots that need filling:");
output.shouldContain("requires default method processing");
@ -51,5 +50,11 @@ public class DefaultMethodsTest {
output.shouldContain("default methods");
output.shouldHaveExitValue(0);
}
public static class InnerClass {
public static void main(String[] args) throws Exception {
System.out.println("Inner Class");
}
}
}