Package org.jboss.test.microcontainer.beans

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


   public void testIntercepted() throws Exception
   {
      TestAspect.invoked = false;
      SimpleFactoryAspect.invoked = 0;
      POJO pojo = (POJO)getBean("Bean");
      int ret = pojo.method(2);
      assertEquals(4, ret);
      assertTrue(SimpleFactoryAspect.invoked == 100);
      assertTrue(TestAspect.invoked);
     
   }
View Full Code Here


   }

   public void testIntercepted() throws Exception
   {
      Interceptions.reset();
      POJO pojo = (POJO)getBean("Bean");
      pojo.method(2);
     
      List<Object> interceptions = Interceptions.interceptions();
      assertEquals(2, interceptions.size());
     
      assertEquals(TestInterceptor.class, interceptions.get(0).getClass());
View Full Code Here

         try
         {
            deploy(getFile1());
           
            DependencyFactoryAspect.invoked = null;
            POJO pojo = (POJO)getBean("Bean");
            int ret = pojo.method(2);
            assertEquals(4, ret);
            POJO dep = (POJO)getBean("Dependency");
            assertSame(dep, DependencyFactoryAspect.invoked);
         }
         finally
         {
            undeploy(getFile1());
View Full Code Here

   }

   public void testIntercepted() throws Exception
   {
      TestAspect.invoked = false;
      POJO pojo = (POJO)getBean("Bean");
      int ret = pojo.method(2);
      assertEquals(4, ret);
      assertTrue(SimpleFactoryInterceptor.invoked == 100);
   }
View Full Code Here

   }
  
   public void testPropertyReplacement()
   {
      AnnotationWithValueAspect.value = null;
      POJO pojo = (POJO)getBean("Bean");
      pojo.method(2);
      assertNull(AnnotationWithValueAspect.value);
     
      pojo.method();
      assertNotNull(AnnotationWithValueAspect.value);
      assertEquals(100, AnnotationWithValueAspect.value.integer());
   }
View Full Code Here

      super(name);
   }

   public void testPerVm() throws Exception
   {
      POJO pojo = (POJO)getBean("POJO1A");
      POJO2 pojo2 = (POJO2)getBean("POJO2");
  
      ScopedFactoryAspect.last = null;
      pojo.method();
      ScopedFactoryAspect a1 = ScopedFactoryAspect.last;
      assertNotNull(a1);
     
      ScopedFactoryAspect.last = null;
      pojo2.method();
      ScopedFactoryAspect a2 = ScopedFactoryAspect.last;
      assertNotNull(a2);
      assertSame(a1, a2);
     
      ScopedFactoryAspect.last = null;
      pojo.method(3);
      ScopedFactoryAspect a3 = ScopedFactoryAspect.last;
      assertNotNull(a3);
      assertSame(a1, a3);
   }
View Full Code Here

   public void testAllAopTurnedOff() throws Exception
   {
      assertMoreDependencies("Intercepted", "NotIntercepted");

      POJO pojoNotIntercepted = (POJO)getBean("NotIntercepted");
      assertFalse(pojoNotIntercepted instanceof AspectManaged);

      assertMoreDependencies("WithLifecycle", "WithLifecycleDisabled");
   }
View Full Code Here

  
   public void testPointcutsTurnedOff() throws Exception
   {
      assertMoreDependencies("Intercepted", "NotIntercepted");

      POJO pojoNotIntercepted = (POJO)getBean("NotIntercepted");
      assertFalse(pojoNotIntercepted instanceof AspectManaged);
     
      assertNotInstalledContext("WithLifecycle");
      assertNotInstalledContext("WithLifecycleDisabled");
   }
View Full Code Here

*/
public abstract class ClassMetaDataLoaderTest extends AOPMicrocontainerTest
{
   public void testMetaData() throws Exception
   {
      POJO pojo = (POJO)getBean("Bean");
      assertNotNull(pojo);
     
      assertTrue(TestClassMetaDataAspect.invoked);
      assertEquals("Ccustom1", TestClassMetaDataAspect.last);
     
      TestClassMetaDataAspect.invoked = false;
      TestClassMetaDataAspect.last = null;
      pojo.method(2);
      assertTrue(TestClassMetaDataAspect.invoked);
      assertEquals("Mcustom1", TestClassMetaDataAspect.last);
     
      TestClassMetaDataAspect.invoked = false;
      TestClassMetaDataAspect.last = null;
      pojo.method();
      assertTrue(TestClassMetaDataAspect.invoked);
      assertEquals("Mcustom1", TestClassMetaDataAspect.last);
   }
View Full Code Here

   }

   public void testIntercepted() throws Exception
   {
      TestAspect.invoked = false;
      POJO pojo = (POJO)getBean("Bean");
      pojo.method(2);
      assertFalse(TestAspect.invoked);
     
      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.