incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1234453 [28/33] - in /incubator/isis/trunk/framework/core: commons/src/main/java/org/apache/isis/core/commons/authentication/ commons/src/main/java/org/apache/isis/core/commons/components/ commons/src/main/java/org/apache/isis/core/commons...
Date Sun, 22 Jan 2012 06:59:23 GMT
Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskAnnotationFacetFactoryTest.java Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.propparam.validate.mask;
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.mask;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.Mask;
@@ -37,108 +36,108 @@ import org.apache.isis.core.progmodel.fa
 import org.apache.isis.core.progmodel.facets.param.validate.maskannot.MaskFacetAnnotationForParameter;
 import org.apache.isis.core.progmodel.facets.properties.validate.maskannot.MaskAnnotationForPropertyFacetFactory;
 import org.apache.isis.core.progmodel.facets.properties.validate.maskannot.MaskFacetAnnotationForProperty;
-
-
-public class MaskAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private final ObjectSpecification customerNoSpec = new TestProxySpecification(String.class);
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
+
+public class MaskAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
+    private final ObjectSpecification customerNoSpec = new TestProxySpecification(String.class);
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
         reflector.setLoadSpecificationStringReturn(customerNoSpec);
-    }
-
-
-    public void testMaskAnnotationPickedUpOnClass() {
-        MaskAnnotationForTypeFacetFactory facetFactory = new MaskAnnotationForTypeFacetFactory();
+    }
+
+    public void testMaskAnnotationPickedUpOnClass() {
+        final MaskAnnotationForTypeFacetFactory facetFactory = new MaskAnnotationForTypeFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
 
-        @Mask("###")
-        class Customer {}
-        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(MaskFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof MaskFacetAnnotationForType);
-        final MaskFacetAnnotationForType maskFacet = (MaskFacetAnnotationForType) facet;
-        assertEquals("###", maskFacet.value());
-    }
-
-    public void testMaskAnnotationPickedUpOnProperty() {
-        MaskAnnotationForPropertyFacetFactory facetFactory = new MaskAnnotationForPropertyFacetFactory();
+        @Mask("###")
+        class Customer {
+        }
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(MaskFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof MaskFacetAnnotationForType);
+        final MaskFacetAnnotationForType maskFacet = (MaskFacetAnnotationForType) facet;
+        assertEquals("###", maskFacet.value());
+    }
+
+    public void testMaskAnnotationPickedUpOnProperty() {
+        final MaskAnnotationForPropertyFacetFactory facetFactory = new MaskAnnotationForPropertyFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
 
-        class Customer {
-            @SuppressWarnings("unused")
-            @Mask("###")
-            public String getFirstName() {
-                return null;
-            }
-        }
-        final Method method = findMethod(Customer.class, "getFirstName");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(MaskFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof MaskFacetAnnotationForProperty);
-        final MaskFacetAnnotationForProperty maskFacet = (MaskFacetAnnotationForProperty) facet;
-        assertEquals("###", maskFacet.value());
-    }
-
-    public void testMaskAnnotationPickedUpOnActionParameter() {
-        MaskAnnotationForParameterFacetFactory facetFactory = new MaskAnnotationForParameterFacetFactory();
+        class Customer {
+            @SuppressWarnings("unused")
+            @Mask("###")
+            public String getFirstName() {
+                return null;
+            }
+        }
+        final Method method = findMethod(Customer.class, "getFirstName");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(MaskFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof MaskFacetAnnotationForProperty);
+        final MaskFacetAnnotationForProperty maskFacet = (MaskFacetAnnotationForProperty) facet;
+        assertEquals("###", maskFacet.value());
+    }
+
+    public void testMaskAnnotationPickedUpOnActionParameter() {
+        final MaskAnnotationForParameterFacetFactory facetFactory = new MaskAnnotationForParameterFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
 
-        class Customer {
-            @SuppressWarnings("unused")
-            public void someAction(@Mask("###") final String foo) {}
-        }
-        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });
-
-        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
-
-        final Facet facet = facetedMethodParameter.getFacet(MaskFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof MaskFacetAnnotationForParameter);
-        final MaskFacetAnnotationForParameter maskFacet = (MaskFacetAnnotationForParameter) facet;
-        assertEquals("###", maskFacet.value());
-    }
-
-    public void testMaskAnnotationNotIgnoredForNonStringsProperty() {
-        MaskAnnotationForPropertyFacetFactory facetFactory = new MaskAnnotationForPropertyFacetFactory();
+        class Customer {
+            @SuppressWarnings("unused")
+            public void someAction(@Mask("###") final String foo) {
+            }
+        }
+        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });
+
+        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
+
+        final Facet facet = facetedMethodParameter.getFacet(MaskFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof MaskFacetAnnotationForParameter);
+        final MaskFacetAnnotationForParameter maskFacet = (MaskFacetAnnotationForParameter) facet;
+        assertEquals("###", maskFacet.value());
+    }
+
+    public void testMaskAnnotationNotIgnoredForNonStringsProperty() {
+        final MaskAnnotationForPropertyFacetFactory facetFactory = new MaskAnnotationForPropertyFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
 
-        class Customer {
-            @SuppressWarnings("unused")
-            @Mask("###")
-            public int getNumberOfOrders() {
-                return 0;
-            }
-        }
-        final Method method = findMethod(Customer.class, "getNumberOfOrders");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
-
-        assertNotNull(facetedMethod.getFacet(MaskFacet.class));
-    }
-
-    public void testMaskAnnotationNotIgnoredForPrimitiveOnActionParameter() {
-        MaskAnnotationForParameterFacetFactory facetFactory = new MaskAnnotationForParameterFacetFactory();
+        class Customer {
+            @SuppressWarnings("unused")
+            @Mask("###")
+            public int getNumberOfOrders() {
+                return 0;
+            }
+        }
+        final Method method = findMethod(Customer.class, "getNumberOfOrders");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
+
+        assertNotNull(facetedMethod.getFacet(MaskFacet.class));
+    }
+
+    public void testMaskAnnotationNotIgnoredForPrimitiveOnActionParameter() {
+        final MaskAnnotationForParameterFacetFactory facetFactory = new MaskAnnotationForParameterFacetFactory();
         facetFactory.setSpecificationLookup(reflector);
 
-        class Customer {
-            @SuppressWarnings("unused")
-            public void someAction(@Mask("###") final int foo) {}
-        }
-        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });
-
-        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
-
-        assertNotNull(facetedMethodParameter.getFacet(MaskFacet.class));
-    }
-
-}
-
+        class Customer {
+            @SuppressWarnings("unused")
+            public void someAction(@Mask("###") final int foo) {
+            }
+        }
+        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });
+
+        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
+
+        assertNotNull(facetedMethodParameter.getFacet(MaskFacet.class));
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskEvaluatorTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskEvaluatorTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskEvaluatorTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/mask/MaskEvaluatorTest.java Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.propparam.validate.mask;
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.mask;
-
 import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 
