Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 188935

Summary: [test] Wrong assumption on the number of classes in java.util
Product: [Eclipse Project] JDT Reporter: Vasily Zakharov <vmzakhar>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Vasily Zakharov CLA 2007-05-24 10:58:44 EDT
Build ID: 3.2

Steps To Reproduce:
1. Build the latest Harmony JRE
2. Download EUT running script from http://issues.apache.org/jira/browse/HARMONY-2338
3. Update eut.properties: set test.jre.home= to Harmony JRE home
4. Run "ant -Dtests=jdtapt"

More information:
The method org.eclipse.jdt.apt.tests.annotations.mirrortest.MirrorTestAnnotationProcessor.testPackageImpl() compares the number of classes (both public and non-public, not enums, not interfaces, not internal classes) in java.util package to 79, and fails if it's not equal.

As non-public classes in java.* packages are not specified, basing a test on the number of them is clearly a bug in the test. For example, the test fails on Harmony, as it has different non-public classes in java.util than RI.

The comparisons for number of enums and interfaces is clearly also wrong, though they do not cause failures on Harmony, as the numbers of enums and interfaces for Harmony is identical to RI. However, these comparisons are also clearly wrong and better be fixed.

This issues is also filed in Harmony as http://issues.apache.org/jira/browse/HARMONY-3390.
Comment 1 Vasily Zakharov CLA 2007-05-24 11:02:33 EDT
Correction:
> 2. Download EUT running script from
> http://issues.apache.org/jira/browse/HARMONY-2038
Comment 2 Olivier Thomann CLA 2007-05-24 11:05:43 EDT
Moving to JDT/APT
Comment 3 Vasily Zakharov CLA 2007-05-24 11:08:07 EDT
The error diagnostic from the test is:
classname="org.eclipse.jdt.apt.tests.MirrorTests" name="testMirror"

<failure message=" ----------- Expected ------------ NO ERRORS ------------ but was ------------ java.lang.IllegalStateException: Failed during test: Expected 79, but saw 74. Reason: Number of classes in java.util --------- Difference is ---------- expected:<NO ERRORS> but was:<java.lang.IllegalStateException: Failed during test: Expected 79, but saw 74. Reason: Number of classes in java.util>" type="junit.framework.ComparisonFailure">junit.framework.ComparisonFailure:
Comment 4 Walter Harley CLA 2007-05-24 11:29:57 EDT

*** This bug has been marked as a duplicate of bug 161492 ***
Comment 5 Vasily Zakharov CLA 2007-05-25 07:05:11 EDT
Verified, closing.