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 2014/10/28 17:16:05 UTC

[02/56] [abbrv] ISIS-937: moved TCK out of core.

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java
new file mode 100644
index 0000000..b25a7aa
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java
@@ -0,0 +1,23 @@
+/*
+ *  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.objectsoftype;
+
+public class Post_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMalformed_bad_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMalformed_bad_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMalformed_bad_TODO.java
new file mode 100644
index 0000000..6637f14
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMalformed_bad_TODO.java
@@ -0,0 +1,23 @@
+/*
+ *  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.objectsoftype;
+
+public class Post_whenArgsMalformed_bad_TODO {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMandatoryButMissing_bad_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMandatoryButMissing_bad_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMandatoryButMissing_bad_TODO.java
new file mode 100644
index 0000000..9166228
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsMandatoryButMissing_bad_TODO.java
@@ -0,0 +1,23 @@
+/*
+ *  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.objectsoftype;
+
+public class Post_whenArgsMandatoryButMissing_bad_TODO {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsValid_thenPersistsObject_ok_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsValid_thenPersistsObject_ok_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsValid_thenPersistsObject_ok_TODO.java
new file mode 100644
index 0000000..ffddefc
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Post_whenArgsValid_thenPersistsObject_ok_TODO.java
@@ -0,0 +1,23 @@
+/*
+ *  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.objectsoftype;
+
+public class Post_whenArgsValid_thenPersistsObject_ok_TODO {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Put_then_405_bad_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Put_then_405_bad_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Put_then_405_bad_TODO.java
new file mode 100644
index 0000000..8a8f5f3
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/objectsoftype/Put_then_405_bad_TODO.java
@@ -0,0 +1,23 @@
+/*
+ *  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.objectsoftype;
+
+public class Put_then_405_bad_TODO {
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Delete_then_405_bad.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Delete_then_405_bad.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Delete_then_405_bad.java
new file mode 100644
index 0000000..a20063d
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Delete_then_405_bad.java
@@ -0,0 +1,73 @@
+/*
+ *  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.user.root;
+
+import javax.ws.rs.core.Response;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isArray;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isMap;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class Delete_then_405_bad {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+    @Test
+    public void representation() throws Exception {
+
+        // given
+        final Response resp = resource.user();
+
+        final RestfulResponse<UserRepresentation> jsonResp = RestfulResponse.ofT(resp);
+        final UserRepresentation repr = jsonResp.getEntity();
+        final LinkRepresentation selfLink = repr.getLinkWithRel(Rel.SELF);
+        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);
+
+        // when
+        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Deleting the user resource is not allowed."));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
new file mode 100644
index 0000000..acaabfb
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
@@ -0,0 +1,50 @@
+/*
+ *  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.user.root;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+    @Ignore
+    @Test
+    public void representation() throws Exception {
+
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
new file mode 100644
index 0000000..5516779
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
@@ -0,0 +1,50 @@
+/*
+ *  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.user.root;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+    @Ignore
+    @Test
+    public void representation() throws Exception {
+
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenRepresentation_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenRepresentation_ok.java
new file mode 100644
index 0000000..6578b26
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenRepresentation_ok.java
@@ -0,0 +1,106 @@
+/*
+ *  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.user.root;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.assertThat;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isArray;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isMap;
+import static org.hamcrest.CoreMatchers.endsWith;
+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 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.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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+    @Test
+    public void representation() throws Exception {
+
+        // given
+        final Response resp = resource.user();
+
+        // when
+        final RestfulResponse<UserRepresentation> jsonResp = RestfulResponse.ofT(resp);
+        assertThat(jsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+        // then
+        assertThat(jsonResp.getStatus(), is(HttpStatusCode.OK));
+
+        final UserRepresentation repr = jsonResp.getEntity();
+        assertThat(repr, is(not(nullValue())));
+        assertThat(repr.isMap(), is(true));
+
+        assertThat(repr.getSelf(), isLink(client)
+                                    .rel(Rel.SELF)
+                                    .href(endsWith(":39393/user"))
+                                    .httpMethod(RestfulHttpMethod.GET)
+                                    .type(RepresentationType.USER.getMediaType())
+                                    .returning(HttpStatusCode.OK)
+                                    );
+        
+        assertThat(repr.getUp(), isLink(client)
+                                    .rel(Rel.UP)
+                                    .href(endsWith(":39393/"))
+                                    .httpMethod(RestfulHttpMethod.GET)
+                                    .type(RepresentationType.HOME_PAGE.getMediaType())
+                                    .returning(HttpStatusCode.OK)
+                                    );
+        assertThat(repr.getUserName(), is(not(nullValue())));
+        
+        // TODO: change fixture so populated
+        assertThat(repr.getFriendlyName(), is(nullValue())); 
+        assertThat(repr.getEmail(), is(nullValue())); 
+        assertThat(repr.getRoles(), is(not(nullValue()))); 
+
+        assertThat(repr.getLinks(), isArray());
+        assertThat(repr.getExtensions(), isMap());
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_CacheControl_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_CacheControl_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_CacheControl_ok.java
new file mode 100644
index 0000000..358cba1
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_CacheControl_ok.java
@@ -0,0 +1,68 @@
+/*
+ *  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.user.root;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasMaxAge;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.Response;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_thenResponseHeaders_CacheControl_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+
+    @Test
+    public void ok() throws Exception {
+
+        // given
+        final Response resp = resource.user();
+
+        // when
+        final RestfulResponse<UserRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        final CacheControl cacheControl = restfulResponse.getHeader(Header.CACHE_CONTROL);
+        assertThat(cacheControl, hasMaxAge(60 * 60));
+        assertThat(cacheControl.getMaxAge(), is(60 * 60));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentLength_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentLength_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentLength_ok.java
new file mode 100644
index 0000000..7a094f0
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentLength_ok.java
@@ -0,0 +1,64 @@
+/*
+ *  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.user.root;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.greaterThan;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_thenResponseHeaders_ContentLength_ok {
+	@Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+
+    @Test
+    public void ok() throws Exception {
+
+        // given
+        final Response resp = resource.user();
+
+        // when
+        final RestfulResponse<UserRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(greaterThan(100)));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentType_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentType_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentType_ok.java
new file mode 100644
index 0000000..a737f94
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_thenResponseHeaders_ContentType_ok.java
@@ -0,0 +1,73 @@
+/*
+ *  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.user.root;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasParameter;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasSubType;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasMediaType;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_thenResponseHeaders_ContentType_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private UserResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getUserResource();
+    }
+
+
+    @Test
+    public void ok() throws Exception {
+
+        // given
+        final Response resp = resource.user();
+
+        // when
+        final RestfulResponse<UserRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
+        assertThat(contentType, hasMediaType("application"));
+        assertThat(contentType, hasSubType("json"));
+        assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects:repr-types/user"));
+        assertThat(contentType, is(RepresentationType.USER.getMediaType()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoDomainModel_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoDomainModel_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoDomainModel_ok.java
new file mode 100644
index 0000000..2054529
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoDomainModel_ok.java
@@ -0,0 +1,70 @@
+/*
+ *  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.user.root;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_whenQueryArg_xRoDomainModel_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private RestfulRequest request;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        request = client.createRequest(RestfulHttpMethod.GET, "user");
+    }
+
+    @Test
+    public void simple_rejected() throws Exception {
+
+        request.withArg(RequestParameter.DOMAIN_MODEL, "simple");
+        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.BAD_REQUEST));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("x-ro-domain-model of 'simple' is not supported"));
+    }
+
+    @Test
+    public void formal_accepted() throws Exception {
+
+        request.withArg(RequestParameter.DOMAIN_MODEL, "formal");
+        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoFollowLinks_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoFollowLinks_thenRepresentation_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoFollowLinks_thenRepresentation_ok.java
new file mode 100644
index 0000000..aa01426
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenQueryArg_xRoFollowLinks_thenRepresentation_ok.java
@@ -0,0 +1,89 @@
+/*
+ *  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.user.root;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+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.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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_whenQueryArg_xRoFollowLinks_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+
+    private RestfulRequest request;
+    private RestfulResponse<UserRepresentation> restfulResponse;
+    private UserRepresentation repr;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+
+    }
+
+    @Test
+    public void noFollow() throws Exception {
+
+        request = client.createRequest(RestfulHttpMethod.GET, "user");
+        restfulResponse = request.executeT();
+        repr = restfulResponse.getEntity();
+
+        assertThat(repr.getSelf().getValue(), is(nullValue()));
+        assertThat(repr.getUp().getValue(), is(nullValue()));
+    }
+
+    @Test
+    public void self() throws Exception {
+
+        request = client.createRequest(RestfulHttpMethod.GET, "user")
+                    .withArg(RequestParameter.FOLLOW_LINKS, "links[rel=" + Rel.SELF.getName() + "]");
+        restfulResponse = request.executeT();
+        repr = restfulResponse.getEntity();
+
+        assertThat(repr.getSelf().getValue(), is(not(nullValue())));
+    }
+
+    @Test
+    public void up() throws Exception {
+
+        request = client.createRequest(RestfulHttpMethod.GET, "user")
+                    .withArg(RequestParameter.FOLLOW_LINKS, "links[rel=" + Rel.UP.getName() + "]");
+        restfulResponse = request.executeT();
+        repr = restfulResponse.getEntity();
+
+        assertThat(repr.getUp().getValue(), is(not(nullValue())));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_ok.java
new file mode 100644
index 0000000..e467907
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_ok.java
@@ -0,0 +1,78 @@
+/*
+ *  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.user.root;
+
+import javax.ws.rs.core.MediaType;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_whenRequestHeaders_Accept_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private RestfulRequest request;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        request = client.createRequest(RestfulHttpMethod.GET, "user");
+    }
+
+    @Test
+    public void applicationJson_noProfile_returns200() throws Exception {
+
+        request.withHeader(RestfulRequest.Header.ACCEPT, MediaType.APPLICATION_JSON_TYPE);
+        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.CONTENT_TYPE), is(RepresentationType.USER.getMediaType()));
+    }
+
+    @Test
+    public void applicationJson_profileUser_returns200() throws Exception {
+
+        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());
+        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+    }
+
+    @Test
+    public void missingHeader_returns200() throws Exception {
+
+        final RestfulResponse<UserRepresentation> restfulResp = request.executeT();
+
+        assertThat(restfulResp.getStatus(), is(HttpStatusCode.OK));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_whenInvalid_then_406_bad.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_whenInvalid_then_406_bad.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_whenInvalid_then_406_bad.java
new file mode 100644
index 0000000..ebf1b96
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Get_whenRequestHeaders_Accept_whenInvalid_then_406_bad.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.user.root;
+
+import javax.ws.rs.core.MediaType;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
+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.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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_whenRequestHeaders_Accept_whenInvalid_then_406_bad {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+    }
+
+    @Test
+    public void applicationJson_profileIncorrect_returns406() throws Exception {
+
+        // given
+        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "user");
+        request.withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.VERSION.getMediaType());
+
+        // when
+        final RestfulResponse<UserRepresentation> restfulResponse = request.executeT();
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
+    }
+
+    @Test
+    public void incorrectMediaType_returns406() throws Exception {
+
+        // given
+        final ClientRequest clientRequest = client.getClientRequestFactory().createRelativeRequest("user");
+        clientRequest.accept(MediaType.APPLICATION_ATOM_XML_TYPE);
+
+        // when
+        final ClientResponse<?> resp = clientRequest.get();
+        final RestfulResponse<JsonRepresentation> restfulResponse = RestfulResponse.of(resp);
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_ACCEPTABLE));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Post_then_405_bad.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Post_then_405_bad.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Post_then_405_bad.java
new file mode 100644
index 0000000..1fd9e68
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Post_then_405_bad.java
@@ -0,0 +1,72 @@
+/*
+ *  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.user.root;
+
+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.JsonRepresentation;
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Post_then_405_bad {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+    private UserResource userResource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        userResource = client.getUserResource();
+    }
+
+    @Test
+    public void followLink() throws Exception {
+
+        // given
+        final Response serviceResp = userResource.user();
+        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
+        final UserRepresentation serviceRepr = serviceJsonResp.getEntity();
+        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
+        final LinkRepresentation postLink = selfLink.withMethod(RestfulHttpMethod.POST);
+
+        // when
+        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(postLink);
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Posting to the user resource is not allowed."));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Put_then_405_bad.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Put_then_405_bad.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Put_then_405_bad.java
new file mode 100644
index 0000000..67df477
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/user/root/Put_then_405_bad.java
@@ -0,0 +1,72 @@
+/*
+ *  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.user.root;
+
+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.JsonRepresentation;
+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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Put_then_405_bad {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    protected RestfulClient client;
+    private UserResource userResource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        userResource = client.getUserResource();
+    }
+
+    @Test
+    public void followLink() throws Exception {
+
+        // given
+        final Response serviceResp = userResource.user();
+        final RestfulResponse<UserRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
+        final UserRepresentation serviceRepr = serviceJsonResp.getEntity();
+        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
+        final LinkRepresentation putLink = selfLink.withMethod(RestfulHttpMethod.PUT);
+
+        // when
+        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(putLink);
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Putting to the user resource is not allowed."));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Delete_then_405_bad.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Delete_then_405_bad.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Delete_then_405_bad.java
new file mode 100644
index 0000000..7114ab7
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Delete_then_405_bad.java
@@ -0,0 +1,78 @@
+/*
+ *  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.version;
+
+import javax.ws.rs.core.Response;
+
+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.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.user.UserRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.user.UserResource;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionResource;
+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();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        client = webServerRule.getClient();
+        resource = client.getVersionResource();
+    }
+
+    @Test
+    public void representation() throws Exception {
+
+        Util.serviceActionListInvokeFirstReference(client, "PrimitiveValuedEntities");
+
+        // given
+        final Response resp = resource.version();
+
+        final RestfulResponse<VersionRepresentation> jsonResp = RestfulResponse.ofT(resp);
+        final VersionRepresentation repr = jsonResp.getEntity();
+        final LinkRepresentation selfLink = repr.getLinkWithRel(Rel.SELF);
+        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);
+
+        // when
+        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Deleting the version resource is not allowed."));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
new file mode 100644
index 0000000..7c687cb
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsFormal_thenRepresentation_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.version;
+
+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.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        resource = client.getVersionResource();
+    }
+
+    @Ignore
+    @Test
+    public void representation() throws Exception {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
new file mode 100644
index 0000000..a202434
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_givenDomainModelSchemeIsSimple_thenRepresentation_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.version;
+
+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.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        resource = client.getVersionResource();
+    }
+
+    @Ignore
+    @Test
+    public void representation() throws Exception {
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenRepresentation_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenRepresentation_ok.java
new file mode 100644
index 0000000..e2b9276
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenRepresentation_ok.java
@@ -0,0 +1,113 @@
+/*
+ *  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.version;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.assertThat;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isArray;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isMap;
+import static org.hamcrest.CoreMatchers.endsWith;
+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 javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_thenRepresentation_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        resource = client.getVersionResource();
+    }
+
+    @Test
+    public void representation() throws Exception {
+
+        // given
+        final Response servicesResp = resource.version();
+
+        // when
+        final RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(servicesResp);
+        assertThat(restfulResponse.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+        // then
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+
+        final VersionRepresentation repr = restfulResponse.getEntity();
+        assertThat(repr, is(not(nullValue())));
+        assertThat(repr, isMap());
+
+        assertThat(repr.getSelf(), isLink(client)
+                                    .rel(Rel.SELF)
+                                    .href(endsWith(":39393/version"))
+                                    .httpMethod(RestfulHttpMethod.GET)
+                                    .type(RepresentationType.VERSION.getMediaType())
+                                    .returning(HttpStatusCode.OK)
+                                    );
+        assertThat(repr.getUp(), isLink(client)
+                                    .rel(Rel.UP)
+                                    .href(endsWith(":39393/"))
+                                    .httpMethod(RestfulHttpMethod.GET)
+                                    .type(RepresentationType.HOME_PAGE.getMediaType())
+                                    .returning(HttpStatusCode.OK)
+                                    );
+
+        assertThat(repr.getString("specVersion"), is("1.0.0"));
+        assertThat(repr.getString("implVersion"), is(not(nullValue())));
+        //assertThat(repr.getString("implVersion"), is(not("UNKNOWN")));
+
+        final JsonRepresentation optionalCapbilitiesRepr = repr.getOptionalCapabilities();
+        assertThat(optionalCapbilitiesRepr, isMap());
+
+        assertThat(optionalCapbilitiesRepr.getString("blobsClobs"), is("yes"));
+        assertThat(optionalCapbilitiesRepr.getString("deleteObjects"), is("yes"));
+        assertThat(optionalCapbilitiesRepr.getString("domainModel"), is("formal"));
+        assertThat(optionalCapbilitiesRepr.getString("validateOnly"), is("yes"));
+        assertThat(optionalCapbilitiesRepr.getString("protoPersistentObjects"), is("yes"));
+
+        assertThat(repr.getLinks(), isArray());
+        assertThat(repr.getExtensions(), is(not(nullValue())));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_CacheControl_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_CacheControl_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_CacheControl_ok.java
new file mode 100644
index 0000000..93cf511
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_CacheControl_ok.java
@@ -0,0 +1,71 @@
+/*
+ *  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.version;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasMaxAge;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.CacheControl;
+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.Header;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_thenResponseHeaders_CacheControl_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        resource = client.getVersionResource();
+    }
+
+
+    @Test
+    public void ok() throws Exception {
+        // given
+        final Response resp = resource.version();
+
+        // when
+        final RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        final CacheControl cacheControl = restfulResponse.getHeader(Header.CACHE_CONTROL);
+        assertThat(cacheControl, hasMaxAge(24 * 60 * 60));
+        assertThat(cacheControl.getMaxAge(), is(24 * 60 * 60));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentLength_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentLength_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentLength_ok.java
new file mode 100644
index 0000000..085eb69
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentLength_ok.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.version;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+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.Header;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_thenResponseHeaders_ContentLength_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+        
+        resource = client.getVersionResource();
+    }
+    
+    @Test
+    public void ok() throws Exception {
+    	// given
+        final Response resp = resource.version();
+
+        // when
+        final RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(IsisMatchers.greaterThan(100)));
+    }
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentType_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentType_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentType_ok.java
new file mode 100644
index 0000000..70a1fb1
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_thenResponseHeaders_ContentType_ok.java
@@ -0,0 +1,76 @@
+/*
+ *  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.version;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasParameter;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasSubType;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasMediaType;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import javax.ws.rs.core.MediaType;
+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.RepresentationType;
+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.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_thenResponseHeaders_ContentType_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private VersionResource resource;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        resource = client.getVersionResource();
+    }
+
+
+    @Test
+    public void ok() throws Exception {
+        // given
+        final Response resp = resource.version();
+
+        // when
+        final RestfulResponse<VersionRepresentation> restfulResponse = RestfulResponse.ofT(resp);
+
+        // then
+        final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
+        assertThat(contentType, hasMediaType("application"));
+        assertThat(contentType, hasSubType("json"));
+        assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects:repr-types/version"));
+        assertThat(contentType, is(RepresentationType.VERSION.getMediaType()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/21e2882a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_whenQueryArg_xRoDomainModel_ok.java
----------------------------------------------------------------------
diff --git a/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_whenQueryArg_xRoDomainModel_ok.java b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_whenQueryArg_xRoDomainModel_ok.java
new file mode 100644
index 0000000..6787203
--- /dev/null
+++ b/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/version/Get_whenQueryArg_xRoDomainModel_ok.java
@@ -0,0 +1,71 @@
+/*
+ *  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.version;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.isis.core.webserver.WebServer;
+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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulRequest.RequestParameter;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_whenQueryArg_xRoDomainModel_ok {
+
+    @Rule
+    public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+    private RestfulClient client;
+    private RestfulRequest request;
+
+    @Before
+    public void setUp() throws Exception {
+        final WebServer webServer = webServerRule.getWebServer();
+        client = new RestfulClient(webServer.getBase());
+
+        request = client.createRequest(RestfulHttpMethod.GET, "version");
+    }
+
+    @Test
+    public void simple_rejected() throws Exception {
+
+        request.withArg(RequestParameter.DOMAIN_MODEL, "simple");
+        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.BAD_REQUEST));
+        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("x-ro-domain-model of 'simple' is not supported"));
+    }
+
+    @Test
+    public void formal_accepted() throws Exception {
+
+        request.withArg(RequestParameter.DOMAIN_MODEL, "formal");
+        final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
+
+        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+    }
+}