Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 59008
Collapse All | Expand All

(-)test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java (-2 / +16 lines)
 Lines 1674-1684    Link Here 
1674
            Module m2 = mgr.create(new File(jars, "uses-api-friend.jar"), null, false, false, false);
1674
            Module m2 = mgr.create(new File(jars, "uses-api-friend.jar"), null, false, false, false);
1675
            Module m3 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false);
1675
            Module m3 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false);
1676
            Module m4 = mgr.create(new File(jars, "uses-api-directly.jar"), null, false, false, false);
1676
            Module m4 = mgr.create(new File(jars, "uses-api-directly.jar"), null, false, false, false);
1677
            Module m5 = mgr.create(new File(jars, "uses-api-impl-dep-for-friends.jar"), null, false, false, false);
1677
            assertEquals("api-mod-export-api.jar had no problems", Collections.EMPTY_SET, m1.getProblems());
1678
            assertEquals("api-mod-export-api.jar had no problems", Collections.EMPTY_SET, m1.getProblems());
1678
            assertEquals("uses-api-friend.jar had no problems", Collections.EMPTY_SET, m2.getProblems());
1679
            assertEquals("uses-api-friend.jar had no problems", Collections.EMPTY_SET, m2.getProblems());
1679
            assertEquals("uses-and-exports-api.jar had no problems", Collections.EMPTY_SET, m3.getProblems());
1680
            assertEquals("uses-and-exports-api.jar had no problems", Collections.EMPTY_SET, m3.getProblems());
1680
            assertEquals("uses-api-directly.jar had no problems", Collections.EMPTY_SET, m4.getProblems());
1681
            assertEquals("uses-api-directly.jar had no problems", Collections.EMPTY_SET, m4.getProblems());
1681
            mgr.enable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4})));
1682
            assertEquals("uses-api-impl-dep-for-friends.jar had no problems", Collections.EMPTY_SET, m5.getProblems());
1683
            mgr.enable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4, m5})));
1682
            m2.getClassLoader().loadClass("usesapi.UsesPublicClass").newInstance();
1684
            m2.getClassLoader().loadClass("usesapi.UsesPublicClass").newInstance();
1683
            try {
1685
            try {
1684
                m2.getClassLoader().loadClass("usesapi.UsesImplClass").newInstance();
1686
                m2.getClassLoader().loadClass("usesapi.UsesImplClass").newInstance();
 Lines 1699-1705    Link Here 
1699
            } catch (NoClassDefFoundError ex) {
1701
            } catch (NoClassDefFoundError ex) {
1700
                // ok
1702
                // ok
1701
            }
1703
            }
1702
            mgr.disable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4})));
1704
            try {
1705
                m5.getClassLoader().loadClass("usesapi.UsesPublicClass").newInstance();
1706
            } catch (NoClassDefFoundError e) {
1707
                fail("m5 has an implementation dependency and has not been allowed to load the public class");
1708
            }
1709
            try {
1710
                m5.getClassLoader().loadClass("usesapi.UsesImplClass").newInstance();
1711
            } catch (NoClassDefFoundError e) {
1712
                fail("m5 has an implementation dependency and has not been allowed to load the imlpementation class");
1713
            }
1714
            
1715
            mgr.disable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4, m5})));
1716
            mgr.delete(m5);
1703
            mgr.delete(m4);
1717
            mgr.delete(m4);
1704
            mgr.delete(m3);
1718
            mgr.delete(m3);
1705
            mgr.delete(m2);
1719
            mgr.delete(m2);
(-)test/unit/src/org/netbeans/core/modules/build.xml (+4 lines)
 Lines 172-177    Link Here 
172
            <param name="sourcedir" value="jars/uses-api"/>
172
            <param name="sourcedir" value="jars/uses-api"/>
173
        </antcall>
173
        </antcall>
174
        <antcall target="create-jar">
174
        <antcall target="create-jar">
175
            <param name="name" value="uses-api-impl-dep-for-friends"/>
176
            <param name="sourcedir" value="jars/uses-api"/>
177
        </antcall>
178
        <antcall target="create-jar">
175
            <param name="name" value="uses-api-spec-dep"/>
179
            <param name="name" value="uses-api-spec-dep"/>
176
            <param name="sourcedir" value="jars/uses-api"/>
180
            <param name="sourcedir" value="jars/uses-api"/>
177
        </antcall>
181
        </antcall>
(-)test/unit/src/org/netbeans/core/modules/jars/uses-api-impl-dep-for-friends.mf (+4 lines)
Added Link Here 
1
Manifest-Version: 1.0
2
OpenIDE-Module: usesapiimpldepforfriends
3
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.foo = today
4

Return to bug 59008
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo