incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1234460 [15/30] - in /incubator/isis/trunk/framework/viewer: bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/components/ bdd/common/src/main/java/org/apache/isis/viewer...
Date Sun, 22 Jan 2012 08:05:57 GMT
Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/PathNode.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/PathNode.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/PathNode.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/PathNode.java Sun Jan 22 08:05:17 2012
@@ -16,8 +16,8 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib.util;
-
+package org.apache.isis.viewer.json.applib.util;
+
 import java.util.Collections;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -28,97 +28,105 @@ import org.apache.isis.viewer.json.appli
 import com.google.common.base.Objects;
 import com.google.common.base.Splitter;
 import com.google.common.collect.Maps;
-
-public class PathNode {
-    private static final Pattern NODE = Pattern.compile("^([^\\[]*)(\\[(.+)\\])?$");
-    private static final Pattern WHITESPACE = Pattern.compile("\\s+");
-    private static final Pattern KEY_VALUE = Pattern.compile("^([^=]+)=(.+)$");
-    
-    public static final PathNode NULL = new PathNode("", Collections.<String,String>emptyMap());
-    
-    public static PathNode parse(String path) {
-        Matcher nodeMatcher = NODE.matcher(path);
-        if(!nodeMatcher.matches()) {
-            return null;
-        } 
-        final int groupCount = nodeMatcher.groupCount();
-        if(groupCount < 1) {
-            return null;
-        }
-        final String key = nodeMatcher.group(1);
-        final Map<String, String> criteria = Maps.newHashMap();
-        final String criteriaStr = nodeMatcher.group(3);
-        if(criteriaStr != null) {
-            for (String criterium : Splitter.on(WHITESPACE).split(criteriaStr)) {
-                final Matcher keyValueMatcher = KEY_VALUE.matcher(criterium);
-                if(keyValueMatcher.matches()) {
-                    criteria.put(keyValueMatcher.group(1), keyValueMatcher.group(2));
-                }
-            }
-        }
-
-        return new PathNode(key, criteria);
-    }
-    
-    private final String key;
-    private final Map<String,String> criteria;
-    private PathNode(String key, Map<String, String> criteria) {
-        this.key = key;
-        this.criteria = Collections.unmodifiableMap(criteria);
-    }
-    public String getKey() {
-        return key;
-    }
-    public Map<String, String> getCriteria() {
-        return criteria;
-    }
-
-    public boolean hasCriteria() {
-        return !getCriteria().isEmpty();
-    }
-
-    public boolean matches(JsonRepresentation repr) {
-        if(!repr.isMap()) {
-            return false;
-        }
-        for(Map.Entry<String,String> criterium: getCriteria().entrySet()) {
-            final String requiredValue = criterium.getValue();
-            final String actualValue = repr.getString(criterium.getKey());
-            if(!Objects.equal(requiredValue, actualValue)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        return result;
-    }
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        PathNode other = (PathNode) obj;
-        if (key == null) {
-            if (other.key != null)
-                return false;
-        } else if (!key.equals(other.key))
-            return false;
-        return true;
-    }
-    
-    @Override
-    public String toString() {
-        return key + (criteria.isEmpty()?"":criteria);
+
+public class PathNode {
+    private static final Pattern NODE = Pattern.compile("^([^\\[]*)(\\[(.+)\\])?$");
+    private static final Pattern WHITESPACE = Pattern.compile("\\s+");
+    private static final Pattern KEY_VALUE = Pattern.compile("^([^=]+)=(.+)$");
+
+    public static final PathNode NULL = new PathNode("", Collections.<String, String> emptyMap());
+
+    public static PathNode parse(final String path) {
+        final Matcher nodeMatcher = NODE.matcher(path);
+        if (!nodeMatcher.matches()) {
+            return null;
+        }
+        final int groupCount = nodeMatcher.groupCount();
+        if (groupCount < 1) {
+            return null;
+        }
+        final String key = nodeMatcher.group(1);
+        final Map<String, String> criteria = Maps.newHashMap();
+        final String criteriaStr = nodeMatcher.group(3);
+        if (criteriaStr != null) {
+            for (final String criterium : Splitter.on(WHITESPACE).split(criteriaStr)) {
+                final Matcher keyValueMatcher = KEY_VALUE.matcher(criterium);
+                if (keyValueMatcher.matches()) {
+                    criteria.put(keyValueMatcher.group(1), keyValueMatcher.group(2));
+                }
+            }
+        }
+
+        return new PathNode(key, criteria);
+    }
+
+    private final String key;
+    private final Map<String, String> criteria;
+
+    private PathNode(final String key, final Map<String, String> criteria) {
+        this.key = key;
+        this.criteria = Collections.unmodifiableMap(criteria);
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public Map<String, String> getCriteria() {
+        return criteria;
     }
-    
-    
+
+    public boolean hasCriteria() {
+        return !getCriteria().isEmpty();
+    }
+
+    public boolean matches(final JsonRepresentation repr) {
+        if (!repr.isMap()) {
+            return false;
+        }
+        for (final Map.Entry<String, String> criterium : getCriteria().entrySet()) {
+            final String requiredValue = criterium.getValue();
+            final String actualValue = repr.getString(criterium.getKey());
+            if (!Objects.equal(requiredValue, actualValue)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((key == null) ? 0 : key.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final PathNode other = (PathNode) obj;
+        if (key == null) {
+            if (other.key != null) {
+                return false;
+            }
+        } else if (!key.equals(other.key)) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return key + (criteria.isEmpty() ? "" : criteria);
+    }
+
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/UrlEncodingUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/UrlEncodingUtils.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/UrlEncodingUtils.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/util/UrlEncodingUtils.java Sun Jan 22 08:05:17 2012
@@ -16,60 +16,61 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib.util;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.List;
-
-import org.codehaus.jackson.JsonNode;
-
-import com.google.common.base.Charsets;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-
-public final class UrlEncodingUtils {
-
-    public final static Function<String, String> FUNCTION = new Function<String, String>() {
-        
-        @Override
-        public String apply(String input) {
-            try {
-                return URLDecoder.decode(input, "UTF-8");
-            } catch (UnsupportedEncodingException e) {
-                return "";
-            }
-        }
-    };
-
-    private UrlEncodingUtils() {}
-
-    public static String urlDecode(String string) {
-        return FUNCTION.apply(string);
-    }
-
-    public static List<String> urlDecode(List<String> values) {
-        return Lists.transform(values, FUNCTION);
-    }
-
-    public static String[] urlDecode(String[] values) {
-        final List<String> asList = Arrays.asList(values);
-        return urlDecode(asList).toArray(new String[]{});
-    }
-
-    public static String asUrlEncoded(JsonNode jsonNode) {
-        return UrlEncodingUtils.asUrlEncoded(jsonNode.toString());
-    }
-
-    public static String asUrlEncoded(final String str) {
-        try {
-            return URLEncoder.encode(str, Charsets.UTF_8.name());
-        } catch (UnsupportedEncodingException e) {
-            // shouldn't happen
-            throw new RuntimeException(e);
-        }
-    }
-
-}
+package org.apache.isis.viewer.json.applib.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.List;
+
+import org.codehaus.jackson.JsonNode;
+
+import com.google.common.base.Charsets;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+
+public final class UrlEncodingUtils {
+
+    public final static Function<String, String> FUNCTION = new Function<String, String>() {
+
+        @Override
+        public String apply(final String input) {
+            try {
+                return URLDecoder.decode(input, "UTF-8");
+            } catch (final UnsupportedEncodingException e) {
+                return "";
+            }
+        }
+    };
+
+    private UrlEncodingUtils() {
+    }
+
+    public static String urlDecode(final String string) {
+        return FUNCTION.apply(string);
+    }
+
+    public static List<String> urlDecode(final List<String> values) {
+        return Lists.transform(values, FUNCTION);
+    }
+
+    public static String[] urlDecode(final String[] values) {
+        final List<String> asList = Arrays.asList(values);
+        return urlDecode(asList).toArray(new String[] {});
+    }
+
+    public static String asUrlEncoded(final JsonNode jsonNode) {
+        return UrlEncodingUtils.asUrlEncoded(jsonNode.toString());
+    }
+
+    public static String asUrlEncoded(final String str) {
+        try {
+            return URLEncoder.encode(str, Charsets.UTF_8.name());
+        } catch (final UnsupportedEncodingException e) {
+            // shouldn't happen
+            throw new RuntimeException(e);
+        }
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionRepresentation.java Sun Jan 22 08:05:17 2012
@@ -16,20 +16,20 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib.version;
-
+package org.apache.isis.viewer.json.applib.version;
+
 import org.apache.isis.viewer.json.applib.JsonRepresentation;
 import org.apache.isis.viewer.json.applib.domainobjects.DomainRepresentation;
 import org.codehaus.jackson.JsonNode;
-
-public class VersionRepresentation extends DomainRepresentation  {
-
-    public VersionRepresentation(JsonNode jsonNode) {
-        super(jsonNode);
-    }
-
-    public JsonRepresentation getOptionalCapabilities() {
-        return getMap("optionalCapabilities");
-    }
-
-}
+
+public class VersionRepresentation extends DomainRepresentation {
+
+    public VersionRepresentation(final JsonNode jsonNode) {
+        super(jsonNode);
+    }
+
+    public JsonRepresentation getOptionalCapabilities() {
+        return getMap("optionalCapabilities");
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/main/java/org/apache/isis/viewer/json/applib/version/VersionResource.java Sun Jan 22 08:05:17 2012
@@ -32,7 +32,7 @@ public interface VersionResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_VERSION })
-    @ClientResponseType(entityType=String.class)
+    @ClientResponseType(entityType = String.class)
     public Response version();
 
 }
\ No newline at end of file

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/DomainObjectRepresentationTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/DomainObjectRepresentationTest.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/DomainObjectRepresentationTest.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/DomainObjectRepresentationTest.java Sun Jan 22 08:05:17 2012
@@ -35,12 +35,11 @@ import org.junit.Test;
 public class DomainObjectRepresentationTest {
 
     private DomainObjectRepresentation representation;
-    
+
     @Before
     public void setUp() throws Exception {
         representation = new DomainObjectRepresentation(readJson("domainObjectRepresentation.json"));
     }
-    
 
     @Test
     public void xx() throws JsonParseException, JsonMappingException, IOException {

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/HttpMethodTest_setUp.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/HttpMethodTest_setUp.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/HttpMethodTest_setUp.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/HttpMethodTest_setUp.java Sun Jan 22 08:05:17 2012
@@ -16,82 +16,78 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
+package org.apache.isis.viewer.json.applib;
+
 import java.io.UnsupportedEncodingException;
 
 import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
 import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
-import org.apache.isis.viewer.json.applib.ClientRequestConfigurer;
-import org.apache.isis.viewer.json.applib.HttpMethod;
-import org.apache.isis.viewer.json.applib.JsonRepresentation;
 import org.jmock.Expectations;
 import org.jmock.auto.Mock;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
-
-public class HttpMethodTest_setUp {
+
+public class HttpMethodTest_setUp {
 
     @Rule
-    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES); 
-    
-    @Mock
+    public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+    @Mock
     private ClientRequestConfigurer requestConfigurer;
-    
+
     private JsonRepresentation repr;
-
-    @Before
-    public void setUp() throws Exception {
-        repr = JsonRepresentation.newMap();
-        repr.mapPut("aString", "bar"); 
-        repr.mapPut("anInt", 3); 
-        repr.mapPut("aLong", 31231231L); 
-        repr.mapPut("aBoolean", true); 
-        repr.mapPut("aStringRequiringEncoding", "http://localhost:8080/somewhere");
-    }
-    
-    @Test
-    public void get() throws Exception {
-        setsUpQueryString(HttpMethod.GET);
-    }
-
-    @Test
-    public void delete() throws Exception {
-        setsUpQueryString(HttpMethod.DELETE);
-    }
-
-    @Test
-    public void post() throws Exception {
-        setsUpBody(HttpMethod.POST);
-    }
-
-    @Test
-    public void put() throws Exception {
-        setsUpBody(HttpMethod.PUT);
-    }
-
-
-    private void setsUpQueryString(final HttpMethod httpMethod) throws UnsupportedEncodingException {
-        context.checking(new Expectations() {
-            {
+
+    @Before
+    public void setUp() throws Exception {
+        repr = JsonRepresentation.newMap();
+        repr.mapPut("aString", "bar");
+        repr.mapPut("anInt", 3);
+        repr.mapPut("aLong", 31231231L);
+        repr.mapPut("aBoolean", true);
+        repr.mapPut("aStringRequiringEncoding", "http://localhost:8080/somewhere");
+    }
+
+    @Test
+    public void get() throws Exception {
+        setsUpQueryString(HttpMethod.GET);
+    }
+
+    @Test
+    public void delete() throws Exception {
+        setsUpQueryString(HttpMethod.DELETE);
+    }
+
+    @Test
+    public void post() throws Exception {
+        setsUpBody(HttpMethod.POST);
+    }
+
+    @Test
+    public void put() throws Exception {
+        setsUpBody(HttpMethod.PUT);
+    }
+
+    private void setsUpQueryString(final HttpMethod httpMethod) throws UnsupportedEncodingException {
+        context.checking(new Expectations() {
+            {
                 one(requestConfigurer).setHttpMethod(httpMethod);
-                one(requestConfigurer).queryString(repr);
-            }
-        });
-        
-        httpMethod.setUpArgs(requestConfigurer, repr);
-    }
-
-    private void setsUpBody(final HttpMethod httpMethod) throws UnsupportedEncodingException {
-        context.checking(new Expectations() {
-            {
-                one(requestConfigurer).setHttpMethod(httpMethod);
-                one(requestConfigurer).body(repr);
-            }
-        });
-        
-        httpMethod.setUpArgs(requestConfigurer, repr);
-    }
-
-}
+                one(requestConfigurer).queryString(repr);
+            }
+        });
+
+        httpMethod.setUpArgs(requestConfigurer, repr);
+    }
+
+    private void setsUpBody(final HttpMethod httpMethod) throws UnsupportedEncodingException {
+        context.checking(new Expectations() {
+            {
+                one(requestConfigurer).setHttpMethod(httpMethod);
+                one(requestConfigurer).body(repr);
+            }
+        });
+
+        httpMethod.setUpArgs(requestConfigurer, repr);
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonFixture.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonFixture.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonFixture.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonFixture.java Sun Jan 22 08:05:17 2012
@@ -29,10 +29,11 @@ import com.google.common.base.Charsets;
 import com.google.common.io.Resources;
 
 class JsonFixture {
-    
-    private JsonFixture(){}
 
-    public static JsonNode readJson(String resourceName) throws JsonParseException, JsonMappingException, IOException {
+    private JsonFixture() {
+    }
+
+    public static JsonNode readJson(final String resourceName) throws JsonParseException, JsonMappingException, IOException {
         return JsonMapper.instance().read(Resources.toString(Resources.getResource(JsonFixture.class, resourceName), Charsets.UTF_8), JsonNode.class);
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayGet_arraySetElementAt.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayGet_arraySetElementAt.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayGet_arraySetElementAt.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayGet_arraySetElementAt.java Sun Jan 22 08:05:17 2012
@@ -36,20 +36,20 @@ public class JsonRepresentationTest_arra
     private JsonRepresentation jsonRepresentation;
     private JsonRepresentation arrayRepr;
     private JsonRepresentation objectRepr;
-    
+
     @Before
     public void setUp() throws Exception {
         arrayRepr = JsonRepresentation.newArray();
         objectRepr = JsonRepresentation.newMap();
     }
-    
-    @Test(expected=IndexOutOfBoundsException.class)
+
+    @Test(expected = IndexOutOfBoundsException.class)
     public void arrayGet_outOfBounds() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("emptyList.json"));
         jsonRepresentation.arrayGet(0);
     }
 
-    @Test(expected=IndexOutOfBoundsException.class)
+    @Test(expected = IndexOutOfBoundsException.class)
     public void arraySetElementAt_outOfBounds() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("emptyList.json"));
         jsonRepresentation.arraySetElementAt(0, objectRepr);
@@ -67,22 +67,22 @@ public class JsonRepresentationTest_arra
         jsonRepresentation.arraySetElementAt(0, objectRepr);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void arraySetElementAt_forAttemptingToSetElementToArray() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("list.json"));
         jsonRepresentation.arraySetElementAt(0, arrayRepr);
     }
-    
-    @Test(expected=IllegalStateException.class)
+
+    @Test(expected = IllegalStateException.class)
     public void arrayGet_forMap() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("emptyMap.json"));
         jsonRepresentation.arrayGet(0);
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void arrayGet_forValue() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
-        JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
+        final JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
         valueRepresentation.arrayGet(0);
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayIterator.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayIterator.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayIterator.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_arrayIterator.java Sun Jan 22 08:05:17 2012
@@ -32,11 +32,11 @@ import org.junit.Test;
 public class JsonRepresentationTest_arrayIterator {
 
     private JsonRepresentation jsonRepresentation;
-    
+
     @Test
     public void forJsonRepresentation() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("list.json"));
-        Iterator<JsonRepresentation> arrayIterator = jsonRepresentation.arrayIterator(JsonRepresentation.class);
+        final Iterator<JsonRepresentation> arrayIterator = jsonRepresentation.arrayIterator(JsonRepresentation.class);
         assertThat(arrayIterator.hasNext(), is(true));
         assertThat(arrayIterator.next().getString("a"), is("a1"));
         assertThat(arrayIterator.hasNext(), is(true));
@@ -47,7 +47,7 @@ public class JsonRepresentationTest_arra
     @Test
     public void forString() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("listOfStrings.json"));
-        Iterator<String> arrayIterator = jsonRepresentation.arrayIterator(String.class);
+        final Iterator<String> arrayIterator = jsonRepresentation.arrayIterator(String.class);
         assertThat(arrayIterator.hasNext(), is(true));
         assertThat(arrayIterator.next(), is("a"));
         assertThat(arrayIterator.hasNext(), is(true));
@@ -57,5 +57,4 @@ public class JsonRepresentationTest_arra
         assertThat(arrayIterator.hasNext(), is(false));
     }
 
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_asInputStream.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_asInputStream.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_asInputStream.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_asInputStream.java Sun Jan 22 08:05:17 2012
@@ -43,18 +43,17 @@ public class JsonRepresentationTest_asIn
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void asInputStream() throws JsonParseException, JsonMappingException, IOException {
-        InputStream array = jsonRepresentation.asInputStream();
+        final InputStream array = jsonRepresentation.asInputStream();
 
-        ByteArrayOutputStream to = new ByteArrayOutputStream();
+        final ByteArrayOutputStream to = new ByteArrayOutputStream();
         com.google.common.io.ByteStreams.copy(array, to);
-        
-        String jsonStr = to.toString(Charsets.UTF_8.name());
-        
+
+        final String jsonStr = to.toString(Charsets.UTF_8.name());
+
         assertThat(jsonStr, is(not(nullValue())));
     }
 
-    
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getArray.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getArray.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getArray.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getArray.java Sun Jan 22 08:05:17 2012
@@ -40,17 +40,17 @@ public class JsonRepresentationTest_getA
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void nonEmptyArray() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation array = jsonRepresentation.getArray("aStringArray");
+        final JsonRepresentation array = jsonRepresentation.getArray("aStringArray");
         assertThat(array, is(not(nullValue())));
         assertThat(array.size(), is(3));
     }
 
     @Test
     public void emptyArray() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation array = jsonRepresentation.getArray("anEmptyArray");
+        final JsonRepresentation array = jsonRepresentation.getArray("anEmptyArray");
         assertThat(array, is(not(nullValue())));
         assertThat(array.size(), is(0));
     }
@@ -65,7 +65,7 @@ public class JsonRepresentationTest_getA
         try {
             jsonRepresentation.getArray("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not an array"));
         }
     }
@@ -75,9 +75,9 @@ public class JsonRepresentationTest_getA
         try {
             jsonRepresentation.getArray("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not an array"));
         }
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBigInteger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBigInteger.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBigInteger.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBigInteger.java Sun Jan 22 08:05:17 2012
@@ -40,7 +40,7 @@ public class JsonRepresentationTest_getB
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getBigInteger("aBigInteger"), is(new BigInteger("12345678901234534132452342342789678234234")));
@@ -56,7 +56,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBigInteger("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not a biginteger"));
         }
     }
@@ -66,7 +66,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBigInteger("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not a biginteger"));
         }
     }
@@ -76,7 +76,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBigInteger("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not a biginteger"));
         }
     }
@@ -85,5 +85,5 @@ public class JsonRepresentationTest_getB
     public void forMultipartKey() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getDouble("aSubMap.aDouble"), is(12345678901234534.4567));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBoolean.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBoolean.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBoolean.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getBoolean.java Sun Jan 22 08:05:17 2012
@@ -39,7 +39,7 @@ public class JsonRepresentationTest_getB
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getBoolean("aBoolean"), is(true));
@@ -55,7 +55,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBoolean("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not a boolean"));
         }
     }
@@ -65,7 +65,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBoolean("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not a boolean"));
         }
     }
@@ -75,7 +75,7 @@ public class JsonRepresentationTest_getB
         try {
             jsonRepresentation.getBoolean("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not a boolean"));
         }
     }
@@ -84,5 +84,5 @@ public class JsonRepresentationTest_getB
     public void forMultipartKey() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getBoolean("aSubMap.aBoolean"), is(true));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getDouble.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getDouble.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getDouble.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getDouble.java Sun Jan 22 08:05:17 2012
@@ -39,7 +39,7 @@ public class JsonRepresentationTest_getD
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getDouble("aDouble"), is(12345678901234534.3242));
@@ -55,7 +55,7 @@ public class JsonRepresentationTest_getD
         try {
             jsonRepresentation.getDouble("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not a double"));
         }
     }
