}
public void testImportModuleVersionCheckFailed() throws Exception
{
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
a.getCapabilities().addCapability(factory.createModule("ModuleA", "3.0.0"));
a.getCapabilities().addCapability(factory.createPackage(A.class.getPackage().getName()));
a.setPathsAndPackageNames(A.class);
KernelControllerContext contextA = install(a);
try
{
ClassLoader clA = assertClassLoader(contextA);
assertLoadClass(A.class, clA);
assertLoadClassFail(B.class, clA);
MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
b.getRequirements().addRequirement(factory.createRequireModule("ModuleA", new VersionRange("1.0.0", "2.0.0")));
b.setPathsAndPackageNames(B.class);
KernelControllerContext contextB = install(b);
try
{
assertLoadClass(A.class, clA);