fix method access in Trainer APIs
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/proxy/branches/version-2.0-work@1519761 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java b/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java
index 5663b15..881a741 100644
--- a/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java
+++ b/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java
@@ -33,14 +33,14 @@
protected class WhenAnnotation<R> extends WhenObject<R>
{
- protected S thenStub(Class<R> type) {
+ public S thenStub(Class<R> type) {
trainingContext().push(type);
trainingContext().then(InterceptorUtils.constant(trainingContext().pop(AnnotationInvoker.INSTANCE)));
return self();
}
@Override
- protected S thenStub(BaseTrainer<?, R> trainer) {
+ public S thenStub(BaseTrainer<?, R> trainer) {
final R trainee = trainingContext().push(trainer.traineeType);
trainer.train(trainee);
trainingContext().then(InterceptorUtils.constant(trainingContext().pop(AnnotationInvoker.INSTANCE)));
diff --git a/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java b/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java
index 0a3da5e..5656355 100644
--- a/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java
+++ b/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java
@@ -178,19 +178,19 @@
protected abstract class BaseWhen<R>
{
- protected S thenThrow(Exception e)
+ public S thenThrow(Exception e)
{
trainingContext().then(InterceptorUtils.throwing(e));
return self();
}
- protected S thenThrow(ObjectProvider<? extends Exception> provider)
+ public S thenThrow(ObjectProvider<? extends Exception> provider)
{
trainingContext().then(InterceptorUtils.throwing(provider));
return self();
}
- protected S thenAnswer(ObjectProvider<? extends R> provider)
+ public S thenAnswer(ObjectProvider<? extends R> provider)
{
trainingContext().then(InterceptorUtils.provider(provider));
return self();
@@ -199,7 +199,7 @@
protected class WhenBooleanArray extends BaseWhen<boolean[]>
{
- protected S thenReturn(boolean... values)
+ public S thenReturn(boolean... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -208,7 +208,7 @@
protected class WhenByteArray extends BaseWhen<byte[]>
{
- protected S thenReturn(byte... values)
+ public S thenReturn(byte... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -217,7 +217,7 @@
protected class WhenCharArray extends BaseWhen<char[]>
{
- protected S thenReturn(char... values)
+ public S thenReturn(char... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -226,7 +226,7 @@
protected class WhenDoubleArray extends BaseWhen<double[]>
{
- protected S thenReturn(double... values)
+ public S thenReturn(double... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -235,7 +235,7 @@
protected class WhenFloatArray extends BaseWhen<float[]>
{
- protected S thenReturn(float... values)
+ public S thenReturn(float... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -244,7 +244,7 @@
protected class WhenIntArray extends BaseWhen<int[]>
{
- protected S thenReturn(int... values)
+ public S thenReturn(int... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -253,7 +253,7 @@
protected class WhenLongArray extends BaseWhen<long[]>
{
- protected S thenReturn(long... values)
+ public S thenReturn(long... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -262,13 +262,13 @@
protected class WhenObject<R> extends BaseWhen<R>
{
- protected S thenReturn(R value)
+ public S thenReturn(R value)
{
trainingContext().then(InterceptorUtils.constant(value));
return self();
}
- protected S thenStub(BaseTrainer<?, R> trainer)
+ public S thenStub(BaseTrainer<?, R> trainer)
{
final R trainee = trainingContext().push(trainer.traineeType);
trainer.train(trainee);
@@ -284,7 +284,7 @@
*/
protected class WhenClass extends BaseWhen<Class<?>>
{
- protected S thenReturn(Class<?> value)
+ public S thenReturn(Class<?> value)
{
trainingContext().then(InterceptorUtils.constant(value));
return self();
@@ -293,7 +293,7 @@
protected class WhenObjectArray<R> extends BaseWhen<R[]>
{
- protected S thenReturn(R... values)
+ public S thenReturn(R... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();
@@ -302,7 +302,7 @@
protected class WhenShortArray extends BaseWhen<short[]>
{
- protected S thenReturn(short... values)
+ public S thenReturn(short... values)
{
trainingContext().then(InterceptorUtils.constant(ArrayUtils.clone(values)));
return self();