@@ -27,6 +26,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Locale;
 
+import org.apache.isis.core.progmodel.facets.object.mask.MaskEvaluator;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -34,56 +34,48 @@ import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
 
-import org.apache.isis.core.progmodel.facets.object.mask.MaskEvaluator;
-
-
-@RunWith(Parameterized.class)
-public class MaskEvaluatorTest {
-
-    private MaskEvaluator maskEvaluator;
-
-    @Parameters
-    public static Collection data() {
-        return Arrays.asList(new Object[][] { { "AAA", "aby", true }, { "A", "A", true }, { "A", "Z", true }, { "A", "a", true },
-                { "A", "z", true }, { "A", "0", true }, { "A", "9", true }, { "A", "@", false }, { "A", "~", false },
-                { "a", "A", true }, { "a", "Z", true }, { "a", "a", true }, { "a", "z", true }, { "a", "0", true },
-                { "a", "9", true }, { "a", " ", true }, { "a", "~", false }, { "9", "z", false }, { "9", "0", true },
-                { "9", "9", true }, { "9", " ", true }, { "9", "~", false }, { "&", "A", true }, { "&", "Z", true },
-                { "&", "a", true }, { "&", "z", true }, { "&", "9", false }, { "?", "A", true }, { "?", "Z", true },
-                { "?", "a", true }, { "?", "z", true }, { "U", "A", true }, { "U", "Z", true }, { "U", "a", false },
-                { "L", "a", true }, { "L", "z", true }, { "L", "A", false }, { "#", "0", true }, { "#", "9", true },
-                { "#", "X", false }, { "#", "#", false }, { ",", ",", true },
-                // {".", "X", false}, // TODO: failing so commented out
-                { ":", ":", true }, { ":", "X", false }, { "/", "/", true }, { "/", "X", false }, { "##", "23", true },
-        // {"##.#", "23.3", true}, // TODO: failing so commented out
-                });
-    }
-
-    private Locale previousLocale = Locale.getDefault();
-
-    @Before
-    public void setUp() {
-        previousLocale = Locale.getDefault();
-        Locale.setDefault(Locale.ENGLISH);
-    }
-
-    @After
-    public void tearDown() {
-        Locale.setDefault(previousLocale);
-    }
-
-    private final String mask;
-    private final String proposed;
-    private final boolean expected;
-
-    public MaskEvaluatorTest(final String mask, final String proposed, final boolean expected) {
-        this.mask = mask;
-        this.proposed = proposed;
-        this.expected = expected;
-    }
-
-    @Test
-    public void all() {
-        assertThat(new MaskEvaluator(mask).evaluate(proposed), is(expected));
-    }
-}
+@RunWith(Parameterized.class)
+public class MaskEvaluatorTest {
+
+    private MaskEvaluator maskEvaluator;
+
+    @Parameters
+    public static Collection data() {
+        return Arrays.asList(new Object[][] { { "AAA", "aby", true }, { "A", "A", true }, { "A", "Z", true }, { "A", "a", true }, { "A", "z", true }, { "A", "0", true }, { "A", "9", true }, { "A", "@", false }, { "A", "~", false }, { "a", "A", true }, { "a", "Z", true }, { "a", "a", true },
+                { "a", "z", true }, { "a", "0", true }, { "a", "9", true }, { "a", " ", true }, { "a", "~", false }, { "9", "z", false }, { "9", "0", true }, { "9", "9", true }, { "9", " ", true }, { "9", "~", false }, { "&", "A", true }, { "&", "Z", true }, { "&", "a", true }, { "&", "z", true },
+                { "&", "9", false }, { "?", "A", true }, { "?", "Z", true }, { "?", "a", true }, { "?", "z", true }, { "U", "A", true }, { "U", "Z", true }, { "U", "a", false }, { "L", "a", true }, { "L", "z", true }, { "L", "A", false }, { "#", "0", true }, { "#", "9", true }, { "#", "X", false },
+                { "#", "#", false }, { ",", ",", true },
+                // {".", "X", false}, // TODO: failing so commented out
+                { ":", ":", true }, { ":", "X", false }, { "/", "/", true }, { "/", "X", false }, { "##", "23", true },
+        // {"##.#", "23.3", true}, // TODO: failing so commented out
+                });
+    }
+
+    private Locale previousLocale = Locale.getDefault();
+
+    @Before
+    public void setUp() {
+        previousLocale = Locale.getDefault();
+        Locale.setDefault(Locale.ENGLISH);
+    }
+
+    @After
+    public void tearDown() {
+        Locale.setDefault(previousLocale);
+    }
+
+    private final String mask;
+    private final String proposed;
+    private final boolean expected;
+
+    public MaskEvaluatorTest(final String mask, final String proposed, final boolean expected) {
+        this.mask = mask;
+        this.proposed = proposed;
+        this.expected = expected;
+    }
+
+    @Test
+    public void all() {
+        assertThat(new MaskEvaluator(mask).evaluate(proposed), is(expected));
+    }
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExAnnotationFacetFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExAnnotationFacetFactoryTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExAnnotationFacetFactoryTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExAnnotationFacetFactoryTest.java Sun Jan 22 06:58:43 2012
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
-
 import java.lang.reflect.Method;
 
 import org.apache.isis.applib.annotation.RegEx;
@@ -35,96 +34,97 @@ import org.apache.isis.core.progmodel.fa
 import org.apache.isis.core.progmodel.facets.param.validate.regexannot.RegExFacetAnnotationForParameterFacetFactory;
 import org.apache.isis.core.progmodel.facets.properties.validate.regexannot.RegExFacetAnnotationForProperty;
 import org.apache.isis.core.progmodel.facets.properties.validate.regexannot.RegExFacetAnnotationForPropertyFacetFactory;
-
-
-public class RegExAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
+
+public class RegExAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
+
     public void testRegExAnnotationPickedUpOnClass() {
-        RegExFacetAnnotationForTypeFacetFactory facetFactory = new RegExFacetAnnotationForTypeFacetFactory();
-
-        @RegEx(validation = "^A.*", caseSensitive = false)
-        class Customer {}
-        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof RegExFacetAnnotationForType);
-        final RegExFacetAnnotationForType regExFacet = (RegExFacetAnnotationForType) facet;
-        assertEquals("^A.*", regExFacet.validation());
-        assertEquals(false, regExFacet.caseSensitive());
-    }
-
+        final RegExFacetAnnotationForTypeFacetFactory facetFactory = new RegExFacetAnnotationForTypeFacetFactory();
+
+        @RegEx(validation = "^A.*", caseSensitive = false)
+        class Customer {
+        }
+        facetFactory.process(new ProcessClassContext(Customer.class, methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof RegExFacetAnnotationForType);
+        final RegExFacetAnnotationForType regExFacet = (RegExFacetAnnotationForType) facet;
+        assertEquals("^A.*", regExFacet.validation());
+        assertEquals(false, regExFacet.caseSensitive());
+    }
+
     public void testRegExAnnotationPickedUpOnProperty() {
-        RegExFacetAnnotationForPropertyFacetFactory facetFactory = new RegExFacetAnnotationForPropertyFacetFactory();
-
-        class Customer {
-            @SuppressWarnings("unused")
-            @RegEx(validation = "^A.*", caseSensitive = false)
-            public String getFirstName() {
-                return null;
-            }
-        }
-        final Method method = findMethod(Customer.class, "getFirstName");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof RegExFacetAnnotationForProperty);
-        final RegExFacetAnnotationForProperty regExFacet = (RegExFacetAnnotationForProperty) facet;
-        assertEquals("^A.*", regExFacet.validation());
-        assertEquals(false, regExFacet.caseSensitive());
-    }
-
-    public void testRegExAnnotationPickedUpOnActionParameter() {
-        RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
-
-        class Customer {
-            @SuppressWarnings("unused")
-            public void someAction(@RegEx(validation = "^A.*", caseSensitive = false) final String foo) {}
-        }
-        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });
-
-        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
-
-        final Facet facet = facetedMethodParameter.getFacet(RegExFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof RegExFacetAnnotationForParameter);
-        final RegExFacetAnnotationForParameter regExFacet = (RegExFacetAnnotationForParameter) facet;
-        assertEquals("^A.*", regExFacet.validation());
-        assertEquals(false, regExFacet.caseSensitive());
-    }
-
-    public void testRegExAnnotationIgnoredForNonStringsProperty() {
-        RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
-
-        class Customer {
-            @SuppressWarnings("unused")
-            @RegEx(validation = "^A.*", caseSensitive = false)
-            public int getNumberOfOrders() {
-                return 0;
-            }
-        }
-        final Method method = findMethod(Customer.class, "getNumberOfOrders");
-
-        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
-
-        assertNull(facetedMethod.getFacet(RegExFacet.class));
-    }
-
-    public void testRegExAnnotationIgnoredForPrimitiveOnActionParameter() {
-        RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
-
-        class Customer {
-            @SuppressWarnings("unused")
-            public void someAction(@RegEx(validation = "^A.*", caseSensitive = false) final int foo) {}
-        }
-        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });
-
-        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
-
-        assertNull(facetedMethod.getFacet(RegExFacet.class));
-    }
-
-}
-
+        final RegExFacetAnnotationForPropertyFacetFactory facetFactory = new RegExFacetAnnotationForPropertyFacetFactory();
+
+        class Customer {
+            @SuppressWarnings("unused")
+            @RegEx(validation = "^A.*", caseSensitive = false)
+            public String getFirstName() {
+                return null;
+            }
+        }
+        final Method method = findMethod(Customer.class, "getFirstName");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
+
+        final Facet facet = facetedMethod.getFacet(RegExFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof RegExFacetAnnotationForProperty);
+        final RegExFacetAnnotationForProperty regExFacet = (RegExFacetAnnotationForProperty) facet;
+        assertEquals("^A.*", regExFacet.validation());
+        assertEquals(false, regExFacet.caseSensitive());
+    }
+
+    public void testRegExAnnotationPickedUpOnActionParameter() {
+        final RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
+
+        class Customer {
+            @SuppressWarnings("unused")
+            public void someAction(@RegEx(validation = "^A.*", caseSensitive = false) final String foo) {
+            }
+        }
+        final Method method = findMethod(Customer.class, "someAction", new Class[] { String.class });
+
+        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
+
+        final Facet facet = facetedMethodParameter.getFacet(RegExFacet.class);
+        assertNotNull(facet);
+        assertTrue(facet instanceof RegExFacetAnnotationForParameter);
+        final RegExFacetAnnotationForParameter regExFacet = (RegExFacetAnnotationForParameter) facet;
+        assertEquals("^A.*", regExFacet.validation());
+        assertEquals(false, regExFacet.caseSensitive());
+    }
+
+    public void testRegExAnnotationIgnoredForNonStringsProperty() {
+        final RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
+
+        class Customer {
+            @SuppressWarnings("unused")
+            @RegEx(validation = "^A.*", caseSensitive = false)
+            public int getNumberOfOrders() {
+                return 0;
+            }
+        }
+        final Method method = findMethod(Customer.class, "getNumberOfOrders");
+
+        facetFactory.process(new ProcessMethodContext(Customer.class, method, methodRemover, facetedMethod));
+
+        assertNull(facetedMethod.getFacet(RegExFacet.class));
+    }
+
+    public void testRegExAnnotationIgnoredForPrimitiveOnActionParameter() {
+        final RegExFacetAnnotationForParameterFacetFactory facetFactory = new RegExFacetAnnotationForParameterFacetFactory();
+
+        class Customer {
+            @SuppressWarnings("unused")
+            public void someAction(@RegEx(validation = "^A.*", caseSensitive = false) final int foo) {
+            }
+        }
+        final Method method = findMethod(Customer.class, "someAction", new Class[] { int.class });
+
+        facetFactory.processParams(new ProcessParameterContext(method, 0, facetedMethodParameter));
+
+        assertNull(facetedMethod.getFacet(RegExFacet.class));
+    }
+
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAnnotationTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAnnotationTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAnnotationTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/propparam/validate/regex/RegExFacetAnnotationTest.java Sun Jan 22 06:58:43 2012
@@ -17,12 +17,13 @@
  *  under the License.
  */
 
