Result rA1 = new Result();
Result rA2 = new Result();
Result rA3 = new Result();
try
{
BundleInfoBuilder builderA1 = BundleInfoBuilder.getBuilder().
createModule("PackageA").
createPackage(PACKAGE_A, "1.0.0");
clA1 = createClassLoader(rA1, "A1", builderA1, JAR_A_1);
BundleInfoBuilder builderA2 = BundleInfoBuilder.getBuilder().
createModule("PackageA").
createPackage(PACKAGE_A, "2.0.0");
clA2 = createClassLoader(rA2, "A2", builderA2, JAR_A_1);
BundleInfoBuilder builderA3 = BundleInfoBuilder.getBuilder().
createModule("PackageA").
createPackage(PACKAGE_A, "3.0.0");
clA3 = createClassLoader(rA3, "A3", builderA3, JAR_A_1);
Class<?> classA1 = assertLoadClass(CLASS_A, clA1);
Class<?> classA2 = assertLoadClass(CLASS_A, clA2);
Class<?> classA3 = assertLoadClass(CLASS_A, clA3);
assertCannotLoadClass(clA1, CLASS_B);
assertCannotLoadClass(clA2, CLASS_B);
assertCannotLoadClass(clA3, CLASS_B);
ClassLoader clB = null;
Result rB = new Result();
try
{
BundleInfoBuilder builderB = BundleInfoBuilder.getBuilder().
createPackage(PACKAGE_B).
createRequirePackage(PACKAGE_A, new VersionRange("1.0.0", false, "2.0.0", true));
clB = createClassLoader(rB, "B", builderB, JAR_B_1);
Class<?> classA11 = assertLoadClass(CLASS_A, clA1);
assertSame(classA1, classA11);