You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2014/01/03 00:19:27 UTC
svn commit: r1554959 -
/commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java
Author: mbenson
Date: Thu Jan 2 23:19:27 2014
New Revision: 1554959
URL: http://svn.apache.org/r1554959
Log:
format
Modified:
commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java
Modified: commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java?rev=1554959&r1=1554958&r2=1554959&view=diff
==============================================================================
--- commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java (original)
+++ commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy2/stub/AnnotationBuilderTest.java Thu Jan 2 23:19:27 2014
@@ -46,16 +46,17 @@ public class AnnotationBuilderTest
@Test
public void testStubbedAnnotation()
{
- final CustomAnnotation customAnnotation =
- AnnotationBuilder.of(CustomAnnotation.class).train(new AnnotationTrainer<CustomAnnotation>()
- {
- @Override
- protected void train(CustomAnnotation trainee)
+ final CustomAnnotation customAnnotation = AnnotationBuilder.of(CustomAnnotation.class)
+ .train(new AnnotationTrainer<CustomAnnotation>()
{
- when(trainee.someType()).thenReturn(Object.class).when(trainee.finiteValues())
- .thenReturn(FiniteValues.ONE, FiniteValues.THREE).when(trainee.annString()).thenReturn("hey");
- }
- }).build();
+ @Override
+ protected void train(CustomAnnotation trainee)
+ {
+ when(trainee.someType()).thenReturn(Object.class).when(trainee.finiteValues())
+ .thenReturn(FiniteValues.ONE, FiniteValues.THREE).when(trainee.annString())
+ .thenReturn("hey");
+ }
+ }).build();
assertEquals(CustomAnnotation.class, customAnnotation.annotationType());
assertEquals("hey", customAnnotation.annString());
@@ -66,16 +67,16 @@ public class AnnotationBuilderTest
@Test
public void testNestedStubbedAnnotation()
{
- final NestingAnnotation nestingAnnotation =
- AnnotationBuilder.of(NestingAnnotation.class).train(new AnnotationTrainer<NestingAnnotation>()
- {
- @Override
- protected void train(NestingAnnotation trainee)
+ final NestingAnnotation nestingAnnotation = AnnotationBuilder.of(NestingAnnotation.class)
+ .train(new AnnotationTrainer<NestingAnnotation>()
{
- when(trainee.child()).thenStub(CustomAnnotation.class).when(trainee.somethingElse())
- .thenReturn("somethingElse");
- }
- }).build();
+ @Override
+ protected void train(NestingAnnotation trainee)
+ {
+ when(trainee.child()).thenStub(CustomAnnotation.class).when(trainee.somethingElse())
+ .thenReturn("somethingElse");
+ }
+ }).build();
assertEquals("", nestingAnnotation.child().annString());
assertEquals(0, nestingAnnotation.child().finiteValues().length);
@@ -91,8 +92,9 @@ public class AnnotationBuilderTest
members.put("finiteValues", FiniteValues.values());
members.put("someType", Object.class);
- final CustomAnnotation customAnnotation = AnnotationBuilder.of(CustomAnnotation.class).withMembers(members).build();
-
+ final CustomAnnotation customAnnotation = AnnotationBuilder.of(CustomAnnotation.class).withMembers(members)
+ .build();
+
assertNotNull(customAnnotation);
assertEquals(CustomAnnotation.class, customAnnotation.annotationType());
assertEquals("foo", customAnnotation.annString());
@@ -103,7 +105,8 @@ public class AnnotationBuilderTest
@Test(expected = IllegalArgumentException.class)
public void testBadMemberMap()
{
- AnnotationBuilder.of(CustomAnnotation.class).withMembers(Collections.singletonMap("annString", Integer.valueOf(100)));
+ AnnotationBuilder.of(CustomAnnotation.class).withMembers(
+ Collections.singletonMap("annString", Integer.valueOf(100)));
}
public @interface NestingAnnotation