Package org.jboss.test.microcontainer.beans

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


      }
   }

   private void checkIntercepted1(Dependency dependency1)
   {
      POJO pojo1 = (POJO) getBean("Intercepted1");
      assertNotNull(pojo1);
      TestAspectWithDependency.invoked = null;
      TestInterceptorWithDependency.invoked = null;
      pojo1.method(2);
      assertNotNull(TestAspectWithDependency.invoked);
      assertTrue(dependency1 == TestAspectWithDependency.invoked);
      assertNull(TestInterceptorWithDependency.invoked);
   }
View Full Code Here


      assertNull(TestInterceptorWithDependency.invoked);
   }

   private void checkIntercepted2(Dependency dependency2)
   {
      POJO pojo2 = (POJO) getBean("Intercepted2");
      assertNotNull(pojo2);
      TestAspectWithDependency.invoked = null;
      TestInterceptorWithDependency.invoked = null;
      pojo2.method(2);
      assertNull(TestAspectWithDependency.invoked);
      assertNotNull(TestInterceptorWithDependency.invoked);
      System.out.println(TestInterceptorWithDependency.invoked);
      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
   }
View Full Code Here

      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
   }

   private void checkIntercepted3(Dependency dependency1, Dependency dependency2)
   {
      POJO pojo3 = (POJO) getBean("Intercepted3");
      assertNotNull(pojo3);
      TestAspectWithDependency.invoked = null;
      TestInterceptorWithDependency.invoked = null;
      pojo3.method(2);
      assertNotNull(TestAspectWithDependency.invoked);
      assertTrue(dependency1 == TestAspectWithDependency.invoked);
      assertNotNull(TestInterceptorWithDependency.invoked);
      assertTrue(dependency2 == TestInterceptorWithDependency.invoked);
   }
View Full Code Here

      checkNoIntercepted("Intercepted3");
   }

   private void checkNoIntercepted(String name)
   {
      POJO pojo;
      try
      {
         pojo = (POJO) getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
View Full Code Here

   }

   public void testIntercepted() throws Exception
   {
      SimpleFactoryAspect.invoked = 0;
      POJO pojo = (POJO)getBean("Bean");
      int ret = pojo.method(2);
      assertEquals(4, ret);
      assertTrue(SimpleFactoryAspect.invoked == 100);
   }
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

   public void testDomain()
   {
      TestAspect.invoked = false;
      TestInterceptor.invoked = false;
      TestAspectWithProperty.last = null;
      POJO pojo = (POJO)createProxy("AOPDomain", new POJO());
      assertNotNull(pojo);
      pojo.method();
      assertNotNull(TestAspectWithProperty.last);
      assertEquals("This is only a test", TestAspectWithProperty.last.getSomeProperty());
      assertTrue(TestInterceptor.invoked);
      assertTrue(TestAspect.invoked);
View Full Code Here

   public void testNoDomain()
   {
      TestInterceptor.invoked = false;
      TestAspectWithProperty.last = null;
      TestAspect.invoked = false;
      POJO pojo = (POJO)createProxy(new POJO());
      assertNotNull(pojo);
      pojo.method();
      assertNull(TestAspectWithProperty.last);
      assertFalse(TestInterceptor.invoked);
      assertFalse(TestAspect.invoked);

      AspectManager manager = getMainAspectManager();
View Full Code Here

      super(name);
   }

   public void testPerJoinPoint() throws Exception
   {
      POJO pojoA = (POJO)getBean("POJO1A");
      POJO pojoB = (POJO)getBean("POJO1B");
      POJO2 pojo2 = (POJO2)getBean("POJO2");
  
      ScopedFactoryAspect.last = null;     
      pojoA.method();
      ScopedFactoryAspect a1 = ScopedFactoryAspect.last;
      assertNotNull(a1);
     
      ScopedFactoryAspect.last = null;     
      pojoA.method(1);
      ScopedFactoryAspect a2 = ScopedFactoryAspect.last;
      assertNotNull(a2);
     
      ScopedFactoryAspect.last = null;     
      pojoB.method();
      ScopedFactoryAspect a3 = ScopedFactoryAspect.last;
      assertNotNull(a3);
     
      ScopedFactoryAspect.last = null;     
      pojoB.method(1);
      ScopedFactoryAspect a4 = ScopedFactoryAspect.last;
      assertNotNull(a4);
     
      ScopedFactoryAspect.last = null;     
      pojo2.method();
View Full Code Here

      }
   }

   private void checkIntercepted1(Dependency dependency1)
   {
      POJO pojo1 = (POJO) getBean("Intercepted1");
      assertNotNull(pojo1);
      TestAspectWithDependency.invoked = null;
      TestInterceptorWithDependency.invoked = null;
      pojo1.method(2);
      assertNotNull(TestAspectWithDependency.invoked);
      assertTrue(dependency1 == TestAspectWithDependency.invoked);
      assertNull(TestInterceptorWithDependency.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.