assertNull("Should NOT have tried policy2 ", policy2.getResourceInvoked);
}
public void testExportLoaderInvoked() throws Exception
{
ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();
MockClassLoaderPolicy mock = createMockClassLoaderPolicy();
mock.setImportAll(true);
ClassLoader mockClassLoader = system.registerClassLoaderPolicy(mock);
TestClassLoaderPolicy policy = new TestClassLoaderPolicy();
policy.packageNames = new String[] { ClassLoaderUtils.getClassPackageName(ClassLoaderDomain.class.getName())};
TestDelegateLoader exported = new TestDelegateLoader(policy);
policy.exported = exported;
system.registerClassLoaderPolicy(policy);
assertLoadClassFail(ClassLoaderDomain.class, mockClassLoader);
assertNotNull("Should have tried to the export delegate ", exported.getResourceInvoked);
assertNotNull("Should have tried to the export delegate to load the class ", exported.loadClassInvoked);
assertNull("Should NOT have tried to load through us ", policy.getResourceInvoked);