Package org.jboss.test.microcontainer.matrix

Examples of org.jboss.test.microcontainer.matrix.Base


*/
public class BaseOnlyAdvisedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest
{
   public void testAdvisedBaseClass() throws Exception
   {
      Base base = (Base)getBean("Base");
      assertTrue(base instanceof Advised);
      assertFalse(base instanceof AspectManaged);
     
      Child plainChild = (Child)getBean("PlainChild");
      assertTrue(plainChild instanceof Advised);
      assertFalse(plainChild instanceof AspectManaged);
     
      Child proxiedChild = (Child)getBean("ProxiedChild");
      assertTrue(proxiedChild instanceof Advised);
      assertTrue(proxiedChild instanceof AspectManaged);

      TestInterceptor.reset();
      base.baseOnly();
      assertEquals(1, TestInterceptor.interceptions);
      assertNotNull(TestInterceptor.invoked);
      assertEquals("baseOnly", TestInterceptor.invoked.getName());
      assertNull(TestInterceptor.classAnnotation);
      assertNull(TestInterceptor.methodAnnotation);
      assertNull(TestInterceptor.metadata);

      TestInterceptor.reset();
      base.baseOverridden();
      assertEquals(0, TestInterceptor.interceptions);
   }
View Full Code Here


public class NotAdvisedInstanceIntroductionsTestCase extends AbstractProxyTest
{

   public void testIntroductions() throws Exception
   {
      Base base = new Base();
      Object proxy = assertCreateProxy(base, new Class[] {SimpleBean.class}, SimpleBean.class);
      assertFalse(proxy instanceof Advised);
      assertTrue(proxy instanceof AspectManaged);
     
      //Not the main purpose of the test but being paranoid never hurt
View Full Code Here

     
   }
  
   public void testMixins() throws Exception
   {
      Base base = new Base();
      AOPProxyFactoryMixin[] mixins = {
            new AOPProxyFactoryMixin(OtherMixinImpl.class, new Class[] {OtherMixin.class}),
            new AOPProxyFactoryMixin(SomeMixinImpl.class, new Class[] {SomeMixin.class}),
      };
      Object proxy = assertCreateProxy(base, null, mixins, new Class[] {OtherMixin.class, SomeMixin.class});
View Full Code Here

*/
public class NotAdvisedInstanceSimpleMetaDataTestCase extends AbstractProxyTest
{
   public void testSimpleMetaData() throws Exception
   {
      Base base = new Base();
      SimpleMetaData metaData = new SimpleMetaData();
      metaData.addMetaData("Simple", "MetaData", "Value");
      Object proxy = createProxy(base, null, metaData);
      assertFalse(proxy instanceof Advised);
      assertFalse(proxy instanceof AspectManaged);
View Full Code Here

public class AdvisedInstanceMixinTestCase extends AbstractProxyTest
{

   public void testMixins() throws Exception
   {
      Base base = new Base();
      AOPProxyFactoryMixin[] mixins = {
            new AOPProxyFactoryMixin(OtherMixinImpl.class, new Class[] {OtherMixin.class}),
            new AOPProxyFactoryMixin(SomeMixinImpl.class, new Class[] {SomeMixin.class}),
      };
      Object proxy = assertCreateProxy(base, null, mixins, new Class[] {OtherMixin.class, SomeMixin.class});
View Full Code Here

public class AdvisedInstanceIntroductionsTestCase extends AbstractProxyTest
{

   public void testIntroductions() throws Exception
   {
      Base base = new Base();
      Object proxy = assertCreateProxy(base, new Class[] {SimpleBean.class}, SimpleBean.class);
      assertTrue(proxy instanceof Advised);
      assertTrue(proxy instanceof AspectManaged);
     
      //Not the main purpose of the test but being paranoid never hurt
View Full Code Here

      assertEquals("value2", TestInterceptor.metadata);
   }

   private Object createProxyWithSimpleMetaData(String value) throws Exception
   {
      Base base = new Base();
      SimpleMetaData metaData = new SimpleMetaData();
      metaData.addMetaData("Simple", "MetaData", value);
      Object proxy = createProxy(base, null, metaData);
      assertTrue(proxy instanceof Advised);
      assertTrue(proxy instanceof AspectManaged);
View Full Code Here

*/
public class NotAdvisedNoInstanceDataTestCase extends AbstractProxyTest
{
   public void testNotAdvised() throws Exception
   {
      Base base = new Base();
      Object proxy = createProxy(base);
      assertFalse(proxy instanceof Advised);
      assertFalse(proxy instanceof AspectManaged);

      //Not the main purpose of the test but being paranoid never hurt
      TestInterceptor.reset();
      base.baseOnly();
      assertEquals(0, TestInterceptor.interceptions);
     
      String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class);
      TestInterceptor.reset();
      base.baseOnly();
      assertEquals(0, TestInterceptor.interceptions);
     
      DynamicAspectDeployer.removeBinding(name);
      TestInterceptor.reset();
      base.baseOnly();
      assertEquals(0, TestInterceptor.interceptions);     
   }
View Full Code Here

*/
public class BaseForceProxyChildAdvisedAndProxyTestCase extends AbstractProxyTest
{
   public void testProxieddBaseClass() throws Exception
   {
      Base base = new Base();
      assertFalse(base instanceof Advised);
      String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class);
      try
      {
         Object proxy = createProxy(base);
         assertTrue(proxy instanceof AspectManaged);
         assertFalse(proxy instanceof Advised);
        
         TestInterceptor.reset();
         base.baseOnly();
         assertEquals(0, TestInterceptor.interceptions);
        
         TestInterceptor.reset();
         base.baseOverridden();
         assertEquals(0, TestInterceptor.interceptions);
        
         TestInterceptor.reset();
         ((Base)proxy).baseOnly();
         assertEquals(1, TestInterceptor.interceptions);
View Full Code Here

*/
public class AdvisedNoInstanceDataTestCase extends AOPMicrocontainerTest
{
   public void testNotAdvised() throws Exception
   {
      Base base = (Base)getBean("Test");
      assertTrue(base instanceof Advised);
      assertFalse(base instanceof AspectManaged);
     
      //Not the main purpose of the test but being paranoid never hurt
      TestInterceptor.reset();
      base.baseOnly();
      assertEquals(1, TestInterceptor.interceptions);
      assertNotNull(TestInterceptor.invoked);
      assertEquals("baseOnly", TestInterceptor.invoked.getName());
      assertNull(TestInterceptor.classAnnotation);
      assertNull(TestInterceptor.methodAnnotation);
View Full Code Here

TOP

Related Classes of org.jboss.test.microcontainer.matrix.Base

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.