Package org.jboss.test.microcontainer.beans

Examples of org.jboss.test.microcontainer.beans.POJO


         assertNotNull(dependency);
         deploy(getFile1());
         try
         {
            validate();
            POJO pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            TestAspectWithDependency.invoked = null;
            TestInterceptor.invoked = false;          
            pojo.method(2);
            assertTrue(dependency == TestAspectWithDependency.invoked);
            assertTrue(TestInterceptor.invoked);
         }
         finally
         {
            undeploy(getFile1());
         }
  
         dependency = (Dependency) getBean("Dependency");
         assertNotNull(dependency);
         deploy(getFile1());
         try
         {
            POJO pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            TestAspectWithDependency.invoked = null;
            TestInterceptor.invoked = false;
            pojo.method(2);
            assertTrue(dependency == TestAspectWithDependency.invoked);
            assertTrue(TestInterceptor.invoked);
         }
         finally
         {
View Full Code Here


   }

   public void testIntroduced() throws Exception
   {
      TestAspect.invoked = false;
      POJO pojo = (POJO)getBean("Bean");
      assertTrue(pojo instanceof MixinInterface);
      pojo.method();
      assertTrue(TestAspect.invoked);
      assertEquals("CUSTOM CONSTRUCTION", ((MixinInterface)pojo).getMixinValue());
   }
View Full Code Here

      super(name);
   }

   public void testIntercepted() throws Exception
   {
      POJO pojo = (POJO)getBean("Bean");
      TestAspect.invoked = false;
      callPOJO(pojo);
      assertTrue(TestAspect.invoked);
     
      TestAspect.invoked = false;
View Full Code Here

         assertNotNull(dependency);
         deploy(getFile1());
         try
         {
            validate();
            POJO pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            pojo.method(2);
            assertNotNull(TestInterceptorWithDependency.invoked);
            assertTrue(dependency == TestInterceptorWithDependency.invoked);
         }
         finally
         {
View Full Code Here

   public void testInterceptorWithDependencyWrongOrder() throws Exception
   {
      deploy(getFile1());
      try
      {
         POJO pojo;
         try
         {
            pojo = (POJO) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
         catch (IllegalStateException expected)
         {
         }
        
         pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED);
         assertNull("This should not be deployed until the interceptor is", pojo);
        
         deploy(getFile0());
         try
         {
            validate();
            Dependency dependency = (Dependency) getBean("Dependency");
            assertNotNull(dependency);
            pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            pojo.method(2);
            assertTrue(dependency == TestInterceptorWithDependency.invoked);
         }
         finally
         {
            undeploy(getFile0());
View Full Code Here

   public void testInterceptorWithDependencyRedeploy() throws Exception
   {
      deploy(getFile1());
      try
      {
         POJO pojo;
         try
         {
            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 == TestInterceptorWithDependency.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 = TestInterceptorWithDependency.called;
            pojo.method(2);
            assertTrue("Interceptor was not rebound", called + 1 == TestInterceptorWithDependency.called);
            assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestInterceptorWithDependency.invoked);
         }
         finally
         {
View Full Code Here

         assertNotNull(dependency);
         deploy(getFile1());
         try
         {
            validate();
            POJO pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            pojo.method(2);
            assertTrue(dependency == TestInterceptorWithDependency.invoked);
         }
         finally
         {
            undeploy(getFile1());
         }
  
         dependency = (Dependency) getBean("Dependency");
         assertNotNull(dependency);
         deploy(getFile1());
         try
         {
            POJO pojo = (POJO) getBean("Intercepted");
            assertNotNull(pojo);
            pojo.method(2);
            assertTrue(dependency == TestInterceptorWithDependency.invoked);
         }
         finally
         {
            undeploy(getFile1());
View Full Code Here

   {
      TestAspect.invoked = false;
      SimpleFactoryAspect.invoked = 0;
      TestInterceptor.invoked = false;
      SimpleFactoryInterceptor.invoked = 0;
      POJO pojo = (POJO)getBean("Bean");
      int ret = pojo.method(2);
      assertEquals(4, ret);
      assertTrue(SimpleFactoryAspect.invoked == 100);
      assertTrue(TestAspect.invoked);
      assertTrue(SimpleFactoryInterceptor.invoked == 100);
      assertTrue(TestInterceptor.invoked);
View Full Code Here

      super(name);
   }

   public void testIntercepted() throws Exception
   {
      POJO pojo = (POJO)getBean("Bean");
      TestAspect.invoked = false;
      pojo.method();
      assertFalse(TestAspect.invoked);
  
      DynamicCFlowImpl.execute = true;
      pojo.method();
      assertTrue(TestAspect.invoked);
   }
View Full Code Here

   }

   public void testIntroduced() throws Exception
   {
      TestAspect.invoked = false;
      POJO pojo = (POJO)getBean("Bean");
      assertTrue(pojo instanceof IntroductionInterface);
      pojo.method();
      assertTrue(TestAspect.invoked);
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.microcontainer.beans.POJO

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.