@@ -65,7 +65,7 @@ public class JsonRepresentationTest_getD
         try {
             jsonRepresentation.getDouble("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not a double"));
         }
     }
@@ -75,7 +75,7 @@ public class JsonRepresentationTest_getD
         try {
             jsonRepresentation.getDouble("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not a double"));
         }
     }
@@ -84,5 +84,5 @@ public class JsonRepresentationTest_getD
     public void forMultipartKey() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getDouble("aSubMap.aDouble"), is(12345678901234534.4567));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getInt.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getInt.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getInt.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getInt.java Sun Jan 22 08:05:17 2012
@@ -39,7 +39,7 @@ public class JsonRepresentationTest_getI
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getInt("anInt"), is(123));
@@ -55,7 +55,7 @@ public class JsonRepresentationTest_getI
         try {
             jsonRepresentation.getInt("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not an int"));
         }
     }
@@ -65,7 +65,7 @@ public class JsonRepresentationTest_getI
         try {
             jsonRepresentation.getInt("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not an int"));
         }
     }
@@ -75,7 +75,7 @@ public class JsonRepresentationTest_getI
         try {
             jsonRepresentation.getInt("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not an int"));
         }
     }
@@ -84,5 +84,5 @@ public class JsonRepresentationTest_getI
     public void forMultipartKey() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getInt("aSubMap.anInt"), is(456));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLink_isLink.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLink_isLink.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLink_isLink.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLink_isLink.java Sun Jan 22 08:05:17 2012