+package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
 
-package org.apache.isis.core.progmodel.facets.propparam.validate.regex;
-
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType;
 import org.jmock.Mockery;
 import org.jmock.integration.junit4.JMock;
 import org.jmock.integration.junit4.JUnit4Mockery;
@@ -31,69 +32,70 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.progmodel.facets.object.regex.annotation.RegExFacetAnnotationForType;
-
-
-@RunWith(JMock.class)
-public class RegExFacetAnnotationTest {
-
-    private final Mockery context = new JUnit4Mockery();
-
-    private RegExFacetAnnotationForType regExFacetAnnotationForType;
-    private FacetHolder facetHolder;
-
-    @Before
-    public void setUp() throws Exception {
-        facetHolder = context.mock(FacetHolder.class);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        facetHolder = null;
-        regExFacetAnnotationForType = null;
-    }
-
-    @Test
-    public void shouldBeAbleToInstantiate() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
-    }
-
-    @Test
-    public void shouldAllowDotStar() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("abc"), equalTo(false)); // ie does match
-    }
-
-    @Test
-    public void shouldAllowWhenCaseSensitive() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", true, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("abc"), equalTo(false)); // ie does match
-    }
-
-    @Test
-    public void shouldAllowWhenCaseInsensitive() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", false, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("ABC"), equalTo(false)); // ie does match
-    }
-
-    @Test
-    public void shouldDisallowWhenCaseSensitive() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", true, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("abC"), equalTo(true));
-    }
-
-    @Test
-    public void shouldDisallowWhenCaseInsensitive() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", false, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("aBd"), equalTo(true));
-    }
-
-    @Test
-    public void shouldReformat() {
-        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^([0-9]{2})([0-9]{2})([0-9]{2})$", "$1-$2-$3", false, facetHolder);
-        assertThat(regExFacetAnnotationForType.doesNotMatch("123456"), equalTo(false));
-        assertThat(regExFacetAnnotationForType.format("123456"), equalTo("12-34-56"));
-    }
-}
-
+@RunWith(JMock.class)
+public class RegExFacetAnnotationTest {
+
+    private final Mockery context = new JUnit4Mockery();
+
+    private RegExFacetAnnotationForType regExFacetAnnotationForType;
+    private FacetHolder facetHolder;
+
+    @Before
+    public void setUp() throws Exception {
+        facetHolder = context.mock(FacetHolder.class);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        facetHolder = null;
+        regExFacetAnnotationForType = null;
+    }
+
+    @Test
+    public void shouldBeAbleToInstantiate() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
+    }
+
+    @Test
+    public void shouldAllowDotStar() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType(".*", "", true, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("abc"), equalTo(false)); // ie
+                                                                                     // does
+                                                                                     // match
+    }
+
+    @Test
+    public void shouldAllowWhenCaseSensitive() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", true, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("abc"), equalTo(false)); // ie
+                                                                                     // does
+                                                                                     // match
+    }
+
+    @Test
+    public void shouldAllowWhenCaseInsensitive() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", false, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("ABC"), equalTo(false)); // ie
+                                                                                     // does
+                                                                                     // match
+    }
+
+    @Test
+    public void shouldDisallowWhenCaseSensitive() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", true, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("abC"), equalTo(true));
+    }
+
+    @Test
+    public void shouldDisallowWhenCaseInsensitive() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^abc$", "", false, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("aBd"), equalTo(true));
+    }
+
+    @Test
+    public void shouldReformat() {
+        regExFacetAnnotationForType = new RegExFacetAnnotationForType("^([0-9]{2})([0-9]{2})([0-9]{2})$", "$1-$2-$3", false, facetHolder);
+        assertThat(regExFacetAnnotationForType.doesNotMatch("123456"), equalTo(false));
+        assertThat(regExFacetAnnotationForType.format("123456"), equalTo("12-34-56"));
+    }
+}

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigDecimalValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigDecimalValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigDecimalValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigDecimalValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -25,17 +24,16 @@ import static org.junit.Assert.fail;
 
 import java.math.BigDecimal;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.bigdecimal.BigDecimalValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class BigDecimalValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -46,11 +44,13 @@ public class BigDecimalValueSemanticsPro
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.decimal");
-    		will(returnValue(null));
-    	}});
-    	
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.decimal");
+                will(returnValue(null));
+            }
+        });
+
         bigDecimal = new BigDecimal("34132.199");
         allowMockAdapterToReturn(bigDecimal);
         holder = new FacetHolderImpl();
