Package org.jboss.test.microcontainer.support

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


         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
View Full Code Here


         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
           
            itworked = true;
           
         }
         finally
View Full Code Here

         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
           
            itworked = true;
           
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
            undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml");
            if (itworked)
            {
               assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
               LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
               assertEquals("Intercepted", handled.contextName);
               assertEquals(ControllerState.CONFIGURED, handled.toState);
            }

            try
            {
               bean = (SimpleBean) getBean("Intercepted");
               fail("'Interceped' should not be installed yet");
            }
            catch (IllegalStateException expected)
            {
            }
           
            bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED);
            assertNull("This should not be deployed until the interceptor is", bean);
         }
        
         try
         {
            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
         catch (IllegalStateException expected)
         {
            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
            assertNotNull(context);
         }

         itworked = false;
         LifecycleCallbackWithBeanDependency.interceptions.clear();
         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue("Should not be caching the lifecycle's callback across rebinding", dependency == lifecycle.getDependency());
           
            itworked = true;
         }
         finally
         {
View Full Code Here

         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue(dependency == lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
            undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
            if (itworked)
            {
               assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
               LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
               assertEquals("Intercepted", handled.contextName);
               assertEquals(ControllerState.CONFIGURED, handled.toState);
            }
         }
        
         Object dependency2 = getCheckBeanExists("Dependency");
         assertTrue(dependency == dependency2);
         LifecycleCallbackWithBeanDependency.interceptions.clear();
         deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue(dependency == lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
View Full Code Here

         deploy(getFile1());
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
View Full Code Here

         deploy(getFile0());
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
           
            itworked = true;
           
         }
         finally
View Full Code Here

         deploy(getFile0());
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertEquals(dependency, lifecycle.getDependency());
           
            itworked = true;
           
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
            undeploy(getFile0());
            if (itworked)
            {
               assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
               LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
               assertEquals("Intercepted", handled.contextName);
               assertEquals(ControllerState.CONFIGURED, handled.toState);
            }

            try
            {
               bean = (SimpleBean) getBean("Intercepted");
               fail("'Interceped' should not be installed yet");
            }
            catch (IllegalStateException expected)
            {
            }
           
            bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED);
            assertNull("This should not be deployed until the interceptor is", bean);
         }
        
         try
         {
            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
         catch (IllegalStateException expected)
         {
            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
            assertNotNull(context);
         }

         itworked = false;
         LifecycleCallbackWithBeanDependency.interceptions.clear();
         deploy(getFile0());
         try
         {
            validate();
            Object dependency = getCheckBeanExists("Dependency");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            getCheckBeanExists("Intercepted");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue("Should not be caching the lifecycle's callback across rebinding", dependency == lifecycle.getDependency());
           
            itworked = true;
         }
         finally
         {
View Full Code Here

         deploy(getFile1());
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue(dependency == lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
            undeploy(getFile1());
            if (itworked)
            {
               assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
               LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
               assertEquals("Intercepted", handled.contextName);
               assertEquals(ControllerState.CONFIGURED, handled.toState);
            }
         }
        
         Object dependency2 = getCheckBeanExists("Dependency");
         assertTrue(dependency == dependency2);
         LifecycleCallbackWithBeanDependency.interceptions.clear();
         deploy(getFile1());
         try
         {
            validate();
            getCheckBeanExists("Intercepted");
            LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback");
            assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size());
            LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0);
            assertEquals("Intercepted", handled.contextName);
            assertEquals(ControllerState.CONFIGURED, handled.toState);
            assertNotNull(lifecycle.getDependency());
            assertTrue(dependency == lifecycle.getDependency());
            itworked = true;
         }
         finally
         {
            LifecycleCallbackWithBeanDependency.interceptions.clear();
View Full Code Here

TOP

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

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.