You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/07/25 11:29:56 UTC

[38/48] isis git commit: ISIS-1178: mothballing the tck tests.

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/RestfulMatchers.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/RestfulMatchers.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/RestfulMatchers.java
new file mode 100644
index 0000000..fa71905
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/RestfulMatchers.java
@@ -0,0 +1,660 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck;
+
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.MediaType;
+import com.google.common.base.Objects;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+import org.junit.Assert;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation.HasLinkToSelf;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.Header;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+
+public class RestfulMatchers {
+
+    public static <T extends JsonRepresentation> Matcher<T> isMap() {
+        return new TypeSafeMatcher<T>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("map");
+            }
+
+            @Override
+            public boolean matchesSafely(final T item) {
+                return item != null && item.isMap();
+            }
+        };
+    }
+
+    public static <T extends JsonRepresentation> Matcher<T> isArray() {
+        return new TypeSafeMatcher<T>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("array");
+            }
+
+            @Override
+            public boolean matchesSafely(final T item) {
+                return item != null && item.isArray();
+            }
+        };
+    }
+
+    public static <T extends JsonRepresentation> Matcher<T> isString() {
+        return new TypeSafeMatcher<T>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("string");
+            }
+
+            @Override
+            public boolean matchesSafely(final T item) {
+                return item != null && item.isValue() && item.asJsonNode().isTextual();
+            }
+        };
+    }
+
+    public static Matcher<LinkRepresentation> isLink(final RestfulHttpMethod httpMethod) {
+        return new TypeSafeMatcher<LinkRepresentation>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("link with method " + httpMethod.name());
+            }
+
+            @Override
+            public boolean matchesSafely(final LinkRepresentation item) {
+                return item != null && item.getHttpMethod() == httpMethod;
+            }
+        };
+    }
+
+    public static <T extends JsonRepresentation> Matcher<T> isFollowableLinkToSelf(final RestfulClient client) {
+        return new TypeSafeMatcher<T>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("links to self");
+            }
+
+            @Override
+            public boolean matchesSafely(final T item) {
+                final HasLinkToSelf initialRepr = (HasLinkToSelf) item; // no easy
+                                                                    // way to do
+                                                                    // this with
+                                                                    // Hamcrest
+                // when
+                try {
+                    final RestfulResponse<T> followedResp = client.followT(initialRepr.getSelf());
+
+                    // then
+                    final T repr2 = followedResp.getEntity();
+                    final HasLinkToSelf repr2AsLinksToSelf = (HasLinkToSelf) repr2;
+                    return initialRepr.getSelf().equals(repr2AsLinksToSelf.getSelf());
+                } catch (final Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        };
+    }
+
+    public static <T extends JsonRepresentation> void assertThat(final T actual, final AbstractMatcherBuilder<T> matcherBuilder) {
+        Assert.assertThat(actual, matcherBuilder.build());
+    }
+
+    public static LinkMatcherBuilder isLink(final RestfulClient client) {
+        return new LinkMatcherBuilder(client);
+    }
+
+    public static LinkMatcherBuilder isLink() {
+        return new LinkMatcherBuilder(null);
+    }
+
+    public static abstract class AbstractMatcherBuilder<T> {
+        protected RestfulClient client;
+
+        public AbstractMatcherBuilder() {
+            this(null);
+        }
+
+        public AbstractMatcherBuilder(final RestfulClient client) {
+            this.client = client;
+        }
+
+        public abstract Matcher<T> build();
+    }
+
+    public static class LinkMatcherBuilder extends AbstractMatcherBuilder<JsonRepresentation> {
+        private HttpStatusCode statusCode;
+        private RestfulHttpMethod httpMethod;
+        private String rel;
+        private String href;
+        private Matcher<String> relNameMatcher;
+        private Matcher<String> hrefMatcher;
+        private Matcher<JsonRepresentation> valueMatcher;
+        private Boolean novalue;
+        private MediaType mediaType;
+        private String typeParameterName;
+        private String typeParameterValue;
+        private String selfHref;
+        private JsonRepresentation arguments;
+        private String title;
+        private Matcher<String> titleMatcher;
+
+        private LinkMatcherBuilder(final RestfulClient client) {
+            super(client);
+        }
+
+        public LinkMatcherBuilder rel(final String rel) {
+            this.rel = rel;
+            return this;
+        }
+
+        public LinkMatcherBuilder rel(final Rel rel) {
+            this.rel = rel.getName();
+            return this;
+        }
+
+        public LinkMatcherBuilder rel(final Matcher<String> relNameMatcher) {
+            this.relNameMatcher = relNameMatcher;
+            return this;
+        }
+
+        public LinkMatcherBuilder href(final String href) {
+            this.href = href;
+            return this;
+        }
+
+        public LinkMatcherBuilder href(final Matcher<String> hrefMatcher) {
+            this.hrefMatcher = hrefMatcher;
+            return this;
+        }
+
+        public LinkMatcherBuilder httpMethod(final RestfulHttpMethod httpMethod) {
+            this.httpMethod = httpMethod;
+            return this;
+        }
+
+        public LinkMatcherBuilder type(final MediaType mediaType) {
+            this.mediaType = mediaType;
+            return this;
+        }
+
+        public LinkMatcherBuilder title(String title) {
+            this.title = title;
+            return this;
+        }
+
+        public LinkMatcherBuilder title(Matcher<String> titleMatcher) {
+            this.titleMatcher = titleMatcher;
+            return this;
+        }
+        
+        public LinkMatcherBuilder typeParameter(final String typeParameterName, final String typeParameterValue) {
+            this.typeParameterName = typeParameterName;
+            this.typeParameterValue = typeParameterValue;
+            return this;
+        }
+
+        public LinkMatcherBuilder arguments(JsonRepresentation arguments) {
+            this.arguments = arguments;
+            return this;
+        }
+
+        public LinkMatcherBuilder novalue() {
+            if (valueMatcher != null) {
+                throw new IllegalStateException("cannot assert on both there being a value and there not being a value");
+            }
+            this.novalue = true;
+            return this;
+        }
+
+        public LinkMatcherBuilder value(final Matcher<JsonRepresentation> valueMatcher) {
+            if (this.novalue != null) {
+                throw new IllegalStateException("cannot assert on both there being a value and there not being a value");
+            }
+            this.valueMatcher = valueMatcher;
+            return this;
+        }
+
+        public LinkMatcherBuilder returning(final HttpStatusCode statusCode) {
+            this.statusCode = statusCode;
+            return this;
+        }
+
+        public LinkMatcherBuilder responseEntityWithSelfHref(String selfHref) {
+            this.selfHref = selfHref;
+            return this;
+        }
+
+        @Override
+        public Matcher<JsonRepresentation> build() {
+            return new TypeSafeMatcher<JsonRepresentation>() {
+
+                @Override
+                public void describeTo(final Description description) {
+                    description.appendText("a link");
+                    if (rel != null) {
+                        description.appendText(" with rel '").appendText(rel).appendText("'");
+                    }
+                    if (relNameMatcher != null) {
+                        description.appendText(" with rel '");
+                        relNameMatcher.describeTo(description);
+                    }
+                    if (href != null) {
+                        description.appendText(" with href '").appendText(href).appendText("'");
+                    }
+                    if (hrefMatcher != null) {
+                        description.appendText(" with href ");
+                        hrefMatcher.describeTo(description);
+                    }
+                    if (title != null) {
+                        description.appendText(" with title '").appendText(title).appendText("'");
+                    }
+                    if (titleMatcher != null) {
+                        description.appendText(" with title ");
+                        titleMatcher.describeTo(description);
+                    }
+                    if (httpMethod != null) {
+                        description.appendText(" with method '").appendValue(httpMethod).appendText("'");
+                    }
+                    if (mediaType != null) {
+                        description.appendText(" with type '").appendValue(mediaType).appendText("'");
+                    }
+                    if (typeParameterName != null) {
+                        description.appendText(" with media type parameter '").appendText(typeParameterName).appendText("=").appendText(typeParameterValue).appendText("'");
+                    }
+
+                    if (arguments != null) {
+                        description.appendText(" with arguments").appendText(arguments.toString());
+                    }
+
+                    if (novalue != null && novalue) {
+                        description.appendText(" with no value");
+                    }
+                    if (valueMatcher != null) {
+                        description.appendText(" with value ");
+                        valueMatcher.describeTo(description);
+                    }
+
+                    // trigger link being followed
+                    if (statusCode != null || selfHref != null) {
+                        if (client == null) {
+                            throw new IllegalStateException("require client in order to assert on statusCode");
+                        }
+                        description.appendText(" that when followed");
+                        if (statusCode != null) {
+                            description.appendText(" returns status " + statusCode);
+                        }
+                        if (statusCode != null || selfHref != null) {
+                            description.appendText(" and");
+                        }
+                        if (selfHref != null) {
+                            description.appendText(" has a response whose self.href is " + selfHref);
+                        }
+                    }
+                }
+
+                @Override
+                public boolean matchesSafely(final JsonRepresentation linkRepr) {
+                    if (linkRepr == null) {
+                        return false;
+                    }
+                    final LinkRepresentation link = linkRepr.asLink();
+                    if (rel != null && !Rel.parse(rel).matches(link.getRel())) {
+                        return false;
+                    }
+                    if (relNameMatcher != null && !relNameMatcher.matches(link.getRel())) {
+                        return false;
+                    }
+                    if (href != null && !href.equals(link.getHref())) {
+                        return false;
+                    }
+                    if (hrefMatcher != null && !hrefMatcher.matches(link.getHref())) {
+                        return false;
+                    }
+                    if (title != null && !title.equals(link.getTitle())) {
+                        return false;
+                    }
+                    if (titleMatcher != null && !titleMatcher.matches(link.getTitle())) {
+                        return false;
+                    }
+                    if (httpMethod != null && !httpMethod.equals(link.getHttpMethod())) {
+                        return false;
+                    }
+                    if (mediaType != null && !mediaType.isCompatible(mediaType)) {
+                        return false;
+                    }
+                    if (typeParameterName != null) {
+                        final MediaType mediaType = link.getType();
+                        final String parameterValue = mediaType.getParameters().get(typeParameterName);
+                        if (!typeParameterValue.equals(parameterValue)) {
+                            return false;
+                        }
+                    }
+                    if (novalue != null && novalue && link.getValue() != null) {
+                        return false;
+                    }
+                    if (arguments != null && !arguments.equals(link.getArguments())) {
+                        return false;
+                    }
+                    if (valueMatcher != null && !valueMatcher.matches(link.getValue())) {
+                        return false;
+                    }
+
+                    // follow link if criteria require it
+                    RestfulResponse<JsonRepresentation> jsonResp = null;
+                    if (statusCode != null || selfHref != null) {
+                        if (client == null) {
+                            return false;
+                        }
+                        try {
+                            jsonResp = client.followT(link);
+                        } catch (final Exception e) {
+                            throw new RuntimeException(e);
+                        }
+                    }
+
+                    // assertions based on provided criteria
+                    try {
+                        if (statusCode != null) {
+                            if (jsonResp.getStatus() != statusCode) {
+                                return false;
+                            }
+                        }
+                        if (selfHref != null) {
+                            JsonRepresentation entity;
+                            try {
+                                entity = jsonResp.getEntity();
+                            } catch (Exception e) {
+                                return false;
+                            }
+                            if(entity == null) {
+                                return false;
+                            }
+                            LinkRepresentation selfLink = entity.getLink("links[rel=self]");
+                            if(selfLink == null) {
+                                return false;
+                            }
+                            if (!selfLink.getHref().equals(selfHref)) {
+                                return false;
+                            }
+                        }
+                        return true;
+                    } finally {
+                        // flush any pending response
+                        try {
+                            jsonResp.getEntity();
+                        } catch (Exception e) {
+                            // ignore
+                        }
+                    }
+                }
+            };
+        }
+
+
+
+
+    }
+
+    public static EntryMatcherBuilder entry(final String key) {
+        return new EntryMatcherBuilder(key);
+    }
+
+    public static class EntryMatcherBuilder extends AbstractMatcherBuilder<JsonRepresentation> {
+
+        private final String key;
+        private String value;
+
+        private EntryMatcherBuilder(final String key) {
+            this.key = key;
+        }
+
+        public EntryMatcherBuilder value(final String value) {
+            this.value = value;
+            return this;
+        }
+
+        @Override
+        public Matcher<JsonRepresentation> build() {
+            return new TypeSafeMatcher<JsonRepresentation>() {
+
+                @Override
+                public void describeTo(final Description description) {
+                    description.appendText("map with entry with key: " + key);
+                    if (value != null) {
+                        description.appendText(", and value: " + value);
+                    }
+                }
+
+                @Override
+                public boolean matchesSafely(final JsonRepresentation item) {
+                    if (!item.isMap()) {
+                        return false;
+                    }
+                    final String val = item.getString(key);
+                    if (val == null) {
+                        return false;
+                    }
+                    if (value != null && !value.equals(val)) {
+                        return false;
+                    }
+                    return true;
+                }
+            };
+        }
+
+    }
+
+    public static Matcher<MediaType> hasMediaType(final String type) {
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("has type " + type);
+            }
+
+            @Override
+            public boolean matchesSafely(final MediaType item) {
+                final String expectedType = item.getType();
+                return expectedType != null && type.contains(expectedType);
+            }
+        };
+    }
+
+    public static Matcher<MediaType> hasSubType(final String subtype) {
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("has subtype " + subtype);
+            }
+
+            @Override
+            public boolean matchesSafely(final MediaType item) {
+                return Objects.equal(subtype, item.getSubtype());
+            }
+        };
+    }
+
+    public static Matcher<MediaType> hasParameter(final String parameterName, final String parameterValue) {
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText(String.format("has parameter '%s' with value '%s'", parameterName, parameterValue));
+            }
+
+            @Override
+            public boolean matchesSafely(final MediaType item) {
+                final String paramValue = item.getParameters().get(parameterName);
+                return Objects.equal(paramValue, parameterValue);
+            }
+        };
+    }
+
+    public static Matcher<CacheControl> hasMaxAge(final int maxAge) {
+        return new TypeSafeMatcher<CacheControl>() {
+
+            @Override
+            public void describeTo(final Description description) {
+                description.appendText("has max age of " + maxAge + " secs");
+            }
+
+            @Override
+            public boolean matchesSafely(final CacheControl item) {
+                return maxAge == item.getMaxAge();
+            }
+        };
+    }
+
+    public static Matcher<? super JsonRepresentation> mapHas(final String key) {
+        return new TypeSafeMatcher<JsonRepresentation>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("is a map with key '" + key + "'");
+            }
+
+            @Override
+            protected boolean matchesSafely(JsonRepresentation item) {
+                return item.mapHas(key);
+            }
+        };
+    }
+
+    public static Matcher<? super MediaType> hasMediaTypeProfile(final String expectedMediaTypeAndProfileStr) {
+        final MediaType expectedMediaType = Header.CONTENT_TYPE.parse(expectedMediaTypeAndProfileStr);
+        final String expectedProfileIfAny = expectedMediaType.getParameters().get("profile");
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("is a media type 'application/json' with a profile parameter of '" +  expectedMediaTypeAndProfileStr + '"');
+            }
+
+            @Override
+            protected boolean matchesSafely(MediaType item) {
+                
+                if (!item.isCompatible(expectedMediaType)) {
+                    return false;
+                }
+                String actualProfileIfAny = item.getParameters().get("profile");
+                return Objects.equal(expectedProfileIfAny, actualProfileIfAny);
+            }
+        };
+    }
+
+    public static Matcher<? super MediaType> hasMediaTypeXRoDomainType(final String expectedXRoDomainType) {
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("is a media type with an 'x-ro-domain-type' parameter of '" +  expectedXRoDomainType + '"');
+            }
+
+            @Override
+            protected boolean matchesSafely(MediaType item) {
+                String actualXRoDomainTypeIfany = item.getParameters().get("x-ro-domain-type");
+                return actualXRoDomainTypeIfany != null && actualXRoDomainTypeIfany.contains(expectedXRoDomainType);
+            }
+        };
+    }
+
+    public static Matcher<? super MediaType> hasMediaTypeXRoElementType(final String expectedXRoElementTypeIfAny) {
+        return new TypeSafeMatcher<MediaType>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("is a media type with an 'x-ro-element-type' parameter of '" +  expectedXRoElementTypeIfAny + '"');
+            }
+
+            @Override
+            protected boolean matchesSafely(MediaType item) {
+                String actualXRoElementTypeIfany = item.getParameters().get("x-ro-element-type");
+                return actualXRoElementTypeIfany != null && actualXRoElementTypeIfany.contains(expectedXRoElementTypeIfAny);
+            }
+        };
+    }
+
+    public static Matcher<? super RestfulResponse<?>> hasStatus(final HttpStatusCode statusCode) {
+        return new TypeSafeMatcher<RestfulResponse<?>>() {
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("has status code of " + statusCode);
+            }
+
+            @Override
+            protected boolean matchesSafely(RestfulResponse<?> item) {
+                return item.getStatus() == statusCode;
+            }
+        };
+    }
+
+    
+    public static class CacheControlMatcherBuilder extends AbstractMatcherBuilder<CacheControl> {
+
+        private Boolean noCache;
+
+        @Override
+        public Matcher<CacheControl> build() {
+            return new TypeSafeMatcher<CacheControl>() {
+
+                @Override
+                public void describeTo(Description description) {
+                    description.appendText("is a CacheControl header ");
+                    if(noCache != null) {
+                        description.appendText("with " + (noCache?"no":"") + " cache");
+                    }
+                }
+
+                @Override
+                protected boolean matchesSafely(CacheControl item) {
+                    if(noCache != null) {
+                        if(item.isNoCache() != noCache) {
+                            return false;
+                        }
+                    }
+                    return true;
+                }
+            };
+        }
+
+        public CacheControlMatcherBuilder withNoCache() {
+            noCache = true;
+            return this;
+        }
+        
+    }
+   
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/Util.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/Util.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/Util.java
new file mode 100644
index 0000000..369c06d
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/Util.java
@@ -0,0 +1,152 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck;
+
+import java.io.IOException;
+import javax.ws.rs.core.Response;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.RequestParameter;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation.ResultType;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ListRepresentation;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class Util {
+
+    private Util() {
+    }
+
+    public static String givenLinkToService(RestfulClient restfulClient, String serviceId) throws IOException {
+
+        final DomainServiceResource resource = restfulClient.getDomainServiceResource();
+        final Response response = resource.services();
+        final ListRepresentation services = RestfulResponse.<ListRepresentation> ofT(response).getEntity();
+
+        final String href = services.getRepresentation("value[rel=" + Rel.SERVICE.getName() + ";serviceId=\"" + serviceId + "\"]").asLink().getHref();
+        return href;
+    }
+
+    public static String givenHrefToService(RestfulClient client, final String serviceId) throws IOException {
+        final DomainServiceResource resource = client.getDomainServiceResource();
+        final Response response = resource.services();
+        final ListRepresentation services = RestfulResponse.<ListRepresentation> ofT(response).getEntity();
+
+        return services.getRepresentation("value[rel=urn:org.restfulobjects:rels/service;serviceId=\"%s\"]", serviceId).asLink().getHref();
+    }
+
+    public static JsonRepresentation givenAction(RestfulClient client, final String serviceId, final String actionId) throws IOException {
+        final String href = givenHrefToService(client, serviceId);
+        final String detailRel = Rel.DETAILS.andParam("action", actionId);
+
+        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members[%s].links[rel=%s]", actionId, detailRel);
+        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+        final DomainObjectRepresentation repr = restfulResponse.getEntity();
+
+        final JsonRepresentation actionLinkRepr = repr.getAction(actionId);
+        return actionLinkRepr.getRepresentation("links[rel=%s].value", detailRel);
+    }
+
+    /**
+     * For clientFollow tests; returns a link to the first entity in the list returned by invoking the 'list' action of the specified repo
+     */
+    public static LinkRepresentation serviceActionListInvokeFirstReference(RestfulClient client, String repoName) throws Exception {
+        return serviceActionListInvokeFirstReference(client, repoName, "list");
+    }
+
+    /**
+     * For clientFollow tests; returns a link to the first entity in the list returned by invoking the specified repo and action
+     */
+    public static LinkRepresentation serviceActionListInvokeFirstReference(RestfulClient client, String repoName, String actionName) throws Exception {
+        return serviceActionListInvokeFirstReference(client, repoName, actionName, 0);
+    }
+
+    /**
+     * For clientFollow tests; returns a link to the Nth entity in the list returned by invoking the specified repo and action
+     */
+    public static LinkRepresentation serviceActionListInvokeFirstReference(RestfulClient client, String repoName, String actionName, int idx) throws Exception {
+
+        final DomainServiceResource serviceResource = client.getDomainServiceResource();
+
+        Response response = serviceResource.invokeActionQueryOnly(repoName, actionName, null);
+        RestfulResponse<ActionResultRepresentation> restfulResponse = RestfulResponse.ofT(response);
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+        final ActionResultRepresentation actionResultRepr = restfulResponse.getEntity();
+
+        assertThat(actionResultRepr.getResultType(), is(ResultType.LIST));
+        final ListRepresentation listRepr = actionResultRepr.getResult().as(ListRepresentation.class);
+
+        assertThat(listRepr.getValue(), is(not(nullValue())));
+        assertThat(listRepr.getValue().size(), is(IsisMatchers.greaterThan(idx + 1)));
+
+        final LinkRepresentation domainObjectLinkRepr = listRepr.getValue().arrayGet(idx).as(LinkRepresentation.class);
+
+        assertThat(domainObjectLinkRepr, is(not(nullValue())));
+        assertThat(domainObjectLinkRepr, isLink().rel(Rel.ELEMENT).httpMethod(RestfulHttpMethod.GET).type(RepresentationType.DOMAIN_OBJECT.getMediaType()).arguments(JsonRepresentation.newMap()).build());
+
+        return domainObjectLinkRepr;
+    }
+
+    
+    
+    /**
+     * For resourceProxy tests; returns the first entity in the list returned by invoking the 'list' action on the specified repo
+     */
+    public static RestfulResponse<DomainObjectRepresentation> domainObjectJaxrsResponse(RestfulClient client, String repoName) throws Exception {
+        return domainObjectJaxrsResponse(client, repoName, "list");
+    }
+
+    /**
+     * For resourceProxy tests; returns the first entity in the list returned by invoking the specified repo and action
+     */
+    public static RestfulResponse<DomainObjectRepresentation> domainObjectJaxrsResponse(RestfulClient client, String repoName, String actionName) throws Exception {
+        return domainObjectJaxrsResponse(client, repoName, actionName, 0);
+    }
+
+    /**
+     * For resourceProxy tests; returns the Nth entity in the list returned by invoking the specified repo and action
+     */
+    public static RestfulResponse<DomainObjectRepresentation> domainObjectJaxrsResponse(RestfulClient client, String repoName, String actionName, int idx) throws Exception {
+        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, repoName, actionName, idx);
+        DomainObjectRepresentation domainObjectRepr = client.follow(link).getEntity().as(DomainObjectRepresentation.class);
+
+        final Response jaxrsResponse = client.getDomainObjectResource().object(domainObjectRepr.getDomainType(), domainObjectRepr.getInstanceId());
+        final RestfulResponse<DomainObjectRepresentation> restfulResponse = RestfulResponse.ofT(jaxrsResponse);
+        return restfulResponse;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/all/stories/UserStoryTest_TOFIX.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/all/stories/UserStoryTest_TOFIX.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/all/stories/UserStoryTest_TOFIX.java
new file mode 100644
index 0000000..4ca4583
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/all/stories/UserStoryTest_TOFIX.java
@@ -0,0 +1,86 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.all.stories;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.Response;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.client.RepresentationWalker;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.homepage.HomePageResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class UserStoryTest_TOFIX {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Ignore("to get working again")
+    @Test
+    public void walkResources() throws Exception {
+
+        // given a response for an initial resource
+        final HomePageResource homePageResource = client.getHomePageResource();
+        final Response homePageResp = homePageResource.homePage();
+
+        // and given a walker starting from this response
+        final RepresentationWalker walker = client.createWalker(homePageResp);
+
+        // when walk the home pages' 'services' link
+        walker.walk("services");
+
+        // and when locate the ApplibValues repo and walk the its 'object' link
+        walker.walk("values[title=ApplibValues].links[rel=object]");
+
+        // and when locate the AppLibValues repo's "newEntity" action and walk
+        // to its details
+        walker.walk("values[objectMemberType=action].details");
+
+        // and when find the invoke body for the "newEntity" action and then
+        // walk the action using the body
+        final JsonRepresentation newEntityActionDetails = walker.getEntity();
+        final JsonRepresentation newEntityActionInvokeBody = newEntityActionDetails.getArray("invoke.body");
+        walker.walk("invoke", newEntityActionInvokeBody);
+
+        // and when walk the link to the returned object
+        walker.walk("link");
+
+        // then the returned object is created with its OID
+        final JsonRepresentation newEntityDomainObject = walker.getEntity();
+        assertThat(newEntityDomainObject.getString("_self.link.href"), matches(".+/objects/OID:[\\d]+$"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/NotAuthorizedTest_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/NotAuthorizedTest_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/NotAuthorizedTest_TODO.java
new file mode 100644
index 0000000..b81203e
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/NotAuthorizedTest_TODO.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.any;
+
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class NotAuthorizedTest_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+    private RestfulClient client;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+    }
+
+    @Ignore("TODO")
+    @Test
+    public void whenAuthenticated() throws Exception {
+
+    }
+
+    @Ignore("TODO")
+    @Test
+    public void whenNotAuthenticated() throws Exception {
+     // should return 401 (13.5)
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/errorhandling/AnyResourceTest_serverSideException.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/errorhandling/AnyResourceTest_serverSideException.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/errorhandling/AnyResourceTest_serverSideException.java
new file mode 100644
index 0000000..26b9614
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/any/errorhandling/AnyResourceTest_serverSideException.java
@@ -0,0 +1,63 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.any.errorhandling;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.Header;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.util.Parser;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class AnyResourceTest_serverSideException {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+    }
+
+    @Test
+    public void runtimeException_isMapped() throws Exception {
+
+        // given
+        final RestfulRequest restfulReq = client.createRequest(RestfulHttpMethod.GET, "version");
+        final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean());
+        restfulReq.withHeader(header, true);
+
+        // when
+        final RestfulResponse<JsonRepresentation> jsonResp = restfulReq.execute();
+
+        // then
+        assertThat(jsonResp.getStatus(), is(HttpStatusCode.METHOD_FAILURE));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Delete_then_405_bad.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Delete_then_405_bad.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Delete_then_405_bad.java
new file mode 100644
index 0000000..88c2131
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Delete_then_405_bad.java
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.errors.ErrorRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Delete_then_405_bad {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private ErrorRepresentation errorRepresentation;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Test
+    public void followLink() throws Exception {
+
+        // when
+        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, "PrimitiveValuedEntities");
+        final LinkRepresentation deleteLink = link.withMethod(RestfulHttpMethod.DELETE);
+        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
+
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Deleting objects is not supported."));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDisabledMembers_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDisabledMembers_thenRepresentation_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDisabledMembers_thenRepresentation_ok.java
new file mode 100644
index 0000000..fc8bb1c
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDisabledMembers_thenRepresentation_ok.java
@@ -0,0 +1,80 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import java.io.IOException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenDisabledMembers_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectResource domainObjectResource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        domainObjectResource = client.getDomainObjectResource();
+        
+    }
+
+    @Test
+    public void domainObjectWithDisabledMembers() throws Exception {
+
+        // given, when
+        final DomainObjectRepresentation domainObjectRepr = givenDomainObjectRepresentationFor("BSRL","75");
+
+        // property ('visibleButNotEditableProperty')
+        final JsonRepresentation properties = domainObjectRepr.getProperties();
+        final JsonRepresentation nameProperty = properties.getRepresentation("visibleButNotEditableProperty");
+        assertThat(nameProperty.getString("disabledReason"), is("Always disabled"));
+    }
+
+
+    private DomainObjectRepresentation givenDomainObjectRepresentationFor(final String domainType, String instanceId) throws IOException {
+        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();
+
+        final Response domainObjectResp = domainObjectResource.object(domainType, instanceId);
+        final RestfulResponse<DomainObjectRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+        assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+        return domainObjectJsonResp.getEntity();
+    }
+
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsFormal_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsFormal_thenRepresentation_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsFormal_thenRepresentation_ok_TODO.java
new file mode 100644
index 0000000..2982489
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsFormal_thenRepresentation_ok_TODO.java
@@ -0,0 +1,52 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsFormal_thenRepresentation_ok_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Ignore("TODO")
+    @Test
+    public void thenMembers() throws Exception {
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsSimple_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsSimple_thenRepresentation_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsSimple_thenRepresentation_ok_TODO.java
new file mode 100644
index 0000000..8f4a162
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenDomainModelSchemeIsSimple_thenRepresentation_ok_TODO.java
@@ -0,0 +1,52 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsSimple_thenRepresentation_ok_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Ignore("TODO")
+    @Test
+    public void thenMembers() throws Exception {
+
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithActions_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithActions_thenRepresentation_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithActions_thenRepresentation_ok.java
new file mode 100644
index 0000000..a107a4f
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithActions_thenRepresentation_ok.java
@@ -0,0 +1,94 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import javax.ws.rs.core.Response;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.*;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectMemberRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenEntityWithActions_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectResource domainObjectResource;
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        domainObjectResource = client.getDomainObjectResource();
+        
+    }
+
+    @Test
+    public void thenMembers() throws Exception {
+
+        // when
+        final Response jaxrsResponse = domainObjectResource.object("RTNE","78");
+        final RestfulResponse<DomainObjectRepresentation> restfulResponse = RestfulResponse.ofT(jaxrsResponse);
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+
+        // then
+        domainObjectRepr = restfulResponse.getEntity();
+        assertThat(domainObjectRepr, is(not(nullValue())));
+
+
+        final LinkRepresentation self = domainObjectRepr.getSelf();
+
+        // then actions
+        final JsonRepresentation actions = domainObjectRepr.getActions();
+        assertThat(actions.size(), is(3));
+
+        final DomainObjectMemberRepresentation containsAction = domainObjectRepr.getAction("contains");
+        assertThat(containsAction.getString("memberType"), is("action"));
+        assertThat(containsAction.getString("id"), is("contains"));
+
+        LinkRepresentation containsActionLink = containsAction.getLinkWithRel(Rel.DETAILS.andParam("action", "contains"));
+        assertThat(containsActionLink.getRel(), is(Rel.DETAILS.andParam("action", "contains")));
+        assertThat(containsActionLink.getHref(), is(self.getHref() + "/actions/contains"));
+        assertThat(containsActionLink.getType(), is(RepresentationType.OBJECT_ACTION.getMediaType()));
+        assertThat(containsActionLink.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+        // can also look up with abbreviated parameterized version of Rel
+        containsActionLink = containsAction.getLinkWithRel(Rel.DETAILS);
+        assertThat(containsActionLink.getRel(), is("urn:org.restfulobjects:rels/details;action=\"contains\""));
+        assertThat(containsActionLink.getHref(), is(self.getHref() + "/actions/contains"));
+        assertThat(containsActionLink.getType(), is(RepresentationType.OBJECT_ACTION.getMediaType()));
+        assertThat(containsActionLink.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithApplibProperties_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithApplibProperties_thenRepresentation_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithApplibProperties_thenRepresentation_ok_TODO.java
new file mode 100644
index 0000000..3f38f85
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithApplibProperties_thenRepresentation_ok_TODO.java
@@ -0,0 +1,80 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.assertThat;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.joda.time.LocalDate;
+import org.joda.time.LocalDateTime;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectMemberRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+
+public class Get_givenEntityWithApplibProperties_thenRepresentation_ok_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Ignore("TODO")
+    @Test
+    public void thenMembers() throws Exception {
+
+        // when
+        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, "ApplibValuedEntities");
+        domainObjectRepr = client.follow(link).getEntity().as(DomainObjectRepresentation.class);
+
+        // and then members (types)
+        DomainObjectMemberRepresentation property;
+        ScalarValueRepresentation scalarRepr;
+
+        
+        // copy from Get_givenEntityWithPrimitiveProperties_thenRepresentation_ok
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithCollections_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithCollections_thenRepresentation_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithCollections_thenRepresentation_ok_TODO.java
new file mode 100644
index 0000000..0ea7f76
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithCollections_thenRepresentation_ok_TODO.java
@@ -0,0 +1,74 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import javax.ws.rs.core.Response;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenEntityWithCollections_thenRepresentation_ok_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectResource domainObjectResource;
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        domainObjectResource = client.getDomainObjectResource();
+        
+    }
+
+
+    @Test
+    public void thenCollections() throws Exception {
+
+        // when
+        final Response jaxrsResponse = domainObjectResource.object("PRMV","43");
+        final RestfulResponse<DomainObjectRepresentation> restfulResponse = RestfulResponse.ofT(jaxrsResponse);
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+
+        // then
+
+        domainObjectRepr = restfulResponse.getEntity();
+        assertThat(domainObjectRepr, is(not(nullValue())));
+
+        // then collections
+
+    
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJdkProperties_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJdkProperties_thenRepresentation_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJdkProperties_thenRepresentation_ok.java
new file mode 100644
index 0000000..a658574
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJdkProperties_thenRepresentation_ok.java
@@ -0,0 +1,160 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectMemberRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenEntityWithJdkProperties_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Test
+    public void thenMembers() throws Exception {
+
+        // when
+        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, "JdkValuedEntities");
+        final RestfulResponse<JsonRepresentation> restResp = client.follow(link);
+        final JsonRepresentation entityRepr = restResp.getEntity();
+        domainObjectRepr = entityRepr.as(DomainObjectRepresentation.class);
+
+        // and then members (types)
+        DomainObjectMemberRepresentation property;
+        ScalarValueRepresentation scalarRepr;
+
+        property = domainObjectRepr.getProperty("bigDecimalProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("big-decimal(30,10)"));
+        assertThat(property.getXIsisFormat(), is("javamathbigdecimal"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        BigDecimal bigDecimal = scalarRepr.asBigDecimal(property.getFormat());
+        assertThat(bigDecimal, is(new BigDecimal("12345678901234567890.1234567890")));
+
+        property = domainObjectRepr.getProperty("bigDecimalProperty2");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("big-decimal(18,2)"));
+        assertThat(property.getXIsisFormat(), is("javamathbigdecimal"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        BigDecimal bigDecimal2 = scalarRepr.asBigDecimal(property.getFormat());
+        assertThat(bigDecimal2, is(new BigDecimal("123.45")));
+
+        property = domainObjectRepr.getProperty("bigIntegerProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("big-integer"));
+        assertThat(property.getXIsisFormat(), is("javamathbiginteger"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        BigInteger bigInteger = scalarRepr.asBigInteger(property.getFormat());
+        assertThat(bigInteger, is(new BigInteger("123456789012345678")));
+
+        property = domainObjectRepr.getProperty("bigIntegerProperty2");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("big-integer"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        BigInteger bigInteger2 = scalarRepr.asBigInteger(property.getFormat());
+        assertThat(bigInteger2, is(new BigInteger("12345")));
+
+        property = domainObjectRepr.getProperty("javaSqlDateProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("date"));
+        assertThat(property.getXIsisFormat(), is("javasqldate"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        assertThat(scalarRepr.asString(), is("2014-04-24"));
+        assertThat(scalarRepr.asDate(), is(asDate("2014-04-24")));
+
+        property = domainObjectRepr.getProperty("javaSqlTimeProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("time"));
+        assertThat(property.getXIsisFormat(), is("javasqltime"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        assertThat(scalarRepr.asString(), is("12:34:45"));
+        assertThat(scalarRepr.asTime(), is(asDateTime("1970-01-01T12:34:45Z")));
+
+        property = domainObjectRepr.getProperty("javaSqlTimestampProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("utc-millisec"));
+        assertThat(property.getXIsisFormat(), is("javasqltimestamp"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isInt() || scalarRepr.isLong(), is(true));
+        Long aLong = scalarRepr.asLong();
+        assertThat(aLong, is(new Long("1234567890")));
+
+        property = domainObjectRepr.getProperty("javaUtilDateProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("date-time"));
+        assertThat(property.getXIsisFormat(), is("javautildate"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        Date utilDate = scalarRepr.asDateTime();
+        assertThat(utilDate, is(asDateTime("2013-05-25T12:34:45Z")));
+        assertThat(scalarRepr.asString(), is("2013-05-25T12:34:45Z"));
+
+        property = domainObjectRepr.getProperty("myEnum");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("string"));
+        assertThat(property.getXIsisFormat(), is("string"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        String myEnumStr = scalarRepr.asString();
+        assertThat(myEnumStr, is("RED"));
+    }
+
+
+    private static Date asDate(final String text) {
+        return new java.util.Date(JsonRepresentation.yyyyMMdd.withZoneUTC().parseDateTime(text).getMillis());
+    }
+
+    private static Date asDateTime(final String text) {
+        return new java.util.Date(JsonRepresentation.yyyyMMddTHHmmssZ.withZoneUTC().parseDateTime(text).getMillis());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/93a1d5cc/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJodaProperties_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJodaProperties_thenRepresentation_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJodaProperties_thenRepresentation_ok.java
new file mode 100644
index 0000000..e6b55d7
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/Get_givenEntityWithJodaProperties_thenRepresentation_ok.java
@@ -0,0 +1,122 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid;
+
+import java.util.Date;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.ISODateTimeFormat;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.*;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectMemberRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.assertThat;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenEntityWithJodaProperties_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+
+    private DomainObjectRepresentation domainObjectRepr;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+    }
+
+    @Test
+    public void thenMembers() throws Exception {
+
+        // when
+        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, "JodaValuedEntities");
+        domainObjectRepr = client.follow(link).getEntity().as(DomainObjectRepresentation.class);
+
+        // and then members (types)
+        DomainObjectMemberRepresentation property;
+        ScalarValueRepresentation scalarRepr;
+
+        property = domainObjectRepr.getProperty("dateTimeProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("date-time"));
+        assertThat(property.getXIsisFormat(), is("jodadatetime"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        assertThat(scalarRepr.asDateTime(), is(asDateTime("2010-03-31T09:50:43Z")));
+        assertThat(scalarRepr.asString(), is("2010-03-31T09:50:43Z"));
+
+        property = domainObjectRepr.getProperty("localDateProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("date"));
+        assertThat(property.getXIsisFormat(), is("jodalocaldate"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+        assertThat(scalarRepr.asDate(), is(asDate("2008-03-21")));
+        assertThat(scalarRepr.asString(), is("2008-03-21"));
+
+        property = domainObjectRepr.getProperty("localDateTimeProperty");
+        assertThat(property.getMemberType(), is("property"));
+        assertThat(property.getFormat(), is("date-time"));
+        assertThat(property.getXIsisFormat(), is("jodalocaldatetime"));
+        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
+        assertThat(scalarRepr.isString(), is(true));
+
+        final LocalDateTime expected = new LocalDateTime(2009, 4, 29, 13, 45, 22);
+
+        assertThat(scalarRepr.asDateTime(), is(expected.toDate()));
+        assertThat(scalarRepr.asString(), is(ISODateTimeFormat.dateTimeNoMillis().withZoneUTC().print(expected.toDateTime())));
+
+        // and then member types have links to details (selected ones inspected only)
+        property = domainObjectRepr.getProperty("localDateProperty");
+        assertThat(property.getLinkWithRel(Rel.DETAILS), 
+                isLink()
+                    .href(matches(".+\\/objects\\/JODA\\/\\d+\\/properties\\/localDateProperty"))
+                    .httpMethod(RestfulHttpMethod.GET)
+                    .type(RepresentationType.OBJECT_PROPERTY.getMediaType()));
+
+        property = domainObjectRepr.getProperty("localDateTimeProperty");
+        assertThat(property.getLinkWithRel(Rel.DETAILS), 
+                isLink()
+                    .href(matches(".+\\/objects\\/JODA\\/\\d+\\/properties\\/localDateTimeProperty"))
+                    .httpMethod(RestfulHttpMethod.GET)
+                    .type(RepresentationType.OBJECT_PROPERTY.getMediaType()));
+    }
+
+    private static Date asDate(final String text) {
+        return new java.util.Date(JsonRepresentation.yyyyMMdd.withZoneUTC().parseDateTime(text).getMillis());
+    }
+
+    private static Date asDateTime(final String text) {
+        return new java.util.Date(JsonRepresentation.yyyyMMddTHHmmssZ.withZoneUTC().parseDateTime(text).getMillis());
+    }
+
+}