moved ApplicationContext-dependent .aop.* unit tests from .testsuite -> .context

in the process, identified and refactored two genuine integration tests (AopNamespaceHandlerScopeIntegrationTests, AdvisorAutoProxyCreatorIntegrationTests), which will remain in .testsuite due to broad-ranging dependencies
This commit is contained in:
Chris Beams
2008-12-19 21:58:42 +00:00
parent 2d37eb722b
commit be53a80657
137 changed files with 703 additions and 345 deletions

View File

@@ -1,24 +0,0 @@
/**
*
*/
package example.aspects;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
@Aspect
public class TwoAdviceAspect {
private int totalCalls;
@Around("execution(* getAge())")
public int returnCallCount(ProceedingJoinPoint pjp) throws Exception {
return totalCalls;
}
@Before("execution(* setAge(int)) && args(newAge)")
public void countSet(int newAge) throws Exception {
++totalCalls;
}
}

View File

@@ -49,8 +49,9 @@ import org.springframework.core.OrderComparator;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import example.aspects.PerTargetAspect;
import example.aspects.TwoAdviceAspect;
import test.aspect.PerTargetAspect;
import test.aspect.TwoAdviceAspect;
/**
* Abstract tests for AspectJAdvisorFactory.

View File

@@ -25,7 +25,8 @@ import org.springframework.aop.aspectj.AspectJExpressionPointcutTests;
import org.springframework.aop.framework.AopConfigException;
import org.springframework.beans.TestBean;
import example.aspects.PerTargetAspect;
import test.aspect.PerTargetAspect;
/**
* @author Rod Johnson

View File

@@ -23,7 +23,8 @@ import org.junit.Test;
import org.springframework.aop.Pointcut;
import org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactoryTests.ExceptionAspect;
import example.aspects.PerTargetAspect;
import test.aspect.PerTargetAspect;
/**
* @since 2.0

View File

@@ -21,7 +21,8 @@ import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.aop.aspectj.autoproxy.MultiplyReturnValue;
import example.aspects.PerThisAspect;
import test.aspect.PerThisAspect;
/**
* @author Rob Harrop

View File

@@ -1,7 +1,7 @@
/**
*
*/
package example.aspects;
package test.aspect;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package example.aspects;
package test.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;

View File

@@ -0,0 +1,37 @@
/*
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
@Aspect
public class TwoAdviceAspect {
private int totalCalls;
@Around("execution(* getAge())")
public int returnCallCount(ProceedingJoinPoint pjp) throws Exception {
return totalCalls;
}
@Before("execution(* setAge(int)) && args(newAge)")
public void countSet(int newAge) throws Exception {
++totalCalls;
}
}