Package org.springframework.aop.aspectj

Examples of org.springframework.aop.aspectj.AspectJExpressionPointcut.matches()


    AspectJExpressionPointcut iOtherPc = new AspectJExpressionPointcut();
    iOtherPc.setExpression(matchesIOther);
   
    assertTrue(testBeanPc.matches(TestBean.class));
    assertTrue(testBeanPc.matches(getAge, TestBean.class));
    assertTrue(iOtherPc.matches(OtherIOther.class.getMethod("absquatulate", null),
        OtherIOther.class));
 
    assertFalse(testBeanPc.matches(OtherIOther.class.getMethod("absquatulate", null),
        OtherIOther.class));
  }
View Full Code Here


    }
    withinBeansPackage = withinBeansPackage + "*)";
    AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut();
    withinBeansPc.setExpression(withinBeansPackage);
   
    assertTrue(withinBeansPc.matches(TestBean.class));
    assertTrue(withinBeansPc.matches(getAge, TestBean.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
View Full Code Here

    withinBeansPackage = withinBeansPackage + "*)";
    AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut();
    withinBeansPc.setExpression(withinBeansPackage);
   
    assertTrue(withinBeansPc.matches(TestBean.class));
    assertTrue(withinBeansPc.matches(getAge, TestBean.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
    assertFalse(withinBeansPc.matches(String.class));
View Full Code Here

    AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut();
    withinBeansPc.setExpression(withinBeansPackage);
   
    assertTrue(withinBeansPc.matches(TestBean.class));
    assertTrue(withinBeansPc.matches(getAge, TestBean.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
    assertFalse(withinBeansPc.matches(String.class));
    assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", null),
View Full Code Here

    withinBeansPc.setExpression(withinBeansPackage);
   
    assertTrue(withinBeansPc.matches(TestBean.class));
    assertTrue(withinBeansPc.matches(getAge, TestBean.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
    assertFalse(withinBeansPc.matches(String.class));
    assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", null),
        OtherIOther.class));
View Full Code Here

    assertTrue(withinBeansPc.matches(getAge, TestBean.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
    assertFalse(withinBeansPc.matches(String.class));
    assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", null),
        OtherIOther.class));
  }
 
  public void testFriendlyErrorOnNoLocationClassMatching() {
View Full Code Here

    assertEquals(matchSubpackages, withinBeansPc.matches(BeanFactory.class));
    assertEquals(matchSubpackages, withinBeansPc.matches(
        DefaultListableBeanFactory.class.getMethod("getBeanDefinitionCount", null),
        DefaultListableBeanFactory.class));
    assertFalse(withinBeansPc.matches(String.class));
    assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", null),
        OtherIOther.class));
  }
 
  public void testFriendlyErrorOnNoLocationClassMatching() {
    AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
View Full Code Here

  }
 
  public void testFriendlyErrorOnNoLocationClassMatching() {
    AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
    try {
      pc.matches(ITestBean.class);
      fail();
    }
    catch (IllegalStateException ex) {
      assertTrue(ex.getMessage().indexOf("expression") != -1);
    }
View Full Code Here

  }
 
  public void testFriendlyErrorOnNoLocation2ArgMatching() {
    AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
    try {
      pc.matches(getAge, ITestBean.class);
      fail();
    }
    catch (IllegalStateException ex) {
      assertTrue(ex.getMessage().indexOf("expression") != -1);
    }
View Full Code Here

  }
 
  public void testFriendlyErrorOnNoLocation3ArgMatching() {
    AspectJExpressionPointcut pc = new AspectJExpressionPointcut();
    try {
      pc.matches(getAge, ITestBean.class, (Object[]) null);
      fail();
    }
    catch (IllegalStateException ex) {
      assertTrue(ex.getMessage().indexOf("expression") != -1);
    }
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.