pojo = (POJO) getBean("Intercepted");
fail("Bean should not be installed until the dependency is");
}
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);
pojo.method(2);
assertTrue(dependency == TestAspectWithDependency.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());