This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 240924 - Failing SelectCompletionQueryTest on JDK8
Summary: Failing SelectCompletionQueryTest on JDK8
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords: JDK_8, JDK_SPECIFIC, TEST
Depends on:
Blocks:
 
Reported: 2014-01-24 12:31 UTC by Jiri Skrivanek
Modified: 2015-02-17 07:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2014-01-24 12:31:40 UTC
Because implementation of HashSet was changed in JDK8 SQL code completion now shows items in different order than with JDK7. That's why some tests fail because golden files differ. Possibly TreeSet should be used at some places instead of HashSet. To reproduce:

ant -f db.sql.editor test-unit -Dtest.includes=**/SelectCompletionQueryTest.class

http://test4u.cz.oracle.com/job/StableBTD-trunk/lastCompletedBuild/testReport

To test HashSet behaviour simly use:

        System.out.println("java=" + System.getProperty("java.version"));
        Set<String> s = new HashSet<>();
        s.add("b");
        s.add("a");
        for (String item : s) {
            System.out.println("item=" + item);
        }

Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b123
Comment 1 Quality Engineering 2014-01-28 03:06:22 UTC
Integrated into 'main-silver', will be available in build *201401280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/018796a7700b
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #240924 - Tests removed from stableBTD config until they are fixed.
Comment 2 matthias42 2015-02-15 13:11:16 UTC
I committed:

http://hg.netbeans.org/core-main/rev/014f45b5ac85

with that change the tests work on OpenJDK 7 + 8:

java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~utopic1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)

openjdk version "1.8.0-jdk8u40-b18"
OpenJDK Runtime Environment (build 1.8.0-jdk8u40-b18-20141217)
OpenJDK 64-Bit Server VM (build 25.40-b23, mixed mode)

As these are common parts of OracleJDK + OpenJDK this should validate the fix.

Jiri: Please check from your side - Thank you!
Comment 3 Quality Engineering 2015-02-16 03:09:25 UTC
Integrated into 'main-silver', will be available in build *201502160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/014f45b5ac85
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #240924: Fix unittests for JDK8 and reenable them