Package org.aopalliance.intercept

Examples of org.aopalliance.intercept.MethodInterceptor.invoke()


    source.firstname = "Dave";

    when(invocation.getMethod()).thenReturn(Projection.class.getMethod("getFirstname"));
    MethodInterceptor interceptor = new PropertyAccessingMethodInterceptor(source);

    assertThat(interceptor.invoke(invocation), is((Object) "Dave"));
  }

  /**
   * @see DATAREST-221
   */
 
View Full Code Here


    when(invocation.getMethod()).thenReturn(Projection.class.getMethod("propertyFromTarget"));

    MethodInterceptor interceptor = new SpelEvaluatingMethodInterceptor(delegate, new Target(), null);

    assertThat(interceptor.invoke(invocation), is((Object) "property"));
  }

  /**
   * @see DATAREST-221
   */
 
View Full Code Here

    AdvisedSupport pc = new AdvisedSupport(new Class<?>[] { ITestBean.class });
    pc.addAdvice(mi);
    AopProxy aop = createAopProxy(pc);

    given(mi.invoke(null)).willReturn(age);

    ITestBean tb = (ITestBean) aop.getProxy();
    assertTrue("correct return value", tb.getAge() == age);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.