Author: mbenson Date: Tue Sep 3 17:26:09 2013 New Revision: 1519761 URL: http://svn.apache.org/r1519761 Log: fix method access in Trainer APIs
Modified: commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java Modified: commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java?rev=1519761&r1=1519760&r2=1519761&view=diff ============================================================================== --- commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java (original) +++ commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseAnnotationTrainer.java Tue Sep 3 17:26:09 2013 @@ -33,14 +33,14 @@ public abstract class BaseAnnotationTrai 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))); Modified: commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java?rev=1519761&r1=1519760&r2=1519761&view=diff ============================================================================== --- commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java (original) +++ commons/proper/proxy/branches/version-2.0-work/stub/src/main/java/org/apache/commons/proxy2/stub/BaseTrainer.java Tue Sep 3 17:26:09 2013 @@ -178,19 +178,19 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte */ 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 @@ public abstract class BaseTrainer<S exte 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 @@ public abstract class BaseTrainer<S exte 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();