assertNoClassLoader(contextParentA);
}
public void testParentLast() throws Exception
{
ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
MockClassLoadingMetaData aParent = new MockClassLoadingMetaData("aParent");
aParent.setPathsAndPackageNames(A.class);
KernelControllerContext contextParentA = install(aParent);
try
{
ClassLoader clParentA = assertClassLoader(contextParentA);
assertLoadClass(A.class, clParentA);
assertLoadClassFail(B.class, clParentA);
MockClassLoadingMetaData aChild = new MockClassLoadingMetaData("aChild");
aChild.setDomain("ChildDomain");
aChild.setJ2seClassLoadingCompliance(false);
aChild.setPathsAndPackageNames(A.class);
KernelControllerContext contextChildA = install(aChild);
try
{
ClassLoader clChildA = assertClassLoader(contextChildA);
assertLoadClass(A.class, clChildA);
assertLoadClassFail(B.class, clChildA);
MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
b.setDomain("ChildDomain");
b.setJ2seClassLoadingCompliance(false);
b.setPathsAndPackageNames(B.class);
b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
KernelControllerContext contextB = install(b);
try
{
ClassLoader clB = assertClassLoader(contextB);
assertLoadClass(A.class, clChildA);