@@ -69,7 +69,8 @@ public class BigDecimalValueSemanticsPro
         try {
             value.parseTextEntry(null, "214xxx2342334");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -88,6 +89,4 @@ public class BigDecimalValueSemanticsPro
         assertEquals(new BigDecimal("4322.89991"), newValue);
     }
 
-
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigIntValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigIntValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigIntValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BigIntValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -25,17 +24,16 @@ import static org.junit.Assert.fail;
 
 import java.math.BigInteger;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.biginteger.BigIntegerValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class BigIntValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -48,11 +46,12 @@ public class BigIntValueSemanticsProvide
         bigInt = new BigInteger("132199");
         allowMockAdapterToReturn(bigInt);
 
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.int");
-        	will(returnValue(null));
-        }});
-
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.int");
+                will(returnValue(null));
+            }
+        });
 
         holder = new FacetHolderImpl();
         setValue(new BigIntegerValueSemanticsProvider(holder, mockConfiguration, mockContext));
@@ -69,7 +68,8 @@ public class BigIntValueSemanticsProvide
         try {
             getValue().parseTextEntry(null, "214xxx2342334");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -89,4 +89,3 @@ public class BigIntValueSemanticsProvide
     }
 
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BooleanValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BooleanValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BooleanValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/BooleanValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,23 +17,21 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.booleans.BooleanValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.booleans.BooleanWrapperValueSemanticsProvider;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class BooleanValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -79,7 +77,8 @@ public class BooleanValueSemanticsProvid
         try {
             value.parseTextEntry(null, "yes");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -115,4 +114,3 @@ public class BooleanValueSemanticsProvid
         assertEquals(false, value.isSet(mockAdapter));
     }
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ByteValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ByteValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ByteValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ByteValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,24 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.bytes.ByteValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.bytes.ByteWrapperValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class ByteValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -50,10 +48,12 @@ public class ByteValueSemanticsProviderT
         allowMockAdapterToReturn(byteObj);
         holder = new FacetHolderImpl();
 
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.byte");
-        	will(returnValue(null));
-        }});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.byte");
+                will(returnValue(null));
+            }
+        });
 
         setValue(value = new ByteWrapperValueSemanticsProvider(holder, mockConfiguration, mockContext));
     }
