Browse Source

polishing .aop tests

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@494 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Chris Beams 17 years ago
parent
commit
e355a8059e
  1. 23
      org.springframework.aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java
  2. 3
      org.springframework.aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java
  3. 3
      org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java
  4. 3
      org.springframework.aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java
  5. 4
      org.springframework.aop/src/test/java/org/springframework/aop/target/hotSwapTests.xml
  6. 4
      org.springframework.aop/src/test/java/org/springframework/aop/target/prototypeTests.xml
  7. 2
      org.springframework.aop/src/test/java/org/springframework/aop/target/threadLocalTests.xml
  8. 2
      org.springframework.aop/src/test/java/test/annotation/EmptySpringAnnotation.java
  9. 2
      org.springframework.aop/src/test/java/test/annotation/transaction/Tx.java
  10. 2
      org.springframework.aop/src/test/java/test/beans/SideEffectBean.java

23
org.springframework.aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java

@ -28,8 +28,9 @@ import org.junit.Before; @@ -28,8 +28,9 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.TestBean;
import example.annotations.EmptySpringAnnotation;
import example.annotations.transaction.Tx;
import test.annotation.EmptySpringAnnotation;
import test.annotation.transaction.Tx;
/**
* Java5-specific AspectJExpressionPointcutTests.
@ -117,26 +118,26 @@ public class TigerAspectJExpressionPointcutTests { @@ -117,26 +118,26 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testMatchAnnotationOnClassWithAtWithin() throws SecurityException, NoSuchMethodException {
String expression = "@within(example.annotations.transaction.Tx)";
String expression = "@within(test.annotation.transaction.Tx)";
testMatchAnnotationOnClass(expression);
}
@Test
public void testMatchAnnotationOnClassWithoutBinding() throws SecurityException, NoSuchMethodException {
String expression = "within(@example.annotations.transaction.Tx *)";
String expression = "within(@test.annotation.transaction.Tx *)";
testMatchAnnotationOnClass(expression);
}
@Test
public void testMatchAnnotationOnClassWithSubpackageWildcard() throws SecurityException, NoSuchMethodException {
String expression = "within(@(example.annotations..*) *)";
String expression = "within(@(test.annotation..*) *)";
AspectJExpressionPointcut springAnnotatedPc = testMatchAnnotationOnClass(expression);
assertFalse(springAnnotatedPc.matches(TestBean.class.getMethod("setName", String.class),
TestBean.class));
assertTrue(springAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
SpringAnnotated.class));
expression = "within(@(example.annotations.transaction..*) *)";
expression = "within(@(test.annotation.transaction..*) *)";
AspectJExpressionPointcut springTxAnnotatedPc = testMatchAnnotationOnClass(expression);
assertFalse(springTxAnnotatedPc.matches(SpringAnnotated.class.getMethod("foo", (Class[]) null),
SpringAnnotated.class));
@ -144,7 +145,7 @@ public class TigerAspectJExpressionPointcutTests { @@ -144,7 +145,7 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testMatchAnnotationOnClassWithExactPackageWildcard() throws SecurityException, NoSuchMethodException {
String expression = "within(@(example.annotations.transaction.*) *)";
String expression = "within(@(test.annotation.transaction.*) *)";
testMatchAnnotationOnClass(expression);
}
@ -162,7 +163,7 @@ public class TigerAspectJExpressionPointcutTests { @@ -162,7 +163,7 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testAnnotationOnMethodWithFQN() throws SecurityException, NoSuchMethodException {
String expression = "@annotation(example.annotations.transaction.Tx)";
String expression = "@annotation(test.annotation.transaction.Tx)";
AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
ajexp.setExpression(expression);
@ -176,7 +177,7 @@ public class TigerAspectJExpressionPointcutTests { @@ -176,7 +177,7 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testAnnotationOnMethodWithWildcard() throws SecurityException, NoSuchMethodException {
String expression = "execution(@(example.annotations..*) * *(..))";
String expression = "execution(@(test.annotation..*) * *(..))";
AspectJExpressionPointcut anySpringMethodAnnotation = new AspectJExpressionPointcut();
anySpringMethodAnnotation.setExpression(expression);
@ -190,7 +191,7 @@ public class TigerAspectJExpressionPointcutTests { @@ -190,7 +191,7 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testAnnotationOnMethodArgumentsWithFQN() throws SecurityException, NoSuchMethodException {
String expression = "@args(*, example.annotations.EmptySpringAnnotation))";
String expression = "@args(*, test.annotation.EmptySpringAnnotation))";
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut();
takesSpringAnnotatedArgument2.setExpression(expression);
@ -219,7 +220,7 @@ public class TigerAspectJExpressionPointcutTests { @@ -219,7 +220,7 @@ public class TigerAspectJExpressionPointcutTests {
@Test
public void testAnnotationOnMethodArgumentsWithWildcards() throws SecurityException, NoSuchMethodException {
String expression = "execution(* *(*, @(example..*) *))";
String expression = "execution(* *(*, @(test..*) *))";
AspectJExpressionPointcut takesSpringAnnotatedArgument2 = new AspectJExpressionPointcut();
takesSpringAnnotatedArgument2.setExpression(expression);

3
org.springframework.aop/src/test/java/org/springframework/aop/target/HotSwappableTargetSourceTests.java

@ -31,7 +31,8 @@ import org.springframework.beans.factory.xml.XmlBeanFactory; @@ -31,7 +31,8 @@ import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.SerializationTestUtils;
import common.beans.core.SideEffectBean;
import test.beans.SideEffectBean;
/**
* @author Rod Johnson

3
org.springframework.aop/src/test/java/org/springframework/aop/target/PrototypeTargetSourceTests.java

@ -24,7 +24,8 @@ import org.springframework.beans.factory.BeanFactory; @@ -24,7 +24,8 @@ import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import common.beans.core.SideEffectBean;
import test.beans.SideEffectBean;
/**
* @author Rod Johnson

3
org.springframework.aop/src/test/java/org/springframework/aop/target/ThreadLocalTargetSourceTests.java

@ -24,7 +24,8 @@ import org.springframework.beans.ITestBean; @@ -24,7 +24,8 @@ import org.springframework.beans.ITestBean;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import common.beans.core.SideEffectBean;
import test.beans.SideEffectBean;
/**
* @author Rod Johnson

4
org.springframework.aop/src/test/java/org/springframework/aop/target/hotSwapTests.xml

@ -4,11 +4,11 @@ @@ -4,11 +4,11 @@
<beans>
<!-- Simple target -->
<bean id="target1" class="common.beans.core.SideEffectBean">
<bean id="target1" class="test.beans.SideEffectBean">
<property name="count"><value>10</value></property>
</bean>
<bean id="target2" class="common.beans.core.SideEffectBean" scope="singleton">
<bean id="target2" class="test.beans.SideEffectBean" scope="singleton">
<property name="count"><value>20</value></property>
</bean>

4
org.springframework.aop/src/test/java/org/springframework/aop/target/prototypeTests.xml

@ -4,11 +4,11 @@ @@ -4,11 +4,11 @@
<beans>
<!-- Simple target -->
<bean id="test" class="common.beans.core.SideEffectBean">
<bean id="test" class="test.beans.SideEffectBean">
<property name="count"><value>10</value></property>
</bean>
<bean id="prototypeTest" class="common.beans.core.SideEffectBean" scope="prototype">
<bean id="prototypeTest" class="test.beans.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property>
</bean>

2
org.springframework.aop/src/test/java/org/springframework/aop/target/threadLocalTests.xml

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
<beans>
<bean id="prototypeTest" class="common.beans.core.SideEffectBean" scope="prototype">
<bean id="prototypeTest" class="test.beans.SideEffectBean" scope="prototype">
<property name="count"><value>10</value></property>
</bean>

2
org.springframework.aop/src/test/java/example/annotations/EmptySpringAnnotation.java → org.springframework.aop/src/test/java/test/annotation/EmptySpringAnnotation.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package example.annotations;
package test.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

2
org.springframework.aop/src/test/java/example/annotations/transaction/Tx.java → org.springframework.aop/src/test/java/test/annotation/transaction/Tx.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package example.annotations.transaction;
package test.annotation.transaction;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

2
org.springframework.aop/src/test/java/common/beans/core/SideEffectBean.java → org.springframework.aop/src/test/java/test/beans/SideEffectBean.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package common.beans.core;
package test.beans;
/**
* Bean that changes state on a business invocation, so that
Loading…
Cancel
Save