@@ -16,84 +16,83 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
-import static org.apache.isis.viewer.json.applib.JsonFixture.readJson;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.io.IOException;
-
+package org.apache.isis.viewer.json.applib;
+
+import static org.apache.isis.viewer.json.applib.JsonFixture.readJson;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+
 import org.apache.isis.viewer.json.applib.links.LinkRepresentation;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JsonRepresentationTest_getLink_isLink {
-
-    private LinkRepresentation link;
-    private JsonRepresentation jsonRepresentation;
-
-    @Before
-    public void setUp() throws Exception {
-        link = new LinkRepresentation().withHref("http://foo/bar").withMethod(HttpMethod.GET);
-        jsonRepresentation = new JsonRepresentation(readJson("map.json"));
-    }
-
-    @Test
-    public void forLink_whenSimpleKey() throws JsonParseException, JsonMappingException, IOException {
-        link.withRel("someRel");
-        assertThat(jsonRepresentation.isLink("aLink"), is(true));
-        assertThat(jsonRepresentation.getLink("aLink"), is(link));
-    }
-
-    @Test
-    public void forLink_whenMultipartKey() throws JsonParseException, JsonMappingException, IOException {
-        link.withRel("someSubRel");
-        assertThat(jsonRepresentation.isLink("aSubMap.aLink"), is(true));
-        assertThat(jsonRepresentation.getLink("aSubMap.aLink"), is(link));
-    }
-    
-
-    @Test
-    public void forNonExistent() throws JsonParseException, JsonMappingException, IOException {
-        assertThat(jsonRepresentation.isLink("doesNotExist"), is(false));
-        assertThat(jsonRepresentation.getLink("doesNotExist"), is(nullValue()));
-    }
-
-    @Test
-    public void forValue() throws JsonParseException, JsonMappingException, IOException {
-        assertThat(jsonRepresentation.isLink("anInt"), is(false));
-        try {
-            jsonRepresentation.getLink("anInt");
-            fail();
-        } catch (IllegalArgumentException e) {
-            assertThat(e.getMessage(), is("'anInt' is a value that does not represent a link"));
-        }
-    }
-
-    @Test
-    public void forMap() throws JsonParseException, JsonMappingException, IOException {
-        assertThat(jsonRepresentation.isLink("aSubMap"), is(false));
-        try {
-            jsonRepresentation.getLink("aSubMap");
-            fail();
-        } catch (IllegalArgumentException e) {
-            assertThat(e.getMessage(), is("'aSubMap' is a map that does not fully represent a link"));
-        }
-    }
-
-    @Test
-    public void forList() throws JsonParseException, JsonMappingException, IOException {
-        assertThat(jsonRepresentation.isLink("aSubList"), is(false));
-        try {
-            jsonRepresentation.getLink("aSubList");
-            fail();
-        } catch (IllegalArgumentException e) {
-            assertThat(e.getMessage(), is("'aSubList' is an array that does not represent a link"));
-        }
-    }
-}
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.junit.Before;
+import org.junit.Test;
+
+public class JsonRepresentationTest_getLink_isLink {
+
+    private LinkRepresentation link;
+    private JsonRepresentation jsonRepresentation;
+
+    @Before
+    public void setUp() throws Exception {
+        link = new LinkRepresentation().withHref("http://foo/bar").withMethod(HttpMethod.GET);
+        jsonRepresentation = new JsonRepresentation(readJson("map.json"));
+    }
+
+    @Test
+    public void forLink_whenSimpleKey() throws JsonParseException, JsonMappingException, IOException {
+        link.withRel("someRel");
+        assertThat(jsonRepresentation.isLink("aLink"), is(true));
+        assertThat(jsonRepresentation.getLink("aLink"), is(link));
+    }
+
+    @Test
+    public void forLink_whenMultipartKey() throws JsonParseException, JsonMappingException, IOException {
+        link.withRel("someSubRel");
+        assertThat(jsonRepresentation.isLink("aSubMap.aLink"), is(true));
+        assertThat(jsonRepresentation.getLink("aSubMap.aLink"), is(link));
+    }
+
+    @Test
+    public void forNonExistent() throws JsonParseException, JsonMappingException, IOException {
+        assertThat(jsonRepresentation.isLink("doesNotExist"), is(false));
+        assertThat(jsonRepresentation.getLink("doesNotExist"), is(nullValue()));
+    }
+
+    @Test
+    public void forValue() throws JsonParseException, JsonMappingException, IOException {
+        assertThat(jsonRepresentation.isLink("anInt"), is(false));
+        try {
+            jsonRepresentation.getLink("anInt");
+            fail();
+        } catch (final IllegalArgumentException e) {
+            assertThat(e.getMessage(), is("'anInt' is a value that does not represent a link"));
+        }
+    }
+
+    @Test
+    public void forMap() throws JsonParseException, JsonMappingException, IOException {
+        assertThat(jsonRepresentation.isLink("aSubMap"), is(false));
+        try {
+            jsonRepresentation.getLink("aSubMap");
+            fail();
+        } catch (final IllegalArgumentException e) {
+            assertThat(e.getMessage(), is("'aSubMap' is a map that does not fully represent a link"));
+        }
+    }
+
+    @Test
+    public void forList() throws JsonParseException, JsonMappingException, IOException {
+        assertThat(jsonRepresentation.isLink("aSubList"), is(false));
+        try {
+            jsonRepresentation.getLink("aSubList");
+            fail();
+        } catch (final IllegalArgumentException e) {
+            assertThat(e.getMessage(), is("'aSubList' is an array that does not represent a link"));
+        }
+    }
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLong.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLong.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLong.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getLong.java Sun Jan 22 08:05:17 2012
@@ -39,7 +39,7 @@ public class JsonRepresentationTest_getL
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getLong("aLong"), is(1234567890123L));
@@ -55,7 +55,7 @@ public class JsonRepresentationTest_getL
         try {
             jsonRepresentation.getLong("aString");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aString' is not a long"));
         }
     }
