public void testNoReExport() throws Exception
{
ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
a.setPathsAndPackageNames(A.class);
KernelControllerContext contextA = install(a);
try
{
ClassLoader clA = assertClassLoader(contextA);
assertLoadClass(A.class, clA);
assertLoadClassFail(B.class, clA);
assertLoadClassFail(C.class, clA);
MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
b.getRequirements().addRequirement(factory.createReExportModule("a"));
b.setPathsAndPackageNames(B.class);
KernelControllerContext contextB = install(b);
try
{
assertLoadClass(A.class, clA);
assertLoadClassFail(B.class, clA);
assertLoadClassFail(C.class, clA);
ClassLoader clB = assertClassLoader(contextB);
assertLoadClass(A.class, clB, clA);
assertLoadClass(B.class, clB);
assertLoadClassFail(C.class, clB);
MockClassLoadingMetaData c = new MockClassLoadingMetaData("c");
c.getRequirements().addRequirement(factory.createRequirePackage(B.class.getPackage().getName()));
c.setPathsAndPackageNames(C.class);
KernelControllerContext contextC = install(c);
try
{
assertLoadClass(A.class, clA);
assertLoadClassFail(B.class, clA);