isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1049995 [5/5] - in /incubator/isis/trunk/applib/src: main/java/org/apache/isis/applib/ main/java/org/apache/isis/applib/adapters/ main/java/org/apache/isis/applib/annotation/ main/java/org/apache/isis/applib/clock/ main/java/org/apache/isi...
Date Thu, 16 Dec 2010 14:55:56 GMT
Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/IdentifierTests.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/IdentifierTests.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/IdentifierTests.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/IdentifierTests.java
Thu Dec 16 14:55:52 2010
@@ -17,47 +17,44 @@
  *  under the License.
  */
 
+package org.apache.isis.applib;
 
-package org.apache.isis.applib;
-
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.apache.isis.applib.Identifier;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-
-@RunWith(JMock.class)
-public class IdentifierTests {
-
-    @SuppressWarnings("unused")
-	private final Mockery mockery = new JUnit4Mockery();
-
-    private Identifier identifier;
-
-    @Before
-    public void setUp() {
-    }
-
-    @Test
-    public void canInstantiateClassIdentifier() {
-        identifier = Identifier.classIdentifier(SomeDomainClass.class);
-        assertThat(identifier, is(not(nullValue())));
-    }
-
-    @Test
-    public void classIdentifierClassNameIsSet() {
-        Class<?> domainClass = SomeDomainClass.class;
-        String domainClassFullyQualifiedName = domainClass.getCanonicalName();
-        identifier = Identifier.classIdentifier(domainClass);
-        assertThat(identifier.getClassName(), is(domainClassFullyQualifiedName));
-    }
-
-}
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(JMock.class)
+public class IdentifierTests {
+
+    @SuppressWarnings("unused")
+    private final Mockery mockery = new JUnit4Mockery();
+
+    private Identifier identifier;
+
+    @Before
+    public void setUp() {
+    }
+
+    @Test
+    public void canInstantiateClassIdentifier() {
+        identifier = Identifier.classIdentifier(SomeDomainClass.class);
+        assertThat(identifier, is(not(nullValue())));
+    }
+
+    @Test
+    public void classIdentifierClassNameIsSet() {
+        final Class<?> domainClass = SomeDomainClass.class;
+        final String domainClassFullyQualifiedName = domainClass.getCanonicalName();
+        identifier = Identifier.classIdentifier(domainClass);
+        assertThat(identifier.getClassName(), is(domainClassFullyQualifiedName));
+    }
+
+}

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/SomeDomainClass.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/SomeDomainClass.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/SomeDomainClass.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/SomeDomainClass.java
Thu Dec 16 14:55:52 2010
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.applib;
 
-package org.apache.isis.applib;
-
-public class SomeDomainClass {
-
-}
+public class SomeDomainClass {
+
+}

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/TestDomainObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/TestDomainObject.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/TestDomainObject.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/TestDomainObject.java
Thu Dec 16 14:55:52 2010
@@ -17,11 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib;
 
 public class TestDomainObject {
 
 }
-
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/events/InteractionEventTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/events/InteractionEventTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/events/InteractionEventTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/events/InteractionEventTest.java
Thu Dec 16 14:55:52 2010
@@ -17,135 +17,134 @@
  *  under the License.
  */
 
+package org.apache.isis.applib.events;
 