@@ -65,7 +65,7 @@ public class JsonRepresentationTest_getL
         try {
             jsonRepresentation.getLong("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not a long"));
         }
     }
@@ -75,7 +75,7 @@ public class JsonRepresentationTest_getL
         try {
             jsonRepresentation.getLong("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not a long"));
         }
     }
@@ -84,5 +84,5 @@ public class JsonRepresentationTest_getL
     public void forMultipartKey() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.getLong("aSubMap.aLong"), is(1234567890456L));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getNull_isNull.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getNull_isNull.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getNull_isNull.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getNull_isNull.java Sun Jan 22 08:05:17 2012
@@ -40,20 +40,20 @@ public class JsonRepresentationTest_getN
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void forNullValue() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation nullValue = jsonRepresentation.getNull("aNull");
+        final JsonRepresentation nullValue = jsonRepresentation.getNull("aNull");
         assertThat(nullValue, is(not(nullValue())));
         assertThat(nullValue.isNull(), is(true));
-        
-        Boolean isNull = jsonRepresentation.isNull("aNull");
+
+        final Boolean isNull = jsonRepresentation.isNull("aNull");
         assertThat(isNull, is(true));
     }
 
     @Test
     public void isNull_forArray() throws JsonParseException, JsonMappingException, IOException {
-        Boolean isNull = jsonRepresentation.isNull("anEmptyArray");
+        final Boolean isNull = jsonRepresentation.isNull("anEmptyArray");
         assertThat(isNull, is(false));
     }
 
@@ -62,14 +62,14 @@ public class JsonRepresentationTest_getN
         try {
             jsonRepresentation.getNull("anEmptyArray");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'anEmptyArray' is not the null value"));
         }
     }
 
     @Test
     public void isNull_forNonExistent() {
-        Boolean isNull = jsonRepresentation.isNull("nonExistent");
+        final Boolean isNull = jsonRepresentation.isNull("nonExistent");
         assertThat(isNull, is(nullValue())); // ie don't know whether is null
     }
 
@@ -80,7 +80,7 @@ public class JsonRepresentationTest_getN
 
     @Test
     public void isNull_forMap() throws JsonParseException, JsonMappingException, IOException {
-        Boolean isNull = jsonRepresentation.isNull("aSubMap");
+        final Boolean isNull = jsonRepresentation.isNull("aSubMap");
         assertThat(isNull, is(false));
     }
 
@@ -89,9 +89,9 @@ public class JsonRepresentationTest_getN
         try {
             jsonRepresentation.getNull("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not the null value"));
         }
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getRepresentation.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getRepresentation.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getRepresentation.java Sun Jan 22 08:05:17 2012
@@ -38,10 +38,10 @@ public class JsonRepresentationTest_getR
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void forMap() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation mapRepresentation = jsonRepresentation.getRepresentation("aLink");
+        final JsonRepresentation mapRepresentation = jsonRepresentation.getRepresentation("aLink");
         assertThat(mapRepresentation.getString("rel"), is("someRel"));
         assertThat(mapRepresentation.isMap(), is(true));
     }
@@ -53,48 +53,48 @@ public class JsonRepresentationTest_getR
 
     @Test
     public void forValue() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
