public void testSeveralModulesWithSameNamesDifferentVersions() throws Exception
{
ClassLoader clAModuleA1 = null;
ClassLoader clAModuleA2 = null;
ClassLoader clAModuleA3 = null;
Result rA1 = new Result();
Result rA2 = new Result();
Result rA3 = new Result();
try
{
BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
createModule("ModuleA", "1.0.0").
createPackage(PACKAGE_A);
clAModuleA1 = createClassLoader(rA1, "X", builderA1, JAR_A_1);
BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
createModule("ModuleA", "2.0.0").
createPackage(PACKAGE_A);
clAModuleA2 = createClassLoader(rA2, "A", builderA2, JAR_A_1);
BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
createModule("ModuleA", "3.0.0").
createPackage(PACKAGE_A);
clAModuleA3 = createClassLoader(rA3, "Y", builderA3, JAR_A_1);
Class<?> classAX = assertLoadClass(CLASS_A, clAModuleA1);
Class<?> classAA = assertLoadClass(CLASS_A, clAModuleA2);
Class<?> classAY = assertLoadClass(CLASS_A, clAModuleA3);
assertCannotLoadClass(clAModuleA1, CLASS_B);
assertCannotLoadClass(clAModuleA2, CLASS_B);
assertCannotLoadClass(clAModuleA3, CLASS_B);
ClassLoader clB = null;
Result rB = new Result();
try
{
BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
createRequireModule("ModuleA", new VersionRange("2.0.0", true, "3.0.0", false)).
createPackage(PACKAGE_B);