diff --git a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java index 5a7e713cbe0..adabfcc5ea2 100644 --- a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java +++ b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/BeforeAdviceBindingTests.java @@ -26,7 +26,6 @@ import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils; import org.springframework.beans.ITestBean; import org.springframework.beans.TestBean; -import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; /** diff --git a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/Counter.java b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/Counter.java deleted file mode 100644 index dc5b652fa47..00000000000 --- a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/Counter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2002-2006 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 org.springframework.aop.aspectj; - -/** - * A simple counter for use in simple tests (for example, how many times an advice was executed) - * - * @author Ramnivas Laddad - */ -final class Counter implements ICounter { - - private int count; - - public Counter() { - } - - public void increment() { - count++; - } - - public void decrement() { - count--; - } - - public int getCount() { - return count; - } - - public void setCount(int counter) { - this.count = counter; - } - - public void reset() { - this.count = 0; - } -} diff --git a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/ICounter.java b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/ICounter.java deleted file mode 100644 index e554acfe692..00000000000 --- a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/ICounter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2002-2006 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 org.springframework.aop.aspectj; - -/** - * @author Ramnivas Laddad - */ -interface ICounter { - - void increment(); - - void decrement(); - - int getCount(); - - void setCount(int counter); - - void reset(); - -} diff --git a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/AdviceBindingTestAspect.java b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/_TestTypes.java similarity index 60% rename from org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/AdviceBindingTestAspect.java rename to org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/_TestTypes.java index 393f7d755fc..c8150a7500d 100644 --- a/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/AdviceBindingTestAspect.java +++ b/org.springframework.testsuite/src/test/java/org/springframework/aop/aspectj/_TestTypes.java @@ -1,3 +1,4 @@ +package org.springframework.aop.aspectj; /* * Copyright 2002-2006 the original author or authors. * @@ -14,10 +15,25 @@ * limitations under the License. */ -package org.springframework.aop.aspectj; - import org.aspectj.lang.JoinPoint; +/** + * Definitions of testing types for use in within this package. + * Wherever possible, test types should be defined local to the java + * file that makes use of them. In some cases however, a test type may + * need to be shared across tests. Such types reside here, with the + * intention of reducing the surface area of java files within this + * package. This allows developers to think about tests first, and deal + * with these second class testing artifacts on an as-needed basis. + * + * Types here should be defined as package-private top level classes in + * order to avoid needing to fully qualify, e.g.: _TestTypes$Foo. + * + * @author Chris Beams + */ +final class _TestTypes { } + + /** * Aspect used as part of before before advice binding tests and * serves as base class for a number of more specialized test aspects. @@ -69,3 +85,55 @@ class AdviceBindingTestAspect { } } + + +/** + * @author Ramnivas Laddad + */ +interface ICounter { + + void increment(); + + void decrement(); + + int getCount(); + + void setCount(int counter); + + void reset(); + +} + + +/** + * A simple counter for use in simple tests (for example, how many times an advice was executed) + * + * @author Ramnivas Laddad + */ +final class Counter implements ICounter { + + private int count; + + public Counter() { + } + + public void increment() { + count++; + } + + public void decrement() { + count--; + } + + public int getCount() { + return count; + } + + public void setCount(int counter) { + this.count = counter; + } + + public void reset() { + this.count = 0; + } +}