+        final JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
         assertThat(valueRepresentation.isValue(), is(true));
     }
 
     @Test
     public void forList() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation listRepresentation = jsonRepresentation.getRepresentation("aSubList");
+        final JsonRepresentation listRepresentation = jsonRepresentation.getRepresentation("aSubList");
         assertThat(listRepresentation.isArray(), is(true));
     }
-    
+
     @Test
     public void forPath() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation representation = jsonRepresentation.getRepresentation("aSubMap.aLink");
+        final JsonRepresentation representation = jsonRepresentation.getRepresentation("aSubMap.aLink");
         assertThat(representation.isMap(), is(true));
         assertThat(representation.getString("href"), is("http://foo/bar"));
     }
 
     @Test
     public void forListWithSingleCriteriaMatchingOne() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=aRel]");
+        final JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=aRel]");
         assertThat(representation.isLink(), is(true));
         assertThat(representation.asLink().getHref(), is("http://foo/bar"));
     }
 
     @Test
     public void forListWithMultipleCriteriaMatchingOne() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=multiRel data=someData]");
+        final JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=multiRel data=someData]");
         assertThat(representation.isLink(), is(true));
         assertThat(representation.asLink().getHref(), is("http://foo/bar/multiRel1"));
     }
 
     @Test
     public void forListWithMultipleCriteriaMatchingMultiple() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=multiRel method=GET]");
+        final JsonRepresentation representation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks[rel=multiRel method=GET]");
         assertThat(representation.isArray(), is(true));
         assertThat(representation.size(), is(2));
     }
 
     @Test
     public void whenStartingWithList() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation listRepresentation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks");
-        JsonRepresentation representation = listRepresentation.getRepresentation("[rel=multiRel method=GET]");
+        final JsonRepresentation listRepresentation = jsonRepresentation.getRepresentation("anotherSubMap.aListOfLinks");
+        final JsonRepresentation representation = listRepresentation.getRepresentation("[rel=multiRel method=GET]");
         assertThat(representation.isArray(), is(true));
         assertThat(representation.size(), is(2));
     }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getString_isString.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getString_isString.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getString_isString.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_getString_isString.java Sun Jan 22 08:05:17 2012
@@ -39,7 +39,7 @@ public class JsonRepresentationTest_getS
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.isString("aString"), is(true));
@@ -58,7 +58,7 @@ public class JsonRepresentationTest_getS
         try {
             jsonRepresentation.getString("anInt");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'anInt' is not a string"));
         }
     }
@@ -69,7 +69,7 @@ public class JsonRepresentationTest_getS
         try {
             jsonRepresentation.getString("aSubMap");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubMap' is not a string"));
         }
     }
@@ -80,7 +80,7 @@ public class JsonRepresentationTest_getS
         try {
             jsonRepresentation.getString("aSubList");
             fail();
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             assertThat(e.getMessage(), is("'aSubList' is not a string"));
         }
     }
@@ -90,5 +90,5 @@ public class JsonRepresentationTest_getS
         assertThat(jsonRepresentation.isString("aSubMap.aString"), is(true));
         assertThat(jsonRepresentation.getString("aSubMap.aString"), is("aSubMapStringValue"));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_isArray_isMap_isValue.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_isArray_isMap_isValue.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_isArray_isMap_isValue.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_isArray_isMap_isValue.java Sun Jan 22 08:05:17 2012
@@ -37,7 +37,7 @@ public class JsonRepresentationTest_isAr
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
     }
-    
+
     @Test
     public void forMap() throws JsonParseException, JsonMappingException, IOException {
         assertThat(jsonRepresentation.isArray(), is(false));
@@ -47,7 +47,7 @@ public class JsonRepresentationTest_isAr
 
     @Test
     public void forValue() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("aString");
+        final JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("aString");
         assertThat(valueRepresentation.isArray(), is(false));
         assertThat(valueRepresentation.isMap(), is(false));
         assertThat(valueRepresentation.isValue(), is(true));
@@ -60,5 +60,5 @@ public class JsonRepresentationTest_isAr
         assertThat(jsonRepresentation.isMap(), is(false));
         assertThat(jsonRepresentation.isValue(), is(false));
     }
-    
+
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapHas.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapHas.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapHas.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapHas.java Sun Jan 22 08:05:17 2012
@@ -35,16 +35,16 @@ public class JsonRepresentationTest_mapH
     @Test
     public void forMap() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
