}
protected void testExplicitRequirementsInDomain(String domain, boolean failC, boolean failD) throws Exception
{
ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
MockClassLoadingMetaData c = new MockClassLoadingMetaData("c");
c.setPathsAndPackageNames(C.class, D.class);
c.setImportAll(true);
c.setExportAll(ExportAll.NON_EMPTY);
KernelControllerContext contextC = install(c);
try
{
MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
b.setDomain(domain);
b.setPathsAndPackageNames(B.class);
b.getRequirements().addRequirement(factory.createRequirePackage(A.class.getPackage().getName()));
KernelControllerContext contextB = install(b);
try
{
assertNoClassLoader(contextB);
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
a.setDomain(domain);
a.setPathsAndPackageNames(A.class);
a.getCapabilities().addCapability(factory.createPackage(A.class.getPackage().getName()));
KernelControllerContext contextA = install(a);
try
{
ClassLoader clA = assertClassLoader(contextA);
assertLoadClass(A.class, clA);