Package org.jboss.test.microcontainer.annotatedaop

Examples of org.jboss.test.microcontainer.annotatedaop.SimplePOJO


   public void testIntrodution()
   {
      AnnotationIntroductionAspect.reset();
     
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
     
      assertTrue(AnnotationIntroductionAspect.invoked);
   }
View Full Code Here


      super(name);
   }

   public void testPrepare()
   {
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      assertInstanceOf(pojo, Advised.class);
   }
View Full Code Here

   public void testTypedef()
   {
      TypedefAspect.reset();
     
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
     
      assertTrue(TypedefAspect.invoked);
   }
View Full Code Here

   }

   public void testInterceptor()
   {
      TestInterceptor.reset();
      SimplePOJO pojoA = (SimplePOJO)getBean("BeanA");
      pojoA.method();
      assertEquals(1, TestInterceptor.invoked);
     
      //Now check that the scope was honoured
      TestInterceptor testA = TestInterceptor.last;
      TestInterceptor.reset();
      pojoA.method();
      assertEquals(1, TestInterceptor.invoked);
      assertSame(testA, TestInterceptor.last);
     
      TestInterceptor.reset();
      SimplePOJO pojoB = (SimplePOJO)getBean("BeanB");
      pojoB.method();
      assertEquals(1, TestInterceptor.invoked);
      assertNotSame(testA, TestInterceptor.last);
   }
View Full Code Here

      super(name);
   }

   public void testIntroductionsAndMixins() throws Exception
   {
      SimplePOJO pojo = getBean();
      System.out.println("-------------->" + Arrays.asList(pojo.getClass().getInterfaces()));

      assertInstanceOf(pojo, EmptyInterface1.class);
      assertInstanceOf(pojo, EmptyInterface2.class);
      assertInstanceOf(pojo, EmptyInterface3.class);
View Full Code Here

   public void testIntrodution()
   {
      DynamicCFlowAspect.reset();
     
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
      assertFalse(DynamicCFlowAspect.invoked);
     
      DynamicCFlowImpl.setFlag(true);
     
      pojo.method();
      assertTrue(DynamicCFlowAspect.invoked);
     
   }
View Full Code Here

   public void testIntrodution()
   {
      NamedPointcutAspect.reset();
     
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
     
      assertTrue(NamedPointcutAspect.invoked);
   }
View Full Code Here

   public void testPrecedence()
   {
      Interceptions.clear();
     
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
     
      List<Integer> interceptions = Interceptions.getInterceptions();
      assertEquals(4, interceptions.size());
     
      for (int i = 0 ; i < 4 ; i++)
View Full Code Here

   }

   public void testAspect()
   {
      TestAspect.reset();
      SimplePOJO pojoA = (SimplePOJO)getBean("BeanA");
      pojoA.method();
      assertEquals(1, TestAspect.invoked);
      assertEquals(1, TestAspect.advice);
     
      //Now check that the scope was honoured
      TestAspect testA = TestAspect.last;
     
      TestAspect.reset();
      pojoA.anotherMethod();
      assertEquals(1, TestAspect.invoked);
      assertEquals(2, TestAspect.advice);
      assertSame(testA, TestAspect.last);
     
      TestAspect.reset();
      SimplePOJO pojoB = (SimplePOJO)getBean("BeanB");
      pojoB.method();
      assertEquals(1, TestAspect.invoked);
      assertEquals(1, TestAspect.advice);
      assertNotSame(testA, TestAspect.last);
   }
View Full Code Here

      assertFalse(TestCFlowInterceptor.invoked);
   }
  
   private void makeCall()
   {
      SimplePOJO pojo = (SimplePOJO)getBean("Bean");
      pojo.method();
   }
View Full Code Here

TOP

Related Classes of org.jboss.test.microcontainer.annotatedaop.SimplePOJO

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.