deploy(getFile0());
try
{
validate();
Dependency dependency = (Dependency) getBean("Dependency");
assertNotNull(dependency);
pojo = (POJO) getBean("Intercepted");
assertNotNull(pojo);
TestAspectWithDependency.invoked = null;
TestInterceptor.invoked = false;
pojo.method(2);
assertTrue(dependency == TestAspectWithDependency.invoked);
assertTrue(TestInterceptor.invoked);
}
finally
{
undeploy(getFile0());
}
try
{
pojo = (POJO) getBean("Intercepted");
fail("Bean should not be installed after the dependency is undeployed");
}
catch (IllegalStateException expected)
{
KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
assertNotNull(context);
}
deploy(getFile0());
try
{
validate();
Dependency dependency = (Dependency) getBean("Dependency");
assertNotNull(dependency);
pojo = (POJO) getBean("Intercepted");
assertNotNull(pojo);
int called = TestAspectWithDependency.called;
TestInterceptor.invoked = false;