@@ -69,7 +69,8 @@ public class ByteValueSemanticsProviderT
         try {
             value.parseTextEntry(null, "xs21z4xxx23");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -89,4 +90,3 @@ public class ByteValueSemanticsProviderT
     }
 
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/CharacterValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/CharacterValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/CharacterValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/CharacterValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,17 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
@@ -35,6 +29,10 @@ import org.apache.isis.core.metamodel.fa
 import org.apache.isis.core.metamodel.facets.object.parseable.InvalidEntryException;
 import org.apache.isis.core.progmodel.facets.value.chars.CharValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.chars.CharWrapperValueSemanticsProvider;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class CharacterValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -59,7 +57,8 @@ public class CharacterValueSemanticsProv
         try {
             value.parseTextEntry(null, "one");
             fail();
-        } catch (final InvalidEntryException expected) {}
+        } catch (final InvalidEntryException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ColorValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ColorValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ColorValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ColorValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,23 +17,21 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.applib.value.Color;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.color.ColorValueSemanticsProvider;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class ColorValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -62,7 +60,8 @@ public class ColorValueSemanticsProvider
         try {
             value.parseTextEntry(null, "red");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -79,7 +78,7 @@ public class ColorValueSemanticsProvider
     public void testTitleOfWhite() {
         assertEquals("White", value.displayTitleOf(new Color(0xffffff), (Localization) null));
     }
-    
+
     @Test
     public void testEncode() {
         assertEquals("3366ff", value.toEncodedString(color));
@@ -91,6 +90,4 @@ public class ColorValueSemanticsProvider
         assertEquals(color, newValue);
     }
 
-
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateTimeValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateTimeValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateTimeValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateTimeValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -22,17 +22,16 @@ package org.apache.isis.core.progmodel.f
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
+import org.apache.isis.applib.value.DateTime;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
+import org.apache.isis.core.progmodel.facets.value.datetime.DateTimeValueSemanticsProvider;
 import org.jmock.Expectations;
 import org.jmock.integration.junit4.JMock;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.applib.value.DateTime;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.core.progmodel.facets.value.datetime.DateTimeValueSemanticsProvider;
-
 @RunWith(JMock.class)
 public class DateTimeValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
 
@@ -76,8 +75,7 @@ public class DateTimeValueSemanticsProvi
         // assertEquals("21-May-2007 10:30", adapter.titleString(null));
     }
 
-    private void assertEntry(final String entry, final int year, final int month, final int day, final int hour,
-        final int minute, final int second) {
+    private void assertEntry(final String entry, final int year, final int month, final int day, final int hour, final int minute, final int second) {
         final Object object = adapter.parseTextEntry(null, entry);
         assertEquals(new DateTime(year, month, day, hour, minute, second), object);
     }

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DateValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,24 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.adapters.EncodingException;
 import org.apache.isis.applib.value.Date;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.date.DateValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class DateValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -45,12 +43,14 @@ public class DateValueSemanticsProviderT
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.date");
-    		will(returnValue(null));
-    	}});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.date");
+                will(returnValue(null));
+            }
+        });
 
