Index: test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java
===================================================================
RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java,v
--- test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java 11 Apr 2005 12:01:48 -0000 1.41
+++ test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java 18 May 2005 16:34:36 -0000
@@ -1674,11 +1674,13 @@
Module m2 = mgr.create(new File(jars, "uses-api-friend.jar"), null, false, false, false);
Module m3 = mgr.create(new File(jars, "uses-and-exports-api.jar"), null, false, false, false);
Module m4 = mgr.create(new File(jars, "uses-api-directly.jar"), null, false, false, false);
+ Module m5 = mgr.create(new File(jars, "uses-api-impl-dep-for-friends.jar"), null, false, false, false);
assertEquals("api-mod-export-api.jar had no problems", Collections.EMPTY_SET, m1.getProblems());
assertEquals("uses-api-friend.jar had no problems", Collections.EMPTY_SET, m2.getProblems());
assertEquals("uses-and-exports-api.jar had no problems", Collections.EMPTY_SET, m3.getProblems());
assertEquals("uses-api-directly.jar had no problems", Collections.EMPTY_SET, m4.getProblems());
- mgr.enable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4})));
+ assertEquals("uses-api-impl-dep-for-friends.jar had no problems", Collections.EMPTY_SET, m5.getProblems());
+ mgr.enable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4, m5})));
m2.getClassLoader().loadClass("usesapi.UsesPublicClass").newInstance();
try {
m2.getClassLoader().loadClass("usesapi.UsesImplClass").newInstance();
@@ -1699,7 +1701,19 @@
} catch (NoClassDefFoundError ex) {
// ok
}
- mgr.disable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4})));
+ try {
+ m5.getClassLoader().loadClass("usesapi.UsesPublicClass").newInstance();
+ } catch (NoClassDefFoundError e) {
+ fail("m5 has an implementation dependency and has not been allowed to load the public class");
+ }
+ try {
+ m5.getClassLoader().loadClass("usesapi.UsesImplClass").newInstance();
+ } catch (NoClassDefFoundError e) {
+ fail("m5 has an implementation dependency and has not been allowed to load the imlpementation class");
+ }
+
+ mgr.disable(new HashSet(Arrays.asList(new Module[] {m1, m2, m3, m4, m5})));
+ mgr.delete(m5);
mgr.delete(m4);
mgr.delete(m3);
mgr.delete(m2);
Index: test/unit/src/org/netbeans/core/modules/build.xml
===================================================================
RCS file: /cvs/core/test/unit/src/org/netbeans/core/modules/build.xml,v
--- test/unit/src/org/netbeans/core/modules/build.xml 18 Apr 2005 22:16:38 -0000 1.26
+++ test/unit/src/org/netbeans/core/modules/build.xml 18 May 2005 16:34:36 -0000
@@ -172,6 +172,10 @@
+
+
+
+
Index: test/unit/src/org/netbeans/core/modules/jars/uses-api-impl-dep-for-friends.mf
===================================================================
RCS file: test/unit/src/org/netbeans/core/modules/jars/uses-api-impl-dep-for-friends.mf
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ test/unit/src/org/netbeans/core/modules/jars/uses-api-impl-dep-for-friends.mf 18 May 2005 16:34:36 -0000
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+OpenIDE-Module: usesapiimpldepforfriends
+OpenIDE-Module-Module-Dependencies: org.netbeans.modules.foo = today
+