-package org.apache.isis.applib.events;
-
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.events.InteractionEvent;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
-
-@RunWith(JMock.class)
-public class InteractionEventTest {
-
-    @SuppressWarnings("unused")
-	private final Mockery mockery = new JUnit4Mockery();
-
-    private InteractionEvent interactionEvent;
-
-    private Object source;
-    private Identifier identifier;
-
-    private Class<? extends InteractionEventTest> advisorClass;
-
-    @Before
-    public void setUp() {
-        source = new Object();
-        identifier = Identifier.actionIdentifier("CustomerOrder", "cancelOrder", new Class[]
{ String.class, boolean.class });
-        advisorClass = this.getClass();
-    }
-
-    @Test
-    public void getIdentifier() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getIdentifier(), is(identifier));
-    }
-
-    @Test
-    public void getSource() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getSource(), is(source));
-    }
-
-    @Test
-    public void getClassName() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getClassName(), equalTo("CustomerOrder"));
-    }
-
-    @Test
-    public void getClassNaturalName() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getClassNaturalName(), equalTo("Customer Order"));
-    }
-
-    @Test
-    public void getMember() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getMemberName(), equalTo("cancelOrder"));
-    }
-
-    @Test
-    public void getMemberNaturalName() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.getMemberNaturalName(), equalTo("Cancel Order"));
-    }
-
-    @Test
-    public void shouldInitiallyNotVeto() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        assertThat(interactionEvent.isVeto(), is(false));
-    }
-
-    @Test
-    public void afterAdvisedShouldVeto() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        interactionEvent.advised("some reason", this.getClass());
-        assertThat(interactionEvent.isVeto(), is(true));
-    }
-
-    @Test
-    public void afterAdvisedShouldReturnReason() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        interactionEvent.advised("some reason", this.getClass());
-        assertThat(interactionEvent.isVeto(), is(true));
-    }
-
-    @Test
-    public void afterAdvisedShouldReturnAdvisorClass() {
-        interactionEvent = new InteractionEvent(source, identifier) {
-
-            private static final long serialVersionUID = 1L;
-        };
-        interactionEvent.advised("some reason", advisorClass);
-        assertEquals(interactionEvent.getAdvisorClass(), advisorClass);
-    }
-
-}
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+import org.jmock.Mockery;
+import org.jmock.integration.junit4.JMock;
+import org.jmock.integration.junit4.JUnit4Mockery;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.apache.isis.applib.Identifier;
+
+@RunWith(JMock.class)
+public class InteractionEventTest {
+
+    @SuppressWarnings("unused")
+    private final Mockery mockery = new JUnit4Mockery();
+
+    private InteractionEvent interactionEvent;
+
+    private Object source;
+    private Identifier identifier;
+
+    private Class<? extends InteractionEventTest> advisorClass;
+
+    @Before
+    public void setUp() {
+        source = new Object();
+        identifier =
+            Identifier.actionIdentifier("CustomerOrder", "cancelOrder", new Class[] { String.class,
boolean.class });
+        advisorClass = this.getClass();
+    }
+
+    @Test
+    public void getIdentifier() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getIdentifier(), is(identifier));
+    }
+
+    @Test
+    public void getSource() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getSource(), is(source));
+    }
+
+    @Test
+    public void getClassName() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getClassName(), equalTo("CustomerOrder"));
+    }
+
+    @Test
+    public void getClassNaturalName() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getClassNaturalName(), equalTo("Customer Order"));
+    }
+
+    @Test
+    public void getMember() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getMemberName(), equalTo("cancelOrder"));
+    }
+
+    @Test
+    public void getMemberNaturalName() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.getMemberNaturalName(), equalTo("Cancel Order"));
+    }
+
+    @Test
+    public void shouldInitiallyNotVeto() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        assertThat(interactionEvent.isVeto(), is(false));
+    }
+
+    @Test
+    public void afterAdvisedShouldVeto() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        interactionEvent.advised("some reason", this.getClass());
+        assertThat(interactionEvent.isVeto(), is(true));
+    }
+
+    @Test
+    public void afterAdvisedShouldReturnReason() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        interactionEvent.advised("some reason", this.getClass());
+        assertThat(interactionEvent.isVeto(), is(true));
+    }
+
+    @Test
+    public void afterAdvisedShouldReturnAdvisorClass() {
+        interactionEvent = new InteractionEvent(source, identifier) {
+
+            private static final long serialVersionUID = 1L;
+        };
+        interactionEvent.advised("some reason", advisorClass);
+        assertEquals(interactionEvent.getAdvisorClass(), advisorClass);
+    }
+
+}

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/fixtures/FixtureClockInstantiationTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/fixtures/FixtureClockInstantiationTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/fixtures/FixtureClockInstantiationTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/fixtures/FixtureClockInstantiationTest.java
Thu Dec 16 14:55:52 2010
@@ -17,42 +17,41 @@
  *  under the License.
  */
 
+package org.apache.isis.applib.fixtures;
 