-    	TestClock.initialize();
+        TestClock.initialize();
         setupSpecification(Date.class);
         date = new Date(2001, 2, 4);
         holder = new FacetHolderImpl();
@@ -140,7 +140,7 @@ public class DateValueSemanticsProviderT
         assertEquals(new Date(2003, 4, 17), parsed);
     }
 
-    @Test(expected=TextEntryParseException.class)
+    @Test(expected = TextEntryParseException.class)
     public void illegalEntry() throws Exception {
         adapter.parseTextEntry(null, "xxx");
     }
@@ -150,8 +150,8 @@ public class DateValueSemanticsProviderT
         try {
             adapter.fromEncodedString("2003may12");
             fail();
-        } catch (final EncodingException expected) {}
+        } catch (final EncodingException expected) {
+        }
     }
 
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/DoubleValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,23 +17,21 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.longs.DoubleWrapperValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class DoubleValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -44,11 +42,13 @@ public class DoubleValueSemanticsProvide
 
     @Before
     public void setUpObjects() throws Exception {
-    	
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.double");
-    		will(returnValue(null));
-    	}});
+
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.double");
+                will(returnValue(null));
+            }
+        });
 
         holder = new FacetHolderImpl();
         setValue(new DoubleWrapperValueSemanticsProvider(holder, mockConfiguration, mockContext));
@@ -67,7 +67,8 @@ public class DoubleValueSemanticsProvide
         try {
             getValue().parseTextEntry(null, "one");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/FloatValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,24 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.floats.FloatValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.floats.FloatWrapperValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class FloatValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -45,14 +43,16 @@ public class FloatValueSemanticsProvider
 
     @Before
     public void setUpObjects() throws Exception {
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.float");
-        	will(returnValue(null));
-        }});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.float");
+                will(returnValue(null));
+            }
+        });
 
         float1 = new Float(32.5f);
         allowMockAdapterToReturn(float1);
-        
+
         holder = new FacetHolderImpl();
         setValue(value = new FloatWrapperValueSemanticsProvider(holder, mockConfiguration, mockContext));
     }
@@ -62,7 +62,8 @@ public class FloatValueSemanticsProvider
         try {
             value.parseTextEntry(null, "one");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstractTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstractTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstractTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/ImageValueSemanticsProviderAbstractTest.java Sun Jan 22 06:58:43 2012
@@ -17,38 +17,36 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 
 import java.awt.Image;
 
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
+import org.apache.isis.core.progmodel.facets.value.image.ImageValueSemanticsProviderAbstract;
 import org.jmock.Mockery;
 import org.jmock.integration.junit4.JMock;
 import org.jmock.integration.junit4.JUnit4Mockery;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.runtimecontext.RuntimeContext;
-import org.apache.isis.core.progmodel.facets.value.image.ImageValueSemanticsProviderAbstract;
-
 @RunWith(JMock.class)
 public class ImageValueSemanticsProviderAbstractTest {
-	
+
     protected Mockery mockery = new JUnit4Mockery();
 
     @Test
     public void testImageData() throws Exception {
-    	RuntimeContext mockRuntimeContext = mockery.mock(RuntimeContext.class);
-    	FacetHolder mockFacetHolder = mockery.mock(FacetHolder.class);
-    	final TestImageSemanticsProvider adapter = new TestImageSemanticsProvider(mockFacetHolder);
-
-    	String data = adapter.toEncodedString(null);
-        int[][] array = adapter.doRestore(data);
-        
+        final RuntimeContext mockRuntimeContext = mockery.mock(RuntimeContext.class);
+        final FacetHolder mockFacetHolder = mockery.mock(FacetHolder.class);
+        final TestImageSemanticsProvider adapter = new TestImageSemanticsProvider(mockFacetHolder);
+
+        final String data = adapter.toEncodedString(null);
+        final int[][] array = adapter.doRestore(data);
+
         assertEquals(0xFF000000, array[0][0]);
         assertEquals(0xFF3F218A, array[0][1]);
         assertEquals(0xFF123456, array[0][3]);
@@ -61,12 +59,12 @@ public class ImageValueSemanticsProvider
 class TestImageSemanticsProvider extends ImageValueSemanticsProviderAbstract<int[][]> {
 
     TestImageSemanticsProvider(final FacetHolder holder) {
-		super(holder, null, null, null);
-	}
+        super(holder, null, null, null);
+    }
 
-	@Override
+    @Override
     protected int[][] getPixels(final Object object) {
-        int[][] array = new int[10][10];
+        final int[][] array = new int[10][10];
         array[0][1] = 0x3F218A;
         array[0][3] = 0x123456;
         array[0][4] = 0x7FFFFF;
@@ -105,8 +103,7 @@ class TestImageSemanticsProvider extends
     }
 
     @Override
-    public ObjectAdapter createValue(Image image) {
+    public ObjectAdapter createValue(final Image image) {
         return null;
     }
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/IntValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,24 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.integer.IntValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.integer.IntWrapperValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class IntValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -48,10 +46,12 @@ public class IntValueSemanticsProviderTe
         integer = Integer.valueOf(32);
         allowMockAdapterToReturn(integer);
 
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.int");
-        	will(returnValue(null));
-        }});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.int");
+                will(returnValue(null));
+            }
+        });
 
         holder = new FacetHolderImpl();
         setValue(value = new IntWrapperValueSemanticsProvider(holder, mockConfiguration, mockContext));
