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

Summary: Failing SelectCompletionQueryTest on JDK8
Product: db Reporter: Jiri Skrivanek <jskrivanek>
Component: SQL EditorAssignee: matthias42
Status: VERIFIED FIXED    
Severity: normal Keywords: JDK_8, JDK_SPECIFIC, TEST
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

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