-        
+
         assertThat(jsonRepresentation.mapHas("aString"), is(true));
         assertThat(jsonRepresentation.mapHas("aSubMap.anInt"), is(true));
         assertThat(jsonRepresentation.mapHas("nonExistent"), is(false));
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void forList() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("list.json"));
-        
+
         jsonRepresentation.mapHas("aString");
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapIterable.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapIterable.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapIterable.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_mapIterable.java Sun Jan 22 08:05:17 2012
@@ -35,19 +35,18 @@ import org.junit.Test;
 public class JsonRepresentationTest_mapIterable {
 
     private JsonRepresentation jsonRepresentation;
-    
+
     @Test
     public void forJsonRepresentation() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
         final Iterable<Entry<String, JsonRepresentation>> mapIterable = jsonRepresentation.mapIterable();
         final Iterator<Entry<String, JsonRepresentation>> mapIterator = mapIterable.iterator();
-        
-        for(int i=0; i<jsonRepresentation.asJsonNode().size(); i++) {
+
+        for (int i = 0; i < jsonRepresentation.asJsonNode().size(); i++) {
             assertThat(mapIterator.hasNext(), is(true));
             assertThat(mapIterator.next().getKey(), is(not(nullValue())));
         }
         assertThat(mapIterator.hasNext(), is(false));
     }
 
-
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newArray.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newArray.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newArray.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newArray.java Sun Jan 22 08:05:17 2012
@@ -27,14 +27,14 @@ public class JsonRepresentationTest_newA
 
     @Test
     public void newArray() throws Exception {
-        JsonRepresentation jsonRepresentation = JsonRepresentation.newArray();
+        final JsonRepresentation jsonRepresentation = JsonRepresentation.newArray();
         assertThat(jsonRepresentation.isArray(), is(true));
         assertThat(jsonRepresentation.size(), is(0));
     }
 
     @Test
     public void newArrayInitialSize() throws Exception {
-        JsonRepresentation jsonRepresentation = JsonRepresentation.newArray(2);
+        final JsonRepresentation jsonRepresentation = JsonRepresentation.newArray(2);
         assertThat(jsonRepresentation.size(), is(2));
         assertThat(jsonRepresentation.arrayGet(0).isNull(), is(true));
         assertThat(jsonRepresentation.arrayGet(1).isNull(), is(true));

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newObject.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newObject.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_newObject.java Sun Jan 22 08:05:17 2012
@@ -29,12 +29,10 @@ import org.junit.Test;
 
 public class JsonRepresentationTest_newObject {
 
-
     @Test
     public void happyCase() throws JsonParseException, JsonMappingException, IOException {
-        JsonRepresentation jsonRepresentation = JsonRepresentation.newMap() ;
+        final JsonRepresentation jsonRepresentation = JsonRepresentation.newMap();
         assertThat(jsonRepresentation.isMap(), is(true));
     }
 
-    
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_putXxx.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_putXxx.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_putXxx.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_putXxx.java Sun Jan 22 08:05:17 2012
@@ -30,14 +30,13 @@ import org.junit.Test;
 
 public class JsonRepresentationTest_putXxx {
 
-
     private JsonRepresentation jsonRepresentation;
 
     @Before
     public void setUp() throws Exception {
         jsonRepresentation = JsonRepresentation.newMap();
     }
-    
+
     @Test
     public void putInt() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation.mapPut("a", 123);
@@ -50,14 +49,13 @@ public class JsonRepresentationTest_putX
         assertThat(jsonRepresentation.getInt("a.b"), is(456));
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void putInt_pathBlockedByValue() throws JsonParseException, JsonMappingException, IOException {
-        //given
+        // given
         jsonRepresentation.mapPut("a", 123);
 
         // when
         jsonRepresentation.mapPut("a.b", 456);
     }
 
-    
 }

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_size.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_size.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_size.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_size.java Sun Jan 22 08:05:17 2012
@@ -56,10 +56,10 @@ public class JsonRepresentationTest_size
         assertThat(jsonRepresentation.size(), is(2));
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void size_forValue() throws JsonParseException, JsonMappingException, IOException {
         jsonRepresentation = new JsonRepresentation(readJson("map.json"));
-        JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
+        final JsonRepresentation valueRepresentation = jsonRepresentation.getRepresentation("anInt");
         valueRepresentation.size();
     }
 

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_urlEncoding.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_urlEncoding.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_urlEncoding.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/JsonRepresentationTest_urlEncoding.java Sun Jan 22 08:05:17 2012
@@ -16,30 +16,30 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-
+package org.apache.isis.viewer.json.applib;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+
 import org.apache.isis.viewer.json.applib.links.LinkRepresentation;
-import org.junit.Test;
-
-import com.google.common.base.Charsets;
-
-public class JsonRepresentationTest_urlEncoding {
-
-    @Test
-    public void test() throws UnsupportedEncodingException {
-        LinkRepresentation l = new LinkRepresentation().withRel("object").withHref("http://localhost:8080/objects/ABC:123").withMethod(HttpMethod.GET);
-        
-        String expectedValue = "%7B%22method%22%3A%22GET%22%2C%22rel%22%3A%22object%22%2C%22href%22%3A%22http%3A%2F%2Flocalhost%3A8080%2Fobjects%2FABC%3A123%22%7D";
-        @SuppressWarnings("unused")
-        String decoded = URLDecoder.decode(expectedValue, Charsets.UTF_8.name());
-        
-        assertThat(l.asUrlEncoded(), is(expectedValue));
-        
-    }
-}
+import org.junit.Test;
+
+import com.google.common.base.Charsets;
+
+public class JsonRepresentationTest_urlEncoding {
+
+    @Test
+    public void test() throws UnsupportedEncodingException {
+        final LinkRepresentation l = new LinkRepresentation().withRel("object").withHref("http://localhost:8080/objects/ABC:123").withMethod(HttpMethod.GET);
+
+        final String expectedValue = "%7B%22method%22%3A%22GET%22%2C%22rel%22%3A%22object%22%2C%22href%22%3A%22http%3A%2F%2Flocalhost%3A8080%2Fobjects%2FABC%3A123%22%7D";
+        @SuppressWarnings("unused")
+        final String decoded = URLDecoder.decode(expectedValue, Charsets.UTF_8.name());
+
+        assertThat(l.asUrlEncoded(), is(expectedValue));
+
+    }
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getMediaType_lookup.java Sun Jan 22 08:05:17 2012
@@ -16,42 +16,42 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-
-import javax.ws.rs.core.MediaType;
-
-import org.junit.Test;
-
-public class RepresentationTypeTest_getMediaType_lookup {
-
-    @Test
-    public void roundtrip() {
-        for (RepresentationType repType : RepresentationType.values()) {
-            final MediaType mediaType = repType.getMediaType();
-            final RepresentationType lookup = RepresentationType.lookup(mediaType);
-            assertSame(repType, lookup);
-        }
-    }
-
-    @Test
-    public void whenUnknown() {
-        assertThat(RepresentationType.lookup(MediaType.APPLICATION_ATOM_XML_TYPE), is(RepresentationType.GENERIC));
-    }
-
-    @Test
-    public void whenNull() {
-        assertThat(RepresentationType.lookup((MediaType)null), is(RepresentationType.GENERIC));
-    }
-
-    @Test
-    public void getMediaTypeProfile() {
-        assertThat(RepresentationType.VERSION.getMediaTypeWithProfile(), is("urn:org.restfulobjects/version"));
-        assertThat(RepresentationType.GENERIC.getMediaTypeWithProfile(), is(nullValue()));
-    }
-
-}
+package org.apache.isis.viewer.json.applib;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.MediaType;
+
+import org.junit.Test;
+
+public class RepresentationTypeTest_getMediaType_lookup {
+
+    @Test
+    public void roundtrip() {
+        for (final RepresentationType repType : RepresentationType.values()) {
+            final MediaType mediaType = repType.getMediaType();
+            final RepresentationType lookup = RepresentationType.lookup(mediaType);
+            assertSame(repType, lookup);
+        }
+    }
+
+    @Test
+    public void whenUnknown() {
+        assertThat(RepresentationType.lookup(MediaType.APPLICATION_ATOM_XML_TYPE), is(RepresentationType.GENERIC));
+    }
+
+    @Test
+    public void whenNull() {
+        assertThat(RepresentationType.lookup((MediaType) null), is(RepresentationType.GENERIC));
+    }
+
+    @Test
+    public void getMediaTypeProfile() {
+        assertThat(RepresentationType.VERSION.getMediaTypeWithProfile(), is("urn:org.restfulobjects/version"));
+        assertThat(RepresentationType.GENERIC.getMediaTypeWithProfile(), is(nullValue()));
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_getName_lookup.java Sun Jan 22 08:05:17 2012
@@ -16,40 +16,40 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-
-import org.junit.Test;
-
-public class RepresentationTypeTest_getName_lookup {
-
-    @Test
-    public void selectedValues() {
-        assertThat(RepresentationType.VERSION.getName(), is("version"));
-        assertThat(RepresentationType.HOME_PAGE.getName(), is("homePage"));
-        assertThat(RepresentationType.ACTION_PARAMETER_DESCRIPTION.getName(), is("actionParameterDescription"));
-    }
-
-    @Test
-    public void roundtrip() {
-        for (RepresentationType repType : RepresentationType.values()) {
-            final String name = repType.getName();
-            final RepresentationType lookup = RepresentationType.lookup(name);
-            assertSame(repType, lookup);
-        }
-    }
-
-    @Test
-    public void lookup_whenUnknown() {
-        assertThat(RepresentationType.lookup("foobar"), is(RepresentationType.GENERIC));
-    }
-
-    @Test
-    public void lookup_whenNull() {
-        assertThat(RepresentationType.lookup((String)null), is(RepresentationType.GENERIC));
-    }
-
-}
+package org.apache.isis.viewer.json.applib;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+public class RepresentationTypeTest_getName_lookup {
+
+    @Test
+    public void selectedValues() {
+        assertThat(RepresentationType.VERSION.getName(), is("version"));
+        assertThat(RepresentationType.HOME_PAGE.getName(), is("homePage"));
+        assertThat(RepresentationType.ACTION_PARAMETER_DESCRIPTION.getName(), is("actionParameterDescription"));
+    }
+
+    @Test
+    public void roundtrip() {
+        for (final RepresentationType repType : RepresentationType.values()) {
+            final String name = repType.getName();
+            final RepresentationType lookup = RepresentationType.lookup(name);
+            assertSame(repType, lookup);
+        }
+    }
+
+    @Test
+    public void lookup_whenUnknown() {
+        assertThat(RepresentationType.lookup("foobar"), is(RepresentationType.GENERIC));
+    }
+
+    @Test
+    public void lookup_whenNull() {
+        assertThat(RepresentationType.lookup((String) null), is(RepresentationType.GENERIC));
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_parser.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_parser.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_parser.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RepresentationTypeTest_parser.java Sun Jan 22 08:05:17 2012
@@ -16,23 +16,23 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.json.applib;
-
-import static org.junit.Assert.assertSame;
-
+package org.apache.isis.viewer.json.applib;
+
+import static org.junit.Assert.assertSame;
+
 import org.apache.isis.viewer.json.applib.util.Parser;
-import org.junit.Test;
-
-public class RepresentationTypeTest_parser {
-
-    @Test
-    public void roundtrips() {
-        final Parser<RepresentationType> parser = RepresentationType.parser();
-        for (RepresentationType repType : RepresentationType.values()) {
-            final String asString = parser.asString(repType);
-            final RepresentationType roundtripped = parser.valueOf(asString);
-            assertSame(roundtripped, repType);
-        }
-    }
-
-}
+import org.junit.Test;
+
+public class RepresentationTypeTest_parser {
+
+    @Test
+    public void roundtrips() {
+        final Parser<RepresentationType> parser = RepresentationType.parser();
+        for (final RepresentationType repType : RepresentationType.values()) {
+            final String asString = parser.asString(repType);
+            final RepresentationType roundtripped = parser.valueOf(asString);
+            assertSame(roundtripped, repType);
+        }
+    }
+
+}

Modified: incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RestfulClientTest_follow.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RestfulClientTest_follow.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RestfulClientTest_follow.java (original)
+++ incubator/isis/trunk/framework/viewer/json/json-applib/src/test/java/org/apache/isis/viewer/json/applib/RestfulClientTest_follow.java Sun Jan 22 08:05:17 2012
@@ -44,59 +44,56 @@ public class RestfulClientTest_follow {
 
     @Rule
     public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-    
-    private URI uri = URI.create("http://yadayada:8080");
-    
+
+    private final URI uri = URI.create("http://yadayada:8080");
+
     @Mock
     private ClientExecutor mockExecutor;
-    
+
     @Mock
     private ClientRequest mockClientRequest;
-    
+
     @Mock
     private BaseClientResponse<String> mockClientResponse;
 
     private JsonRepresentation jsonRepresentation;
 
-
     private RestfulClient client;
 
-
     @Before
     public void setUp() throws Exception {
         jsonRepresentation = new JsonRepresentation(JsonFixture.readJson("map.json"));
         client = new RestfulClient(uri, mockExecutor);
     }
-    
-    
+
     @Ignore("TODO")
     @Test
     public void follow_get() throws Exception {
-        LinkRepresentation link = jsonRepresentation.getLink("aLink");
+        final LinkRepresentation link = jsonRepresentation.getLink("aLink");
 
         final String href = link.getHref();
-        
+
         // when
         context.checking(new Expectations() {
             {
                 one(mockExecutor).createRequest(with(any(UriBuilderImpl.class)));
                 will(returnValue(mockClientRequest));
-                
+
                 one(mockExecutor).execute(mockClientRequest);
                 will(returnValue(mockClientResponse));
-                
+
                 one(mockClientRequest).accept(MediaType.APPLICATION_JSON_TYPE);
                 atLeast(1).of(mockClientRequest).setHttpMethod("GET");
-                
+
                 allowing(mockClientRequest).getHttpMethod();
                 will(returnValue("GET"));
-                
+
                 one(mockClientRequest).execute();
                 will(returnValue(mockClientResponse));
-                
+
                 one(mockClientResponse).setReturnType(String.class);
                 allowing(mockClientResponse);
-                
+
                 final MultiValueMap result = new MultiValueMap();
                 result.put("Content-Type", "application/json");
                 allowing(mockClientResponse).getMetadata();
@@ -105,7 +102,7 @@ public class RestfulClientTest_follow {
 
         });
         final RestfulResponse<JsonRepresentation> response = client.follow(link);
-        
+
         // then
     }
 
@@ -113,15 +110,15 @@ public class RestfulClientTest_follow {
         return new TypeSafeMatcher<ClientRequest>() {
 
             @Override
-            public void describeTo(Description description) {
+            public void describeTo(final Description description) {
                 description.appendText("request to href: " + href);
             }
 
             @Override
-            public boolean matchesSafely(ClientRequest clientRequest) {
+            public boolean matchesSafely(final ClientRequest clientRequest) {
                 try {
                     return clientRequest.getUri().equals(href);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     return false;
                 }
             }



Mime
View raw message