@@ -62,7 +62,8 @@ public class IntValueSemanticsProviderTe
         try {
             value.parseTextEntry(null, "one");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlDateValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -27,17 +26,16 @@ import java.sql.Date;
 import java.util.Calendar;
 import java.util.TimeZone;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.datesql.JavaSqlDateValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class JavaSqlDateValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -48,10 +46,12 @@ public class JavaSqlDateValueSemanticsPr
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.date");
-    		will(returnValue(null));
-    	}});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.date");
+                will(returnValue(null));
+            }
+        });
 
         TestClock.initialize();
         date = new Date(0);
@@ -69,7 +69,8 @@ public class JavaSqlDateValueSemanticsPr
         try {
             adapter.parseTextEntry(null, "date");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeStampValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -25,16 +24,15 @@ import static org.junit.Assert.assertNul
 
 import java.sql.Timestamp;
 
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
+import org.apache.isis.core.progmodel.facets.value.timestampsql.JavaSqlTimeStampValueSemanticsProvider;
 import org.jmock.Expectations;
 import org.jmock.integration.junit4.JMock;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.core.progmodel.facets.value.timestampsql.JavaSqlTimeStampValueSemanticsProvider;
-
 @RunWith(JMock.class)
 public class JavaSqlTimeStampValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
 
@@ -44,10 +42,12 @@ public class JavaSqlTimeStampValueSemant
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.timestamp");
-    		will(returnValue(null));
-    	}});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.timestamp");
+                will(returnValue(null));
+            }
+        });
 
         TestClock.initialize();
         timestamp = new Timestamp(0);
@@ -79,4 +79,3 @@ public class JavaSqlTimeStampValueSemant
         assertEquals(((Timestamp) timestamp).getTime(), ((Timestamp) restored).getTime());
     }
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaSqlTimeValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -25,17 +24,16 @@ import static org.junit.Assert.assertEqu
 import java.sql.Time;
 import java.util.Calendar;
 
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
+import org.apache.isis.core.progmodel.facets.value.timesql.JavaSqlTimeValueSemanticsProvider;
 import org.jmock.Expectations;
 import org.jmock.integration.junit4.JMock;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
-import org.apache.isis.core.progmodel.facets.value.timesql.JavaSqlTimeValueSemanticsProvider;
-
 @RunWith(JMock.class)
 public class JavaSqlTimeValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
 
@@ -46,13 +44,15 @@ public class JavaSqlTimeValueSemanticsPr
 
     @Before
     public void setUpObjects() throws Exception {
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.time");
-        	will(returnValue(null));
-        }});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.time");
+                will(returnValue(null));
+            }
+        });
 
         final Calendar c = Calendar.getInstance();
-        //c.setTimeZone(TestClock.timeZone);
+        // c.setTimeZone(TestClock.timeZone);
 
         c.set(Calendar.MILLISECOND, 0);
 
@@ -89,4 +89,3 @@ public class JavaSqlTimeValueSemanticsPr
         assertEquals("14:00:00", newValue.toString());
     }
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/JavaUtilDateValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -27,17 +26,16 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.TimeZone;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.dateutil.JavaUtilDateValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class JavaUtilDateValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -47,10 +45,12 @@ public class JavaUtilDateValueSemanticsP
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.datetime");
-    		will(returnValue(null));
-    	}});
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.datetime");
+                will(returnValue(null));
+            }
+        });
 
         TestClock.initialize();
         date = new java.util.Date(0);
@@ -69,12 +69,14 @@ public class JavaUtilDateValueSemanticsP
         try {
             getValue().parseTextEntry(null, "invalid entry");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     /**
-     * Something rather bizarre here, that the epoch formats as 01:00 rather than 00:00. It's obviously
-     * because of some sort of timezone issue, but I don't know where that dependency is coming from.
+     * Something rather bizarre here, that the epoch formats as 01:00 rather
+     * than 00:00. It's obviously because of some sort of timezone issue, but I
+     * don't know where that dependency is coming from.
      */
     @Test
     public void testTitleOf() {

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/LongValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/LongValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/LongValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/LongValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,24 +17,22 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.longs.LongValueSemanticsProviderAbstract;
 import org.apache.isis.core.progmodel.facets.value.longs.LongWrapperValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class LongValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -49,12 +47,13 @@ public class LongValueSemanticsProviderT
         longObj = new Long(367322);
         allowMockAdapterToReturn(longObj);
         holder = new FacetHolderImpl();
-        
-        mockery.checking(new Expectations(){{
-        	allowing(mockConfiguration).getString("isis.value.format.long");
-        	will(returnValue(null));
-        }});
 
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.long");
+                will(returnValue(null));
+            }
+        });
 
         setValue(value = new LongWrapperValueSemanticsProvider(holder, mockConfiguration, mockContext));
     }