-package org.apache.isis.applib.fixtures;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.clock.Clock;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class FixtureClockInstantiationTest {
-
-	@Before
-	public void setUp() {
-		
-	}
-	
-	@Test
-	public void shouldSetupClockSingletonWithFixtureClockWhenInitialize() {
-		FixtureClock.initialize();
-		assertThat(Clock.getInstance(), is(FixtureClock.class));
-	}
-
-	@Test
-	public void canInitializeFixtureClockMultipleTimesButAlwaysGetTheSameFixtureClock() {
-		FixtureClock fixtureClock1 = FixtureClock.initialize();
-		FixtureClock fixtureClock2 = FixtureClock.initialize();
-		assertThat(fixtureClock1, is(fixtureClock2));
-	}
-
-	@Test
-	public void canRemoveFixtureClock() {
-		FixtureClock.initialize();
-		assertThat(FixtureClock.remove(), is(true));
-		assertThat(FixtureClock.remove(), is(false)); // already removed.
-	}
-
-
-}
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.applib.clock.Clock;
+
+public class FixtureClockInstantiationTest {
+
+    @Before
+    public void setUp() {
+
+    }
+
+    @Test
+    public void shouldSetupClockSingletonWithFixtureClockWhenInitialize() {
+        FixtureClock.initialize();
+        assertThat(Clock.getInstance(), is(FixtureClock.class));
+    }
+
+    @Test
+    public void canInitializeFixtureClockMultipleTimesButAlwaysGetTheSameFixtureClock() {
+        final FixtureClock fixtureClock1 = FixtureClock.initialize();
+        final FixtureClock fixtureClock2 = FixtureClock.initialize();
+        assertThat(fixtureClock1, is(fixtureClock2));
+    }
+
+    @Test
+    public void canRemoveFixtureClock() {
+        FixtureClock.initialize();
+        assertThat(FixtureClock.remove(), is(true));
+        assertThat(FixtureClock.remove(), is(false)); // already removed.
+    }
+
+}

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/spec/SpecificationAbstractTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/spec/SpecificationAbstractTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/spec/SpecificationAbstractTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/spec/SpecificationAbstractTest.java
Thu Dec 16 14:55:52 2010
@@ -17,76 +17,84 @@
  *  under the License.
  */
 
+package org.apache.isis.applib.spec;
 
