@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Chris Beams
* @author Yanming Zhou
* /
public class AspectJExpressionPointcutTests {
class AspectJExpressionPointcutTests {
public static final String MATCH_ALL_METHODS = "execution(* *(..))" ;
@ -78,7 +78,7 @@ public class AspectJExpressionPointcutTests {
@@ -78,7 +78,7 @@ public class AspectJExpressionPointcutTests {
@Test
public void testMatchExplicit ( ) {
void testMatchExplicit ( ) {
String expression = "execution(int org.springframework.beans.testfixture.beans.TestBean.getAge())" ;
Pointcut pointcut = getPointcut ( expression ) ;
@ -96,7 +96,7 @@ public class AspectJExpressionPointcutTests {
@@ -96,7 +96,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testMatchWithTypePattern ( ) throws Exception {
void testMatchWithTypePattern ( ) {
String expression = "execution(* *..TestBean.*Age(..))" ;
Pointcut pointcut = getPointcut ( expression ) ;
@ -115,12 +115,12 @@ public class AspectJExpressionPointcutTests {
@@ -115,12 +115,12 @@ public class AspectJExpressionPointcutTests {
@Test
public void testThis ( ) throws SecurityException , NoSuchMethodException {
void testThis ( ) throws SecurityException , NoSuchMethodException {
testThisOrTarget ( "this" ) ;
}
@Test
public void testTarget ( ) throws SecurityException , NoSuchMethodException {
void testTarget ( ) throws SecurityException , NoSuchMethodException {
testThisOrTarget ( "target" ) ;
}
@ -144,12 +144,12 @@ public class AspectJExpressionPointcutTests {
@@ -144,12 +144,12 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testWithinRootPackage ( ) throws SecurityException , NoSuchMethodException {
void testWithinRootPackage ( ) throws SecurityException , NoSuchMethodException {
testWithinPackage ( false ) ;
}
@Test
public void testWithinRootAndSubpackages ( ) throws SecurityException , NoSuchMethodException {
void testWithinRootAndSubpackages ( ) throws SecurityException , NoSuchMethodException {
testWithinPackage ( true ) ;
}
@ -173,7 +173,7 @@ public class AspectJExpressionPointcutTests {
@@ -173,7 +173,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testFriendlyErrorOnNoLocationClassMatching ( ) {
void testFriendlyErrorOnNoLocationClassMatching ( ) {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut ( ) ;
assertThatIllegalStateException ( ) . isThrownBy ( ( ) - >
pc . matches ( ITestBean . class ) )
@ -181,7 +181,7 @@ public class AspectJExpressionPointcutTests {
@@ -181,7 +181,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testFriendlyErrorOnNoLocation2ArgMatching ( ) {
void testFriendlyErrorOnNoLocation2ArgMatching ( ) {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut ( ) ;
assertThatIllegalStateException ( ) . isThrownBy ( ( ) - >
pc . matches ( getAge , ITestBean . class ) )
@ -189,7 +189,7 @@ public class AspectJExpressionPointcutTests {
@@ -189,7 +189,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testFriendlyErrorOnNoLocation3ArgMatching ( ) {
void testFriendlyErrorOnNoLocation3ArgMatching ( ) {
AspectJExpressionPointcut pc = new AspectJExpressionPointcut ( ) ;
assertThatIllegalStateException ( ) . isThrownBy ( ( ) - >
pc . matches ( getAge , ITestBean . class , ( Object [ ] ) null ) )
@ -198,7 +198,7 @@ public class AspectJExpressionPointcutTests {
@@ -198,7 +198,7 @@ public class AspectJExpressionPointcutTests {
@Test
public void testMatchWithArgs ( ) throws Exception {
void testMatchWithArgs ( ) throws Exception {
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)" ;
Pointcut pointcut = getPointcut ( expression ) ;
@ -217,7 +217,7 @@ public class AspectJExpressionPointcutTests {
@@ -217,7 +217,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testSimpleAdvice ( ) {
void testSimpleAdvice ( ) {
String expression = "execution(int org.springframework.beans.testfixture.beans.TestBean.getAge())" ;
CallCountingInterceptor interceptor = new CallCountingInterceptor ( ) ;
TestBean testBean = getAdvisedProxy ( expression , interceptor ) ;
@ -230,7 +230,7 @@ public class AspectJExpressionPointcutTests {
@@ -230,7 +230,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testDynamicMatchingProxy ( ) {
void testDynamicMatchingProxy ( ) {
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number)) && args(Double)" ;
CallCountingInterceptor interceptor = new CallCountingInterceptor ( ) ;
TestBean testBean = getAdvisedProxy ( expression , interceptor ) ;
@ -244,7 +244,7 @@ public class AspectJExpressionPointcutTests {
@@ -244,7 +244,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testInvalidExpression ( ) {
void testInvalidExpression ( ) {
String expression = "execution(void org.springframework.beans.testfixture.beans.TestBean.setSomeNumber(Number) && args(Double)" ;
assertThatIllegalArgumentException ( ) . isThrownBy ( getPointcut ( expression ) : : getClassFilter ) ; // call to getClassFilter forces resolution
}
@ -274,7 +274,7 @@ public class AspectJExpressionPointcutTests {
@@ -274,7 +274,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testWithUnsupportedPointcutPrimitive ( ) {
void testWithUnsupportedPointcutPrimitive ( ) {
String expression = "call(int org.springframework.beans.testfixture.beans.TestBean.getAge())" ;
assertThatExceptionOfType ( UnsupportedPointcutPrimitiveException . class )
. isThrownBy ( ( ) - > getPointcut ( expression ) . getClassFilter ( ) ) // call to getClassFilter forces resolution...
@ -282,14 +282,14 @@ public class AspectJExpressionPointcutTests {
@@ -282,14 +282,14 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAndSubstitution ( ) {
void testAndSubstitution ( ) {
AspectJExpressionPointcut pc = getPointcut ( "execution(* *(..)) and args(String)" ) ;
String expr = pc . getPointcutExpression ( ) . getPointcutExpression ( ) ;
assertThat ( expr ) . isEqualTo ( "execution(* *(..)) && args(String)" ) ;
}
@Test
public void testMultipleAndSubstitutions ( ) {
void testMultipleAndSubstitutions ( ) {
AspectJExpressionPointcut pc = getPointcut ( "execution(* *(..)) and args(String) and this(Object)" ) ;
String expr = pc . getPointcutExpression ( ) . getPointcutExpression ( ) ;
assertThat ( expr ) . isEqualTo ( "execution(* *(..)) && args(String) && this(Object)" ) ;
@ -302,7 +302,7 @@ public class AspectJExpressionPointcutTests {
@@ -302,7 +302,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testMatchGenericArgument ( ) {
void testMatchGenericArgument ( ) {
String expression = "execution(* set*(java.util.List<org.springframework.beans.testfixture.beans.TestBean>) )" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -321,7 +321,7 @@ public class AspectJExpressionPointcutTests {
@@ -321,7 +321,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testMatchVarargs ( ) throws Exception {
void testMatchVarargs ( ) throws Exception {
@SuppressWarnings ( "unused" )
class MyTemplate {
@ -347,19 +347,19 @@ public class AspectJExpressionPointcutTests {
@@ -347,19 +347,19 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testMatchAnnotationOnClassWithAtWithin ( ) throws Exception {
void testMatchAnnotationOnClassWithAtWithin ( ) throws Exception {
String expression = "@within(test.annotation.transaction.Tx)" ;
testMatchAnnotationOnClass ( expression ) ;
}
@Test
public void testMatchAnnotationOnClassWithoutBinding ( ) throws Exception {
void testMatchAnnotationOnClassWithoutBinding ( ) throws Exception {
String expression = "within(@test.annotation.transaction.Tx *)" ;
testMatchAnnotationOnClass ( expression ) ;
}
@Test
public void testMatchAnnotationOnClassWithSubpackageWildcard ( ) throws Exception {
void testMatchAnnotationOnClassWithSubpackageWildcard ( ) throws Exception {
String expression = "within(@(test.annotation..*) *)" ;
AspectJExpressionPointcut springAnnotatedPc = testMatchAnnotationOnClass ( expression ) ;
assertThat ( springAnnotatedPc . matches ( TestBean . class . getMethod ( "setName" , String . class ) , TestBean . class ) ) . isFalse ( ) ;
@ -371,7 +371,7 @@ public class AspectJExpressionPointcutTests {
@@ -371,7 +371,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testMatchAnnotationOnClassWithExactPackageWildcard ( ) throws Exception {
void testMatchAnnotationOnClassWithExactPackageWildcard ( ) throws Exception {
String expression = "within(@(test.annotation.transaction.*) *)" ;
testMatchAnnotationOnClass ( expression ) ;
}
@ -389,7 +389,7 @@ public class AspectJExpressionPointcutTests {
@@ -389,7 +389,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnMethodWithFQN ( ) throws Exception {
void testAnnotationOnMethodWithFQN ( ) throws Exception {
String expression = "@annotation(test.annotation.transaction.Tx)" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -403,7 +403,7 @@ public class AspectJExpressionPointcutTests {
@@ -403,7 +403,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnCglibProxyMethod ( ) throws Exception {
void testAnnotationOnCglibProxyMethod ( ) throws Exception {
String expression = "@annotation(test.annotation.transaction.Tx)" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -416,7 +416,7 @@ public class AspectJExpressionPointcutTests {
@@ -416,7 +416,7 @@ public class AspectJExpressionPointcutTests {
@Test
public void testNotAnnotationOnCglibProxyMethod ( ) throws Exception {
void testNotAnnotationOnCglibProxyMethod ( ) throws Exception {
String expression = "!@annotation(test.annotation.transaction.Tx)" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -428,7 +428,7 @@ public class AspectJExpressionPointcutTests {
@@ -428,7 +428,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnDynamicProxyMethod ( ) throws Exception {
void testAnnotationOnDynamicProxyMethod ( ) throws Exception {
String expression = "@annotation(test.annotation.transaction.Tx)" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -440,7 +440,7 @@ public class AspectJExpressionPointcutTests {
@@ -440,7 +440,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testNotAnnotationOnDynamicProxyMethod ( ) throws Exception {
void testNotAnnotationOnDynamicProxyMethod ( ) throws Exception {
String expression = "!@annotation(test.annotation.transaction.Tx)" ;
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut ( ) ;
ajexp . setExpression ( expression ) ;
@ -452,7 +452,7 @@ public class AspectJExpressionPointcutTests {
@@ -452,7 +452,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnMethodWithWildcard ( ) throws Exception {
void testAnnotationOnMethodWithWildcard ( ) throws Exception {
String expression = "execution(@(test.annotation..*) * *(..))" ;
AspectJExpressionPointcut anySpringMethodAnnotation = new AspectJExpressionPointcut ( ) ;
anySpringMethodAnnotation . setExpression ( expression ) ;
@ -468,7 +468,7 @@ public class AspectJExpressionPointcutTests {
@@ -468,7 +468,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnMethodArgumentsWithFQN ( ) throws Exception {
void testAnnotationOnMethodArgumentsWithFQN ( ) throws Exception {
String expression = "@args(*, test.annotation.EmptySpringAnnotation))" ;
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut ( ) ;
takesSpringAnnotatedArgument2 . setExpression ( expression ) ;
@ -497,7 +497,7 @@ public class AspectJExpressionPointcutTests {
@@ -497,7 +497,7 @@ public class AspectJExpressionPointcutTests {
}
@Test
public void testAnnotationOnMethodArgumentsWithWildcards ( ) throws Exception {
void testAnnotationOnMethodArgumentsWithWildcards ( ) throws Exception {
String expression = "execution(* *(*, @(test..*) *))" ;
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut ( ) ;
takesSpringAnnotatedArgument2 . setExpression ( expression ) ;