@@ -64,7 +63,8 @@ public class LongValueSemanticsProviderT
         try {
             value.parseTextEntry(null, "one");
             fail();
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/MoneyValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/MoneyValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/MoneyValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/MoneyValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
@@ -25,17 +24,16 @@ import static org.junit.Assert.fail;
 
 import java.util.Locale;
 
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.applib.value.Money;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
 import org.apache.isis.core.progmodel.facets.value.money.MoneyValueSemanticsProvider;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class MoneyValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -50,7 +48,7 @@ public class MoneyValueSemanticsProvider
     public void setUpObjects() throws Exception {
         Locale.setDefault(Locale.UK);
         setupSpecification(Money.class);
-      //  originalMoney = new Money(10.5, "gbp");
+        // originalMoney = new Money(10.5, "gbp");
         holder = new FacetHolderImpl();
         setValue(adapter = new MoneyValueSemanticsProvider(holder, mockConfiguration, mockContext));
     }
@@ -110,7 +108,8 @@ public class MoneyValueSemanticsProvider
 
     @Test
     public void testReplacementEntryForDefaultCurrency() {
-        // MoneyValueSemanticsProvider adapter = new MoneyValueSemanticsProvider(new Money(10.3, "gbp"));
+        // MoneyValueSemanticsProvider adapter = new
+        // MoneyValueSemanticsProvider(new Money(10.3, "gbp"));
         final Object parsed = adapter.parseTextEntry(originalMoney, POUND_SYMBOL + "80.90");
         assertEquals(new Money(80.90, "gbp"), parsed);
     }
@@ -123,7 +122,8 @@ public class MoneyValueSemanticsProvider
 
     @Test
     public void testUsingLocalCurrencySymbol() {
-        // MoneyValueSemanticsProvider adapter = new MoneyValueSemanticsProvider(new Money(0L, "gbp"));
+        // MoneyValueSemanticsProvider adapter = new
+        // MoneyValueSemanticsProvider(new Money(0L, "gbp"));
         final Object parsed = adapter.parseTextEntry(originalMoney, POUND_SYMBOL + "3021.50");
         assertEquals(POUND_SYMBOL + "3,021.50", adapter.titleString(parsed, null));
     }
@@ -133,7 +133,8 @@ public class MoneyValueSemanticsProvider
         try {
             adapter.parseTextEntry(originalMoney, "3021.50  XYZ");
             fail("invalid code accepted " + adapter);
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -141,7 +142,8 @@ public class MoneyValueSemanticsProvider
         try {
             adapter.parseTextEntry(originalMoney, EURO_SYMBOL + "3021.50");
             fail("invalid code accepted " + adapter);
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
     @Test
@@ -156,8 +158,8 @@ public class MoneyValueSemanticsProvider
         try {
             adapter.parseTextEntry(money, "$3021.50");
             fail("invalid code accepted " + adapter);
-        } catch (final TextEntryParseException expected) {}
+        } catch (final TextEntryParseException expected) {
+        }
     }
 
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PasswordValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PasswordValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PasswordValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PasswordValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,20 +17,18 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.value.Password;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.progmodel.facets.value.password.PasswordValueSemanticsProvider;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class PasswordValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -51,4 +49,3 @@ public class PasswordValueSemanticsProvi
         assertEquals("secret", adapter.toEncodedString(password));
     }
 }
-

Modified: incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PercentageValueSemanticsProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PercentageValueSemanticsProviderTest.java?rev=1234453&r1=1234452&r2=1234453&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PercentageValueSemanticsProviderTest.java (original)
+++ incubator/isis/trunk/framework/core/progmodel/src/test/java/org/apache/isis/core/progmodel/facets/value/PercentageValueSemanticsProviderTest.java Sun Jan 22 06:58:43 2012
@@ -17,22 +17,20 @@
  *  under the License.
  */
 
-
 package org.apache.isis.core.progmodel.facets.value;
 
 import static org.junit.Assert.assertEquals;
 
-import org.jmock.Expectations;
-import org.jmock.integration.junit4.JMock;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
 import org.apache.isis.applib.profiles.Localization;
 import org.apache.isis.applib.value.Percentage;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
 import org.apache.isis.core.progmodel.facets.value.percentage.PercentageValueSemanticsProvider;
+import org.jmock.Expectations;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 @RunWith(JMock.class)
 public class PercentageValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {
@@ -42,18 +40,20 @@ public class PercentageValueSemanticsPro
 
     @Before
     public void setUpObjects() throws Exception {
-    	mockery.checking(new Expectations(){{
-    		allowing(mockConfiguration).getString("isis.value.format.percentage");
-    		will(returnValue(null));
-    	}});
-    	
+        mockery.checking(new Expectations() {
+            {
+                allowing(mockConfiguration).getString("isis.value.format.percentage");
+                will(returnValue(null));
+            }
+        });
+
         setupSpecification(Percentage.class);
-        
+
         percentage = new Percentage(0.105f);
         allowMockAdapterToReturn(percentage);
-        
+
         holder = new FacetHolderImpl();
-        
+
         setValue(adapter = new PercentageValueSemanticsProvider(holder, mockConfiguration, mockContext));
     }
 
@@ -98,4 +98,3 @@ public class PercentageValueSemanticsPro
     }
 
 }
-



Mime
View raw message