final polish on .testsuite .aop.aspectj tests prior to migration to .context

This commit is contained in:
Chris Beams 2008-12-19 03:10:43 +00:00
parent 81efa4d23c
commit b6906ecfb7
4 changed files with 70 additions and 87 deletions

View File

@ -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;
/**

View File

@ -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;
}
}

View File

@ -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();
}

View File

@ -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;
}
}