-package org.apache.isis.applib.spec;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-
-import org.junit.Test;
-import org.apache.isis.applib.spec.AbstractSpecification.Nullability;
-import org.apache.isis.applib.spec.AbstractSpecification.TypeChecking;
-
-public class SpecificationAbstractTest {
-
-    private static class SomeDomainObject {}
-    private static class SomeOtherDomainObject {}
-    
-    private AbstractSpecification<SomeDomainObject> specAbstractSomeDomainObject;
-
-	@Test
-	public void shouldSatisfyByDefaultForNull() {
-	    specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>() {
-            @Override
-            public String satisfiesSafely(SomeDomainObject obj) {
-                return null;
-            }};
-        assertThat(specAbstractSomeDomainObject.satisfies(null), is(nullValue()));
-	}
-
-    @Test
-    public void shouldNotSatisfyForNullIfConfiguredAsSuch() {
-        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>(Nullability.ENSURE_NOT_NULL,
TypeChecking.IGNORE_INCORRECT_TYPE) {
-            @Override
-            public String satisfiesSafely(SomeDomainObject obj) {
-                return null;
-            }};
-        assertThat(specAbstractSomeDomainObject.satisfies(null), is(not(nullValue())));
-    }
-
-
-    @Test
-    public void shouldSatisfyByDefaultForIncorrectType() {
-        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>()
{
-            @Override
-            public String satisfiesSafely(SomeDomainObject obj) {
-                return null;
-            }};
-        assertThat(specAbstractSomeDomainObject.satisfies(new SomeOtherDomainObject()), is(nullValue()));
-    }
-
-    @Test
-    public void shouldNotSatisfyForIncorrectTypeIfConfiguredAsSuch() {
-        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>(Nullability.IGNORE_IF_NULL,
TypeChecking.ENSURE_CORRECT_TYPE) {
-            @Override
-            public String satisfiesSafely(SomeDomainObject obj) {
-                return null;
-            }};
-        assertThat(specAbstractSomeDomainObject.satisfies(new SomeOtherDomainObject()), is(not(nullValue())));
-    }
-
-    @Test
-    public void shouldSatisfyForNonNullCorrectTypeIfConfiguredAsSuch() {
-        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>(Nullability.ENSURE_NOT_NULL,
TypeChecking.ENSURE_CORRECT_TYPE) {
-            @Override
-            public String satisfiesSafely(SomeDomainObject obj) {
-                return null;
-            }};
-        assertThat(specAbstractSomeDomainObject.satisfies(new SomeDomainObject()), is(nullValue()));
-    }
-
-
-}
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+import org.apache.isis.applib.spec.AbstractSpecification.Nullability;
+import org.apache.isis.applib.spec.AbstractSpecification.TypeChecking;
+
+public class SpecificationAbstractTest {
+
+    private static class SomeDomainObject {
+    }
+
+    private static class SomeOtherDomainObject {
+    }
+
+    private AbstractSpecification<SomeDomainObject> specAbstractSomeDomainObject;
+
+    @Test
+    public void shouldSatisfyByDefaultForNull() {
+        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>()
{
+            @Override
+            public String satisfiesSafely(final SomeDomainObject obj) {
+                return null;
+            }
+        };
+        assertThat(specAbstractSomeDomainObject.satisfies(null), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotSatisfyForNullIfConfiguredAsSuch() {
+        specAbstractSomeDomainObject =
+            new AbstractSpecification<SomeDomainObject>(Nullability.ENSURE_NOT_NULL,
TypeChecking.IGNORE_INCORRECT_TYPE) {
+                @Override
+                public String satisfiesSafely(final SomeDomainObject obj) {
+                    return null;
+                }
+            };
+        assertThat(specAbstractSomeDomainObject.satisfies(null), is(not(nullValue())));
+    }
+
+    @Test
+    public void shouldSatisfyByDefaultForIncorrectType() {
+        specAbstractSomeDomainObject = new AbstractSpecification<SomeDomainObject>()
{
+            @Override
+            public String satisfiesSafely(final SomeDomainObject obj) {
+                return null;
+            }
+        };
+        assertThat(specAbstractSomeDomainObject.satisfies(new SomeOtherDomainObject()), is(nullValue()));
+    }
+
+    @Test
+    public void shouldNotSatisfyForIncorrectTypeIfConfiguredAsSuch() {
+        specAbstractSomeDomainObject =
+            new AbstractSpecification<SomeDomainObject>(Nullability.IGNORE_IF_NULL,
TypeChecking.ENSURE_CORRECT_TYPE) {
+                @Override
+                public String satisfiesSafely(final SomeDomainObject obj) {
+                    return null;
+                }
+            };
+        assertThat(specAbstractSomeDomainObject.satisfies(new SomeOtherDomainObject()), is(not(nullValue())));
+    }
+
+    @Test
+    public void shouldSatisfyForNonNullCorrectTypeIfConfiguredAsSuch() {
+        specAbstractSomeDomainObject =
+            new AbstractSpecification<SomeDomainObject>(Nullability.ENSURE_NOT_NULL,
TypeChecking.ENSURE_CORRECT_TYPE) {
+                @Override
+                public String satisfiesSafely(final SomeDomainObject obj) {
+                    return null;
+                }
+            };
+        assertThat(specAbstractSomeDomainObject.satisfies(new SomeDomainObject()), is(nullValue()));
+    }
+
+}

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonBufferTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonBufferTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonBufferTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonBufferTest.java
Thu Dec 16 14:55:52 2010
@@ -17,14 +17,12 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.util;
 
-import org.junit.Before;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 
+import org.junit.Before;
+import org.junit.Test;
 
 public class ReasonBufferTest {
     private ReasonBuffer reason;
@@ -66,4 +64,3 @@ public class ReasonBufferTest {
     }
 
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonsTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonsTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonsTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/ReasonsTest.java
Thu Dec 16 14:55:52 2010
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.util;
 
 import static org.hamcrest.Matchers.is;
@@ -26,10 +25,8 @@ import static org.junit.Assert.assertTha
 
 import org.junit.Test;
 
-
 public class ReasonsTest {
 
-
     @Test
     public void testNoReasonReturnsNull() throws Exception {
         assertThat(Reasons.coalesce(), is(nullValue()));
@@ -37,7 +34,7 @@ public class ReasonsTest {
 
     @Test
     public void testSingleNullReturnsNull() throws Exception {
-        assertThat(Reasons.coalesce((String)null), is(nullValue()));
+        assertThat(Reasons.coalesce((String) null), is(nullValue()));
     }
 
     @Test
@@ -65,6 +62,4 @@ public class ReasonsTest {
         assertThat(Reasons.coalesce("foobar", null, "yada"), is("foobar; yada"));
     }
 
-
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleBufferTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleBufferTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleBufferTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleBufferTest.java
Thu Dec 16 14:55:52 2010
@@ -17,15 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.util;
 
-import org.junit.Before;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.junit.Before;
+import org.junit.Test;
+
 public class TitleBufferTest {
 
     String companyName;
@@ -286,6 +285,7 @@ public class TitleBufferTest {
         try {
             t3.truncate(0);
             fail("Exception expected");
-        } catch (final IllegalArgumentException ee) {}
+        } catch (final IllegalArgumentException ee) {
+        }
     }
 }

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleTestObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleTestObject.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleTestObject.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/util/TitleTestObject.java
Thu Dec 16 14:55:52 2010
@@ -17,14 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.util;
 
 class TitleTestObject {
 
     private String title;
 
-    public TitleTestObject() {}
+    public TitleTestObject() {
+    }
 
     public TitleTestObject(final String title) {
         this.title = title;
@@ -37,10 +37,9 @@ class TitleTestObject {
     public String title() {
         return title;
     }
-    
+
     @Override
     public String toString() {
         return "xxx";
     }
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/ColorTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/ColorTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/ColorTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/ColorTest.java
Thu Dec 16 14:55:52 2010
@@ -17,14 +17,12 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Test;
 
 public class ColorTest {
     @Test
@@ -39,4 +37,3 @@ public class ColorTest {
         assertTrue(Color.BLACK.isLessThan(Color.WHITE));
     }
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTest.java (original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTest.java Thu
Dec 16 14:55:52 2010
@@ -17,16 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-import org.junit.Before;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Before;
+import org.junit.Test;
 
 public class DateTest {
 

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTimeTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTimeTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTimeTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/DateTimeTest.java
Thu Dec 16 14:55:52 2010
@@ -17,18 +17,16 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
 
 // TODO review all date based classes - should we use factory and service to create and work
with date type values?
 public class DateTimeTest {
@@ -43,8 +41,9 @@ public class DateTimeTest {
 
     @After
     public void tearDown() {
-    	
+
     }
+
     @Test
     public void testGetDay() {
         assertEquals(14, actual.getDay());
@@ -70,10 +69,10 @@ public class DateTimeTest {
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testAdd() {
-//        DateTime resultDateTime = actual.add(1, 2, 3);
-//        assertEquals(17, resultDateTime.getDay());
-//        assertEquals(5, resultDateTime.getMonth());
-//        assertEquals(2001, resultDateTime.getYear());
+        // DateTime resultDateTime = actual.add(1, 2, 3);
+        // assertEquals(17, resultDateTime.getDay());
+        // assertEquals(5, resultDateTime.getMonth());
+        // assertEquals(2001, resultDateTime.getYear());
     }
 
     @Ignore("TODO: may not work")
@@ -94,83 +93,83 @@ public class DateTimeTest {
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameDayOfWeekAs() throws Exception {
-//        assertTrue(new DateTime(2000, 2, 17).sameDayOfWeekAs(new DateTime(2003, 8, 7)));
// Thursday
-//        assertFalse(new DateTime(2000, 2, 15).sameDayOfWeekAs(new DateTime(2003, 8, 17)));
// Tues &
+        // assertTrue(new DateTime(2000, 2, 17).sameDayOfWeekAs(new DateTime(2003, 8, 7)));
// Thursday
+        // assertFalse(new DateTime(2000, 2, 15).sameDayOfWeekAs(new DateTime(2003, 8, 17)));
// Tues &
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameDayOfMonthAs() throws Exception {
-//        assertTrue(new DateTime(2000, 2, 17).sameDayOfMonthAs(new DateTime(2003, 8, 17)));
-//        assertFalse(new DateTime(2000, 2, 15).sameDayOfMonthAs(new DateTime(2003, 8, 17)));
+        // assertTrue(new DateTime(2000, 2, 17).sameDayOfMonthAs(new DateTime(2003, 8, 17)));
+        // assertFalse(new DateTime(2000, 2, 15).sameDayOfMonthAs(new DateTime(2003, 8, 17)));
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameDayOfYearAs() throws Exception {
-//        assertTrue(new DateTime(2001, 8, 17).sameDayOfYearAs(new DateTime(2003, 8, 17)));
-//        assertTrue(new DateTime(1999, 3, 1).sameDayOfYearAs(new DateTime(2000, 2, 29)));
// leap year
-//        assertFalse(new DateTime(2001, 3, 1).sameDayOfYearAs(new DateTime(2000, 3, 2)));
+        // assertTrue(new DateTime(2001, 8, 17).sameDayOfYearAs(new DateTime(2003, 8, 17)));
+        // assertTrue(new DateTime(1999, 3, 1).sameDayOfYearAs(new DateTime(2000, 2, 29)));
// leap year
+        // assertFalse(new DateTime(2001, 3, 1).sameDayOfYearAs(new DateTime(2000, 3, 2)));
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameWeekAs() throws Exception {
-//        assertFalse(new DateTime(2000, 2, 15).sameWeekAs(new DateTime(2000, 2, 12))); //
Tue, week 7 and Sat,
-//                                                                                      //
week 6
-//        assertTrue(new DateTime(2001, 2, 16).sameWeekAs(new DateTime(2002, 2, 11))); //
Tue, week 7, and Thu,
-//                                                                                     //
week 7
+        // assertFalse(new DateTime(2000, 2, 15).sameWeekAs(new DateTime(2000, 2, 12)));
// Tue, week 7 and Sat,
+        // // week 6
+        // assertTrue(new DateTime(2001, 2, 16).sameWeekAs(new DateTime(2002, 2, 11))); //
Tue, week 7, and Thu,
+        // // week 7
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameMonthAs() throws Exception {
-//        assertTrue(new DateTime(2000, 8, 15).sameMonthAs(new DateTime(2003, 8, 17)));
-//        assertFalse(new DateTime(2003, 2, 17).sameMonthAs(new DateTime(2003, 8, 17)));
+        // assertTrue(new DateTime(2000, 8, 15).sameMonthAs(new DateTime(2003, 8, 17)));
+        // assertFalse(new DateTime(2003, 2, 17).sameMonthAs(new DateTime(2003, 8, 17)));
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testSameYearAs() throws Exception {
-//        assertTrue(new DateTime(2003, 2, 15).sameYearAs(new DateTime(2003, 8, 17)));
-//        assertFalse(new DateTime(2000, 2, 15).sameYearAs(new DateTime(2003, 8, 17)));
+        // assertTrue(new DateTime(2003, 2, 15).sameYearAs(new DateTime(2003, 8, 17)));
+        // assertFalse(new DateTime(2000, 2, 15).sameYearAs(new DateTime(2003, 8, 17)));
     }
 
     @Ignore("TODO: may not work")
     @Test
     public void testDateTimeValue() {
-        DateTime date = new DateTime(1970, 1, 1);
+        final DateTime date = new DateTime(1970, 1, 1);
         assertEquals(1970, date.getYear());
         assertEquals(1, date.getMonth());
         assertEquals(1, date.getDay());
-        long time = date.dateValue().getTime();
+        final long time = date.dateValue().getTime();
         assertEquals(1000 * 60 * 60 * 24 * 0, time);
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testStartOfYear() {
-//        assertEquals(new DateTime(2000, 1, 1), actual.startOfYear());
+        // assertEquals(new DateTime(2000, 1, 1), actual.startOfYear());
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testStartOfMonth() {
-//        assertEquals(new DateTime(2000, 3, 1), actual.startOfMonth());
+        // assertEquals(new DateTime(2000, 3, 1), actual.startOfMonth());
     }
 
     @Ignore("TODO: need to reinstate functionality")
     @Test
     public void testStartOfWeek() {
-//        assertEquals(new DateTime(2000, 3, 13), actual.startOfWeek());
-//        assertEquals(new DateTime(2000, 2, 28), new DateTime(2000, 3, 2).startOfWeek());
+        // assertEquals(new DateTime(2000, 3, 13), actual.startOfWeek());
+        // assertEquals(new DateTime(2000, 2, 28), new DateTime(2000, 3, 2).startOfWeek());
     }
 
     @Ignore("TODO: may not work")
     @Test
     public void testNewWithTodaysDateTime() {
-        DateTime actual = new DateTime();
-        DateTime expected = new DateTime(2003, 8, 17);
+        final DateTime actual = new DateTime();
+        final DateTime expected = new DateTime(2003, 8, 17);
         assertEquals(expected, actual);
     }
 

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/MoneyTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/MoneyTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/MoneyTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/MoneyTest.java
Thu Dec 16 14:55:52 2010
@@ -17,21 +17,18 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-import java.math.BigDecimal;
-
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.math.BigDecimal;
 
-public class MoneyTest {
+import org.junit.Test;
 
+public class MoneyTest {
 
     @Test
     public void testAdd() {
@@ -49,7 +46,7 @@ public class MoneyTest {
         assertEquals(330.60, m3.doubleValue(), 0.0);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testAddThrowsExceptionForDifferentCurrencies() {
         final Money m1 = new Money(100, "pds");
         final Money m2 = new Money(200, "uds");
@@ -57,12 +54,12 @@ public class MoneyTest {
         m1.add(m2);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testDoubleConstructorExpectsCurrencyToBeSpecified() {
         new Money(100.50, null);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testLongConstructorExpectsCurrencyToBeSpecified() {
         new Money(100L, null);
     }
@@ -148,7 +145,7 @@ public class MoneyTest {
         assertFalse(m1.isEqualTo(m2));
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testIsEqualToThrowsExceptionWithDifferentCurrencies() {
         final Money m1 = new Money(100, "pds");
         final Money m2 = new Money(100, "usd");
@@ -200,7 +197,8 @@ public class MoneyTest {
         try {
             m2.isLessThan(m1);
             fail();
-        } catch (final IllegalArgumentException expected) {}
+        } catch (final IllegalArgumentException expected) {
+        }
     }
 
     @Test
@@ -223,7 +221,7 @@ public class MoneyTest {
         assertEquals(200.0, m3.doubleValue(), 0.0);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testSubtractThrowsExceptionForDifferentCurrencies() {
         final Money m1 = new Money(100, "pds");
         final Money m2 = new Money(200, "uds");

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PasswordTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PasswordTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PasswordTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PasswordTest.java
Thu Dec 16 14:55:52 2010
@@ -17,16 +17,14 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Test;
+
 public class PasswordTest {
     @Test
     public void testCheckPassword() {
@@ -45,4 +43,3 @@ public class PasswordTest {
         assertEquals("********************", password.toString());
     }
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PercentageTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PercentageTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PercentageTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/PercentageTest.java
Thu Dec 16 14:55:52 2010
@@ -17,17 +17,15 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-import org.junit.Before;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Before;
+import org.junit.Test;
 
 public class PercentageTest {
     Percentage p1;
@@ -73,4 +71,3 @@ public class PercentageTest {
         assertFalse(p1.isLessThan(p1));
     }
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TestClock.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TestClock.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TestClock.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TestClock.java
Thu Dec 16 14:55:52 2010
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
 import java.util.Calendar;
@@ -26,7 +25,6 @@ import java.util.TimeZone;
 
 import org.apache.isis.applib.clock.Clock;
 
-
 public class TestClock extends Clock {
 
     public static final TimeZone timeZone;

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeStampTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeStampTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeStampTest.java
(original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeStampTest.java
Thu Dec 16 14:55:52 2010
@@ -17,17 +17,15 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
-
-import org.junit.Before;
-import org.junit.Test;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Before;
+import org.junit.Test;
+
 public class TimeStampTest {
 
     private TimeStamp timeStamp;
@@ -61,4 +59,3 @@ public class TimeStampTest {
     }
 
 }
-

Modified: incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeTest.java?rev=1049995&r1=1049994&r2=1049995&view=diff
==============================================================================
--- incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeTest.java (original)
+++ incubator/isis/trunk/applib/src/test/java/org/apache/isis/applib/value/TimeTest.java Thu
Dec 16 14:55:52 2010
@@ -17,9 +17,12 @@
  *  under the License.
  */
 
-
 package org.apache.isis.applib.value;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.text.DateFormat;
 import java.util.Date;
 import java.util.Locale;
@@ -28,11 +31,6 @@ import java.util.TimeZone;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-
 public class TimeTest {
     public static void main(final String[] args) {
         final Date date = new Date(3600000 * 14);



Mime
View raw message