Review request: JDK-8004928 TEST_BUG: Reduce dependence of CoreLib tests from the AWT subsystem.

Mandy Chung mandy.chung at oracle.com
Wed Dec 12 18:59:37 UTC 2012


On 12/12/12 7:41 AM, Alexey Utkin wrote:
> Bug description:
>     https://jbs.oracle.com/bugs/browse/JDK-8004928
>
> Here is the suggested fix:
>     http://cr.openjdk.java.net/~uta/openjdk-webrevs/JDK-8004928/webrev.01
>

Looks good in general with some minor comments below.

> Summary:
> *test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java*
> *test/java/lang/reflect/Proxy/ClassRestrictions.java*
>         The set of non-public interfaces was changed to avoid AWT 
> dependencies.
>

These 2 tests look for the first non-public system interface.  Instead 
of keeping the nonPublicInterfaces list, it may be good to simplify this 
to use "java.util.zip.ZipConstants" which seems to be a stable one that 
will unlikely be removed.  I would suggest to add a check that the class 
is non-public (Modifier.isPublic) to catch any future change to this class.

> *test/java/lang/management/CompilationMXBean/Basic.java*
>         The ballast calls
>             java.awt.Toolkit.getDefaultToolkit();
>             javax.swing.UIManager.getInstalledLookAndFeels();
>         were removed from compiled Java code. Compilation time still 
> positive.
>

OK.

> *test/java/lang/reflect/Generics/Probe.java*
>         The dependence from the internal class 
> "javax.swing.JComboBox$AccessibleJComboBox"
>         was excepted from code. It has very small impact to test 
> coverage.
>

OK.

> *test/java/util/Collections/EmptyIterator.java*
>         Swing-stored constants were changed to locally-defined.
>

I believe your change captures what it's intended to test (typed 
enumeration and rawtype enumeration).  Minor comment - it might be 
better to move the new static variables as local variable before calling 
testEmptyEnumeration to be consistent with convention used in this 
test.  There is no need to keep them static anyway.   I would also take 
out the comment about the substitution since this test doesn't seem to 
have any relationship with javax.swing.

> *test/java/util/logging/LoggingDeadlock4.java*
>         Test case was simplified to avoid AWT class loading. Negative 
> test result was tested on early
>         JDK7 build.
>

Looks good.  Nit: L46 - good to break it into 2 lines.  It's good that 
you have verified with and without the fix.

> *test/sun/tools/jrunscript/common.sh*
>         Useless mention of XToolkit  was removed from the script.
>

OK

Thanks
Mandy



More information about the core-libs-dev mailing list