final polish on .testsuite .aop.aspectj tests prior to migration to .context
This commit is contained in:
parent
81efa4d23c
commit
b6906ecfb7
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue