Package org.jboss.test.microcontainer.support

Examples of org.jboss.test.microcontainer.support.SimpleBeanImpl


         {
            //Deploy bean intercepted by both aspects
            deploy("UndeployAspectDependencyTestCaseNotAutomatic2.xml");
            try
            {
               SimpleBeanImpl bean = (SimpleBeanImpl)getBean("Intercepted");
               SimpleInterceptor1.invoked = false;
               SimpleInterceptor2.invoked = false;
               bean.someMethod();
               assertTrue(SimpleInterceptor1.invoked);
               assertTrue(SimpleInterceptor2.invoked);

               ControllerContext ctx = getControllerContext("Intercepted");
               Controller controller = ctx.getController();
              
               //Move the bean intercepted to pre-install state
               controller.change(ctx, ControllerState.PRE_INSTALL);
              
               //Undeploy the second aspect
               undeploy("UndeployAspectDependencyTestCaseNotAutomatic1.xml");
              
               //Move the bean back to the installed state
               controller.change(ctx, ControllerState.INSTALLED);
              
               bean = (SimpleBeanImpl)getBean("Intercepted");
               SimpleInterceptor1.invoked = false;
               SimpleInterceptor2.invoked = false;
               bean.someMethod();
               assertTrue(SimpleInterceptor1.invoked);
               assertFalse(SimpleInterceptor2.invoked);
            }
            finally
            {
View Full Code Here


   }  

   private void checkInterceptedAndInjectedMethodAnnotatedXml(SimpleBean dependency)
   {
      InterceptorWithAnnotationDependency.intercepted = null;
      SimpleBeanImpl bean = (SimpleBeanImpl) getBean("MethodIntercepted");
      assertNotNull(bean);
      bean.setProperty(1);
      assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted);
   }  
View Full Code Here

            assertEquals(0, SimpleLifecycleCallback.interceptions.size());
            //Deploy bean intercepted by both aspects
            deploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic2.xml");
            try
            {
               SimpleBeanImpl bean = (SimpleBeanImpl)getBean("Intercepted");
               assertNotNull(bean);
               assertEquals(2, SimpleLifecycleCallback.interceptions.size());
               assertTrue(hasExpectedInterception("Intercepted", ControllerState.CONFIGURED));
               assertTrue(hasExpectedInterception("Intercepted", ControllerState.START));
View Full Code Here

      super(name);
   }
  
   public void testIntercepted()
   {
      SimpleBeanImpl bean = (SimpleBeanImpl) getBean("Intercepted");
      assertFalse(TestAspect.fooCalled);
      assertFalse(TestAspect.barCalled);

      bean.someMethod();
      assertTrue("TestAspect.foo not called", TestAspect.fooCalled);
      assertFalse("TestAspect.bar was called", TestAspect.barCalled);
     
      TestAspect.fooCalled = false;
      assertFalse(TestAspect.fooCalled);
      assertFalse(TestAspect.barCalled);

      bean.someOtherMethod();
      assertFalse("TestAspect.foo was called", TestAspect.fooCalled);
      assertTrue("TestAspect.bar was not called", TestAspect.barCalled);
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.microcontainer.support.SimpleBeanImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.