Package org.aspectj.lang

Examples of org.aspectj.lang.Signature


  // TODO 4: Create a pointcut that matches any method on the AccountRepository, RestaurantRepository, or
  // RewardRepository interfaces

  private String createJoinPointTraceName(JoinPoint joinPoint) {
    Signature signature = joinPoint.getSignature();
    StringBuilder sb = new StringBuilder();
    sb.append(signature.getDeclaringType().getSimpleName());
    sb.append('.').append(signature.getName());
    return sb.toString();
  }
View Full Code Here


  @Test
  public void testMonitor() throws Throwable {
    JamonMonitorFactory monitorFactory = new JamonMonitorFactory();
    RepositoryPerformanceMonitor performanceMonitor = new RepositoryPerformanceMonitor(
        monitorFactory);
    Signature signature = EasyMock.createMock(Signature.class);
    ProceedingJoinPoint targetMethod = EasyMock
        .createMock(ProceedingJoinPoint.class);

    EasyMock.expect(targetMethod.getSignature()).andReturn(signature);
    EasyMock.expect(signature.getDeclaringType()).andReturn(Object.class);
    EasyMock.expect(signature.getName()).andReturn("hashCode");
    EasyMock.expect(targetMethod.proceed()).andReturn(new Object());

    EasyMock.replay(signature, targetMethod);
    performanceMonitor.monitor(targetMethod);
    EasyMock.verify(signature, targetMethod);
View Full Code Here

public class RepositoryPerformanceMonitorTest extends TestCase {

  public void testMonitor() throws Throwable {
    JamonMonitorFactory monitorFactory = new JamonMonitorFactory();
    RepositoryPerformanceMonitor performanceMonitor = new RepositoryPerformanceMonitor(monitorFactory);
    Signature signature = EasyMock.createMock(Signature.class);
    ProceedingJoinPoint targetMethod = EasyMock.createMock(ProceedingJoinPoint.class);

    EasyMock.expect(targetMethod.getSignature()).andReturn(signature);
    EasyMock.expect(signature.getDeclaringType()).andReturn(Object.class);
    EasyMock.expect(signature.getName()).andReturn("hashCode");
    EasyMock.expect(targetMethod.proceed()).andReturn(new Object());

    EasyMock.replay(signature, targetMethod);
    performanceMonitor.monitor(targetMethod);
    EasyMock.verify(signature, targetMethod);
View Full Code Here

TOP

Related Classes of org.aspectj.lang.Signature

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.