Package org.jboss.test.microcontainer.support

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


   public void testLifecycleInterceptionsWithDependencyWrongOrder() throws Exception
   {
      deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
      try
      {
         SimpleBean bean;
         try
         {
            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
View Full Code Here


   public void testLifecycleInterceptionsWithDependencyRedeploy() throws Exception
   {
      deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml");
      try
      {
         SimpleBean bean;
         try
         {
            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
View Full Code Here

   }


   private void checkInterceptedAndInjected(String name)
   {
      SimpleBean dependency1 = (SimpleBean) getBean("Dependency1");
      assertNotNull(dependency1);
      SimpleBean dependency2 = (SimpleBean) getBean("Dependency2");
      assertNotNull(dependency2);
      SimpleBean dependency3 = (SimpleBean) getBean("Dependency3");
      assertNotNull(dependency3);

      InterceptorWithAnnotationDependency.intercepted = null;
      SimpleBean bean = (SimpleBean) getBean(name);
      assertNotNull(bean);
      bean.someMethod();
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted1);
      assertTrue(dependency1 == InterceptorWithNestedAnnotationDependency.intercepted1);
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted2);
      assertTrue(dependency2 == InterceptorWithNestedAnnotationDependency.intercepted2);
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted3);
View Full Code Here

      return delegate;
   }

   public void testScopingWithAop() throws Exception
   {
      SimpleBean simple1 = (SimpleBean)getBean("simple1");
      assertNotNull(simple1);
      CalledInterceptor.intercepted = false;
      simple1.someMethod();
      assertTrue(CalledInterceptor.intercepted);
     
      SimpleBean simple2 = (SimpleBean)getBean("simple2");
      assertNotNull(simple2);
      CalledInterceptor.intercepted = false;
      simple2.someMethod();
      assertFalse(CalledInterceptor.intercepted);
   }
View Full Code Here

   }


   private void checkInterceptedAndInjected(String name)
   {
      SimpleBean dependency1 = (SimpleBean) getBean("Dependency1");
      assertNotNull(dependency1);
      SimpleBean dependency2 = (SimpleBean) getBean("Dependency2");
      assertNotNull(dependency2);
      SimpleBean dependency3 = (SimpleBean) getBean("Dependency3");
      assertNotNull(dependency3);

      InterceptorWithAnnotationDependency.intercepted = null;
      SimpleBean bean = (SimpleBean) getBean(name);
      assertNotNull(bean);
      bean.someMethod();
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted1);
      assertTrue(dependency1 == InterceptorWithNestedAnnotationDependency.intercepted1);
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted2);
      assertTrue(dependency2 == InterceptorWithNestedAnnotationDependency.intercepted2);
      assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted3);
View Full Code Here

   public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception
   {
      deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml");
         try
         {
            checkInterceptedAndInjected("Intercepted", dependency);
View Full Code Here

         checkNotInstalledAndDescribed("AnnotatedIntercepted");
        
         deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);

            checkInterceptedAndInjected("Intercepted", dependency);
            checkNotInstalledAndDescribed("AnnotatedIntercepted");
         }
View Full Code Here

         checkNotInstalledAndDescribed("AnnotatedIntercepted");
        
         deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);

            checkInterceptedAndInjected("Intercepted", dependency);
            checkNotInstalledAndDescribed("AnnotatedIntercepted");
         }
         finally
         {
            undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
         }
        
         checkNotInstalledAndDescribed("Intercepted");
         checkNotInstalledAndDescribed("AnnotatedIntercepted");
        
         deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);
           
            checkInterceptedAndInjected("Intercepted", dependency);
            checkNotInstalledAndDescribed("AnnotatedIntercepted");
         }
View Full Code Here

   public void testInterceptorWithAnnotationDependencyRedeploy2() throws Exception
   {
      deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml");
         try
         {
            checkInterceptedAndInjected("Intercepted", dependency);
View Full Code Here


   private void checkInterceptedAndInjected(String name, SimpleBean dependency)
   {
      InterceptorWithAnnotationDependency.intercepted = null;
      SimpleBean bean = (SimpleBean) getBean(name);
      assertNotNull(bean);
      bean.someMethod();
      assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted);
   }  
View Full Code Here

TOP

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

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.