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:50 UTC
[32/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/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
new file mode 100644
index 0000000..b1caf6a
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -0,0 +1,53 @@
+/*
+ * 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.property;
+
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Put_thenResponseHeaders_ContentLength_ok_TODO {
+
+ @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());
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+
+}
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/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
new file mode 100644
index 0000000..33870ce
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_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.property;
+
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Put_thenResponseHeaders_ContentType_ok_TODO {
+
+ @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());
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+}
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/property/Put_thenResponseHeaders_eTag_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_eTag_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_eTag_ok_TODO.java
new file mode 100644
index 0000000..13b950f
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_eTag_ok_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.domainobject.oid.property;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Put_thenResponseHeaders_eTag_ok_TODO {
+
+ @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());
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+}
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/property/Put_then_200_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_then_200_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_then_200_ok.java
new file mode 100644
index 0000000..d8bf6b9
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_then_200_ok.java
@@ -0,0 +1,103 @@
+/*
+ * 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.property;
+
+import javax.ws.rs.core.Response;
+import org.junit.After;
+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.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Put_then_200_ok {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+ private DomainObjectResource domainObjectResource;
+
+ private LinkRepresentation modifyLink;
+ private JsonRepresentation argRepr;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ domainObjectResource = client.getDomainObjectResource();
+
+ }
+
+ @Test
+ public void propertyDetails() throws Exception {
+
+ // given
+ final Response idPropertyResp = domainObjectResource.propertyDetails("JDKV","38", "stringProperty");
+ final RestfulResponse<ObjectPropertyRepresentation> idPropertyJsonResp = RestfulResponse.ofT(idPropertyResp);
+ assertThat(idPropertyJsonResp.getStatus(), is(RestfulResponse.HttpStatusCode.OK));
+
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+
+ @Test
+ public void primitivePropertiesUpdated() throws Exception {
+
+ // given
+ final int i = 999999;
+ final Response domainObjectResp = domainObjectResource.propertyDetails("PRMV", "43", "intProperty");
+ final RestfulResponse<ObjectPropertyRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+ assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Response.Status.Family.SUCCESSFUL));
+
+ ObjectPropertyRepresentation objectPropertyRepr = domainObjectJsonResp.getEntity();
+
+ // when
+ modifyLink = objectPropertyRepr.getLinkWithRel(Rel.MODIFY);
+ argRepr = modifyLink.getArguments().mapPut("value", i);
+ RestfulResponse<JsonRepresentation> result = client.follow(modifyLink, argRepr);
+
+ // then
+ assertThat(result.getStatus(), is(RestfulResponse.HttpStatusCode.OK));
+
+ // then also
+ final JsonRepresentation jsonRepresentation = result.getEntity().as(ObjectPropertyRepresentation.class);
+ assertThat(jsonRepresentation.getInt("value"), is(i));
+
+ }
+
+
+}
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/property/Put_whenArgIsHrefAndLinksToEntityOfWrongType_bad_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsHrefAndLinksToEntityOfWrongType_bad_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsHrefAndLinksToEntityOfWrongType_bad_TODO.java
new file mode 100644
index 0000000..9017c7e
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsHrefAndLinksToEntityOfWrongType_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.domainobject.oid.property;
+
+public class Put_whenArgIsHrefAndLinksToEntityOfWrongType_bad_TODO {
+
+}
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/property/Put_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO.java
new file mode 100644
index 0000000..e2464a3
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_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.domainobject.oid.property;
+
+public class Put_whenArgIsHrefAndLinksToNonExistentEntity_bad_TODO {
+
+}
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/property/Put_whenArgIsMalformed_bad_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsMalformed_bad_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsMalformed_bad_TODO.java
new file mode 100644
index 0000000..8974372
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgIsMalformed_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.domainobject.oid.property;
+
+public class Put_whenArgIsMalformed_bad_TODO {
+
+}
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/property/Put_whenArgMandatoryButMissing_bad_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgMandatoryButMissing_bad_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgMandatoryButMissing_bad_TODO.java
new file mode 100644
index 0000000..753d8ae
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgMandatoryButMissing_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.domainobject.oid.property;
+
+public class Put_whenArgMandatoryButMissing_bad_TODO {
+
+}
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/property/Put_whenArgValidContainsPlus_thenStringPropertyUpdated_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValidContainsPlus_thenStringPropertyUpdated_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValidContainsPlus_thenStringPropertyUpdated_ok_TODO.java
new file mode 100644
index 0000000..34a3e80
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValidContainsPlus_thenStringPropertyUpdated_ok_TODO.java
@@ -0,0 +1,103 @@
+/*
+ * 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.property;
+
+import java.io.IOException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+import org.junit.After;
+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.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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+// for ISIS-797
+public class Put_whenArgValidContainsPlus_thenStringPropertyUpdated_ok_TODO {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+
+ private DomainObjectResource domainObjectResource;
+
+ private LinkRepresentation modifyLink;
+ private JsonRepresentation argRepr;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ domainObjectResource = client.getDomainObjectResource();
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+
+ @Test
+ public void jdkPropertiesUpdated() throws Exception {
+
+ // String
+ final String s = "foo+bar";
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "stringProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", s);
+ assertThat(followedRepr(modifyLink,argRepr).getString("value"), is(s));
+
+ }
+
+
+ private ObjectPropertyRepresentation getObjectPropertyRepr(final String domainType, final String instanceId, String propertyId) throws IOException {
+ final Response domainObjectResp = domainObjectResource.propertyDetails(domainType, instanceId, propertyId);
+ final RestfulResponse<ObjectPropertyRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+ assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ final ObjectPropertyRepresentation repr = domainObjectJsonResp.getEntity();
+ return repr;
+ }
+
+ private LinkRepresentation getObjectPropertyReprModifyLink(String domainType, String instanceId, String propertyId) throws IOException {
+ ObjectPropertyRepresentation objectPropertyRepr = getObjectPropertyRepr(domainType, instanceId, propertyId);
+ return objectPropertyRepr.getLinkWithRel(Rel.MODIFY);
+ }
+
+ private JsonRepresentation followedRepr(LinkRepresentation modifyLink, JsonRepresentation argRepr) throws Exception {
+ RestfulResponse<JsonRepresentation> result = client.follow(modifyLink, argRepr);
+ assertThat(result.getStatus(), is(HttpStatusCode.OK));
+ return result.getEntity().as(ObjectPropertyRepresentation.class);
+ }
+
+}
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/property/Put_whenArgValid_thenJdkPropertyUpdated_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJdkPropertyUpdated_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJdkPropertyUpdated_ok.java
new file mode 100644
index 0000000..84d06f4
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJdkPropertyUpdated_ok.java
@@ -0,0 +1,177 @@
+/*
+ * 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.property;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
+import org.joda.time.format.ISODateTimeFormat;
+import org.junit.After;
+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.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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Put_whenArgValid_thenJdkPropertyUpdated_ok {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+
+ private DomainObjectResource domainObjectResource;
+
+ private LinkRepresentation modifyLink;
+ private JsonRepresentation argRepr;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ domainObjectResource = client.getDomainObjectResource();
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+
+ @Test
+ public void jdkPropertiesUpdated() throws Exception {
+
+ // big decimal
+ final BigDecimal bd = new BigDecimal("12345678901234567.789");
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "bigDecimalProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", bd);
+ assertThat(followedRepr(modifyLink,argRepr).getBigDecimal("value"), is(new BigDecimal("12345678901234567.7890000000"))); // big-decimal(30,10)
+
+ // big integer
+ final BigInteger bi = new BigInteger("123456789012345678");
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "bigIntegerProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", bi);
+ assertThat(followedRepr(modifyLink,argRepr).getBigInteger("value"), is(bi));
+
+ // java.sql.Date
+ final java.sql.Date sqld = new java.sql.Date(new DateTime(2014,5,1, 0,0, DateTimeZone.UTC).getMillis());
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "javaSqlDateProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", asIsoNoT(sqld));
+ assertThat(followedRepr(modifyLink,argRepr).getDate("value"), is((java.util.Date)sqld));
+
+ // java.sql.Time
+ final java.sql.Time sqlt = new java.sql.Time(13,0,0);
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "javaSqlTimeProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", asIsoOnlyT(sqlt));
+ assertThat(followedRepr(modifyLink,argRepr).getTime("value"), is((java.util.Date)sqlt));
+
+ // java.sql.Timestamp
+ final java.sql.Timestamp sqlts = new java.sql.Timestamp(114,4,1,13,0,0,0);
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "javaSqlTimestampProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", sqlts.getTime());
+ assertThat(followedRepr(modifyLink,argRepr).getLong("value"), is(sqlts.getTime()));
+
+ // java.util.Date
+ final java.util.Date d = new java.util.Date(114,4,1,13,0,0);
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "javaUtilDateProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", asIso(d));
+ assertThat(followedRepr(modifyLink,argRepr).getDateTime("value"), is(d));
+
+ // enum
+ final String e = "ORANGE";
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "myEnum");
+ argRepr = modifyLink.getArguments().mapPut("value", e);
+ assertThat(followedRepr(modifyLink,argRepr).getString("value"), is(e));
+
+ // String
+ final String s = "Tangerine";
+ modifyLink = getObjectPropertyReprModifyLink("JDKV", "38", "stringProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", s);
+ assertThat(followedRepr(modifyLink,argRepr).getString("value"), is(s));
+
+ }
+
+
+ private ObjectPropertyRepresentation getObjectPropertyRepr(final String domainType, final String instanceId, String propertyId) throws IOException {
+ final Response domainObjectResp = domainObjectResource.propertyDetails(domainType, instanceId, propertyId);
+ final RestfulResponse<ObjectPropertyRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+ assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ final ObjectPropertyRepresentation repr = domainObjectJsonResp.getEntity();
+ return repr;
+ }
+
+ private LinkRepresentation getObjectPropertyReprModifyLink(String domainType, String instanceId, String propertyId) throws IOException {
+ ObjectPropertyRepresentation objectPropertyRepr = getObjectPropertyRepr(domainType, instanceId, propertyId);
+ return objectPropertyRepr.getLinkWithRel(Rel.MODIFY);
+ }
+
+ private JsonRepresentation followedRepr(LinkRepresentation modifyLink, JsonRepresentation argRepr) throws Exception {
+ RestfulResponse<JsonRepresentation> result = client.follow(modifyLink, argRepr);
+ assertThat(result.getStatus(), is(HttpStatusCode.OK));
+ return result.getEntity().as(ObjectPropertyRepresentation.class);
+ }
+
+
+ private static String asIso(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIso(dt);
+ }
+
+ private static String asIso(final DateTime dt) {
+ return ISODateTimeFormat.basicDateTimeNoMillis().withZoneUTC().print(dt);
+ }
+
+ private static String asIsoNoT(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIsoNoT(dt);
+ }
+
+ private static String asIsoNoT(final DateTime dt) {
+ return ISODateTimeFormat.basicDate().withZoneUTC().print(dt);
+ }
+
+ private static String asIsoOnlyT(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIsoOnlyT(dt);
+ }
+
+ private static String asIsoOnlyT(final DateTime dt) {
+ return ISODateTimeFormat.basicTime().withZoneUTC().print(dt);
+ }
+
+}
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/property/Put_whenArgValid_thenJodaTimePropertyUpdated_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJodaTimePropertyUpdated_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJodaTimePropertyUpdated_ok_TODO.java
new file mode 100644
index 0000000..72c4173
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenJodaTimePropertyUpdated_ok_TODO.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.domainobject.oid.property;
+
+import java.io.IOException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.LocalDateTime;
+import org.joda.time.format.ISODateTimeFormat;
+import org.junit.After;
+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.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Put_whenArgValid_thenJodaTimePropertyUpdated_ok_TODO {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+
+ private DomainObjectResource domainObjectResource;
+
+ private LinkRepresentation modifyLink;
+ private JsonRepresentation argRepr;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ domainObjectResource = client.getDomainObjectResource();
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+ @Ignore("breaking in CET")
+ @Test
+ public void jodaPropertiesUpdated() throws Exception {
+
+ // LocalDate
+ final LocalDate ld = new LocalDate(2013,5,1);
+ modifyLink = getObjectPropertyReprModifyLink("JODA", "82", "localDateProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", "2013-05-01");
+ assertThat(followedRepr(modifyLink,argRepr).getString("value"), is("2013-05-01")); // hacky
+
+ // LocalDateTime
+ final LocalDateTime ldt = new LocalDateTime(2013,2,1,14,15,0);
+ modifyLink = getObjectPropertyReprModifyLink("JODA", "82", "localDateTimeProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", asIso(ldt.toDate()));
+ assertThat(followedRepr(modifyLink,argRepr).getDateTime("value"), is(ldt.toDate()));
+
+ // DateTime
+ final DateTime dt = new DateTime(2013,2,1,14,15,0);
+ modifyLink = getObjectPropertyReprModifyLink("JODA", "82", "dateTimeProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", asIso(dt.toDate()));
+ assertThat(followedRepr(modifyLink,argRepr).getDateTime("value"), is(dt.toDate()));
+
+ // String
+ final String s = "New string";
+ modifyLink = getObjectPropertyReprModifyLink("JODA", "82", "stringProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", s);
+ assertThat(followedRepr(modifyLink,argRepr).getString("value"), is(s));
+ }
+
+ private ObjectPropertyRepresentation getObjectPropertyRepr(final String domainType, final String instanceId, String propertyId) throws IOException {
+ final Response domainObjectResp = domainObjectResource.propertyDetails(domainType, instanceId, propertyId);
+ final RestfulResponse<ObjectPropertyRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+ assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ final ObjectPropertyRepresentation repr = domainObjectJsonResp.getEntity();
+ return repr;
+ }
+
+ private LinkRepresentation getObjectPropertyReprModifyLink(String domainType, String instanceId, String propertyId) throws IOException {
+ ObjectPropertyRepresentation objectPropertyRepr = getObjectPropertyRepr(domainType, instanceId, propertyId);
+ return objectPropertyRepr.getLinkWithRel(Rel.MODIFY);
+ }
+
+ private JsonRepresentation followedRepr(LinkRepresentation modifyLink, JsonRepresentation argRepr) throws Exception {
+ RestfulResponse<JsonRepresentation> result = client.follow(modifyLink, argRepr);
+ assertThat(result.getStatus(), is(HttpStatusCode.OK));
+ return result.getEntity().as(ObjectPropertyRepresentation.class);
+ }
+
+
+ private static String asIso(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIso(dt);
+ }
+
+ private static String asIso(final DateTime dt) {
+ return ISODateTimeFormat.basicDateTimeNoMillis().withZoneUTC().print(dt);
+ }
+
+
+ private static String asIsoNoT(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIsoNoT(dt);
+ }
+
+ private static String asIsoNoT(final DateTime dt) {
+ return ISODateTimeFormat.basicDate().withZoneUTC().print(dt);
+ }
+
+ private static String asIsoOnlyT(final java.util.Date d) {
+ final DateTime dt = new DateTime(d.getTime());
+ return asIsoOnlyT(dt);
+ }
+
+ private static String asIsoOnlyT(final DateTime dt) {
+ return ISODateTimeFormat.basicTime().withZoneUTC().print(dt);
+ }
+
+}
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/property/Put_whenArgValid_thenPrimitivePropertyUpdated_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenPrimitivePropertyUpdated_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenPrimitivePropertyUpdated_ok.java
new file mode 100644
index 0000000..8d81f31
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenArgValid_thenPrimitivePropertyUpdated_ok.java
@@ -0,0 +1,143 @@
+/*
+ * 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.property;
+
+import java.io.IOException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+import org.junit.After;
+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.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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Put_whenArgValid_thenPrimitivePropertyUpdated_ok {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+
+ private DomainObjectResource domainObjectResource;
+
+ private LinkRepresentation modifyLink;
+ private JsonRepresentation argRepr;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ domainObjectResource = client.getDomainObjectResource();
+ }
+
+ /**
+ * Tests change state, so discard such that will be recreated by next test.
+ */
+ @After
+ public void tearDown() throws Exception {
+ webServerRule.discardWebApp();
+ }
+
+ @Test
+ public void primitivePropertiesUpdated() throws Exception {
+
+ // byte
+ final byte b = (byte)99;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "byteProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", b);
+ assertThat(followedRepr(modifyLink,argRepr).getByte("value"), is(b));
+
+ // char
+ final char c = 'b';
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "charProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", c);
+ assertThat(followedRepr(modifyLink,argRepr).getChar("value"), is(c));
+
+ // double
+ final double d = 12345.678;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "doubleProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", d);
+ assertThat(followedRepr(modifyLink,argRepr).getDouble("value"), is(d));
+
+ // float
+ final float f = 54321.123F;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "floatProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", f);
+ assertThat(followedRepr(modifyLink,argRepr).getFloat("value"), is(f));
+
+ // int
+ final int i = 999999;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "intProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", i);
+ assertThat(followedRepr(modifyLink,argRepr).getInt("value"), is(i));
+
+ // long
+ final long l = 99999999999L;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "longProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", l);
+ assertThat(followedRepr(modifyLink,argRepr).getLong("value"), is(l));
+
+ // short
+ final short s = (short)999;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "shortProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", s);
+ assertThat(followedRepr(modifyLink,argRepr).getShort("value"), is(s));
+
+ // boolean
+ final boolean z = false;
+ modifyLink = getObjectPropertyReprModifyLink("PRMV", "43", "booleanProperty");
+ argRepr = modifyLink.getArguments().mapPut("value", z);
+ assertThat(followedRepr(modifyLink,argRepr).getBoolean("value"), is(z));
+
+ }
+
+
+ private ObjectPropertyRepresentation getObjectPropertyRepr(final String domainType, final String instanceId, String propertyId) throws IOException {
+ final Response domainObjectResp = domainObjectResource.propertyDetails(domainType, instanceId, propertyId);
+ final RestfulResponse<ObjectPropertyRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
+ assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ final ObjectPropertyRepresentation repr = domainObjectJsonResp.getEntity();
+ return repr;
+ }
+
+ private LinkRepresentation getObjectPropertyReprModifyLink(String domainType, String instanceId, String propertyId) throws IOException {
+ ObjectPropertyRepresentation objectPropertyRepr = getObjectPropertyRepr(domainType, instanceId, propertyId);
+ return objectPropertyRepr.getLinkWithRel(Rel.MODIFY);
+ }
+
+ private JsonRepresentation followedRepr(LinkRepresentation modifyLink, JsonRepresentation argRepr) throws Exception {
+ RestfulResponse<JsonRepresentation> result = client.follow(modifyLink, argRepr);
+ assertThat(result.getStatus(), is(HttpStatusCode.OK));
+ return result.getEntity().as(ObjectPropertyRepresentation.class);
+ }
+
+}
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/property/Put_whenDoesntExistOid_thenResponseCode_404_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistOid_thenResponseCode_404_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistOid_thenResponseCode_404_TODO.java
new file mode 100644
index 0000000..b7e4f66
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistOid_thenResponseCode_404_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.domainobject.oid.property;
+
+public class Put_whenDoesntExistOid_thenResponseCode_404_TODO {
+
+}
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/property/Put_whenDoesntExistProp_thenResponseCode_404_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistProp_thenResponseCode_404_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistProp_thenResponseCode_404_TODO.java
new file mode 100644
index 0000000..ddbb64f
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_whenDoesntExistProp_thenResponseCode_404_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.domainobject.oid.property;
+
+public class Put_whenDoesntExistProp_thenResponseCode_404_TODO {
+
+}
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/domainobjectorservice/id/action/Delete_givenObjectResource_then_405_bad.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenObjectResource_then_405_bad.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenObjectResource_then_405_bad.java
new file mode 100644
index 0000000..44f460f
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenObjectResource_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.domainobjectorservice.id.action;
+
+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.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Delete_givenObjectResource_then_405_bad {
+
+ @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 representation() throws Exception {
+
+ // given
+ final Response actionPromptResp = domainObjectResource.actionPrompt("RTNE", "78", "contains");
+ final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
+ final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
+ final LinkRepresentation selfLink = actionPromptRepr.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 action prompt resource is not allowed."));
+ }
+
+}
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/domainobjectorservice/id/action/Delete_givenServiceResource_then_405_bad.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenServiceResource_then_405_bad.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenServiceResource_then_405_bad.java
new file mode 100644
index 0000000..0131d9b
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Delete_givenServiceResource_then_405_bad.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.domainobjectorservice.id.action;
+
+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.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+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_givenServiceResource_then_405_bad {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ protected RestfulClient client;
+ private DomainServiceResource serviceResource;
+
+ @Before
+ public void setUp() throws Exception {
+ final WebServer webServer = webServerRule.getWebServer();
+ client = new RestfulClient(webServer.getBase());
+ serviceResource = client.getDomainServiceResource();
+ }
+
+ @Test
+ public void followLink() throws Exception {
+
+ // given
+ final Response actionPromptResp = serviceResource.actionPrompt("ActionsEntities", "subListWithOptionalRange");
+ final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
+ final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
+ final LinkRepresentation selfLink = actionPromptRepr.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 action prompt resource is not allowed."));
+ }
+
+}
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/domainobjectorservice/id/action/Get_givenDisabled_then_403_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDisabled_then_403_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDisabled_then_403_TODO.java
new file mode 100644
index 0000000..e2cb570
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDisabled_then_403_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.domainobjectorservice.id.action;
+
+public class Get_givenDisabled_then_403_TODO {
+
+}
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/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO.java
new file mode 100644
index 0000000..656a330
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/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.domainobjectorservice.id.action;
+
+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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsFormal_thenRepresentation_TODO {
+
+ @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();
+ }
+
+ @Ignore
+ @Test
+ public void representation() 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/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO.java
new file mode 100644
index 0000000..48e0d36
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/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.domainobjectorservice.id.action;
+
+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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+public class Get_givenDomainModelSchemeIsSimple_thenRepresentation_TODO {
+
+ @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();
+ }
+
+ @Ignore
+ @Test
+ public void representation() 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/domainobjectorservice/id/action/Get_givenHidden_then_404.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenHidden_then_404.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenHidden_then_404.java
new file mode 100644
index 0000000..6d153d0
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenHidden_then_404.java
@@ -0,0 +1,58 @@
+/*
+ * 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.domainobjectorservice.id.action;
+
+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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.version.VersionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenHidden_then_404 {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ private RestfulClient client;
+
+ @Before
+ public void setUp() throws Exception {
+ client = webServerRule.getClient();
+ }
+
+ @Test
+ public void returns404() throws Exception {
+
+ // given
+ RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, "objects/BSRL/64/actions/invisibleAction");
+
+ // when
+ final RestfulResponse<VersionRepresentation> restfulResponse = request.executeT();
+
+ assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.NOT_FOUND));
+ }
+
+}
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/domainobjectorservice/id/action/Get_givenViewModel_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenViewModel_thenRepresentation_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenViewModel_thenRepresentation_ok_TODO.java
new file mode 100644
index 0000000..22dd6be
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_givenViewModel_thenRepresentation_ok_TODO.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.domainobjectorservice.id.action;
+
+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.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+
+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.*;
+import static org.junit.Assert.assertThat;
+
+public class Get_givenViewModel_thenRepresentation_ok_TODO {
+
+ @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();
+ }
+
+ @Ignore
+ @Test
+ public void representation() 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/domainobjectorservice/id/action/Get_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok.java
new file mode 100644
index 0000000..b08c954
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok.java
@@ -0,0 +1,107 @@
+/*
+ * 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.domainobjectorservice.id.action;
+
+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.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.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+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.*;
+import static org.junit.Assert.assertThat;
+
+public class Get_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 representation() throws Exception {
+
+ // when
+ final Response actionPromptResp = domainObjectResource.actionPrompt("RTNE", "78", "contains");
+ final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
+ assertThat(actionPromptJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ // then
+ final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
+
+ assertThat(actionPromptRepr.getString("memberType"), is("action"));
+
+ // self link
+ final LinkRepresentation selfLink = actionPromptRepr.getLinkWithRel(Rel.SELF);
+ assertThat(selfLink, isLink(client)
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(endsWith("/objects/RTNE/78/actions/contains"))
+ .returning(HttpStatusCode.OK));
+
+ // up link
+ final LinkRepresentation upLink = actionPromptRepr.getLinkWithRel(Rel.UP);
+ assertThat(upLink, isLink(client)
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(endsWith("/objects/RTNE/78"))
+ .returning(HttpStatusCode.OK)
+ .type(RepresentationType.DOMAIN_OBJECT.getMediaType())
+ .title("Untitled Actions Entity"));
+
+ //invoke link
+ final LinkRepresentation invokeLink = actionPromptRepr.getLinkWithRel(Rel.INVOKE);
+ assertThat(invokeLink, isLink(client)
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(endsWith("/objects/RTNE/78/actions/contains/invoke")));
+
+ assertThat(invokeLink.getArguments(), is(not(nullValue())));
+ assertThat(invokeLink.getArguments().isArray(), is(false));
+ assertThat(invokeLink.getArguments().size(), is(2));
+
+ // described by link
+ final LinkRepresentation describedByLink = actionPromptRepr.getLinkWithRel(Rel.DESCRIBEDBY);
+ assertThat(describedByLink, isLink(client)
+ .returning(HttpStatusCode.OK)
+ .responseEntityWithSelfHref(describedByLink.getHref()));
+
+ assertThat(actionPromptRepr.getExtensions().getString("actionType"), is("user"));
+ assertThat(actionPromptRepr.getExtensions().getString("actionSemantics"), is("safe"));
+ assertThat(actionPromptRepr.getMap("parameters").size(), is(2));
+ }
+}
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/domainobjectorservice/id/action/Get_thenResponseCode_200_ok.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseCode_200_ok.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseCode_200_ok.java
new file mode 100644
index 0000000..cf51675
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseCode_200_ok.java
@@ -0,0 +1,59 @@
+/*
+ * 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.domainobjectorservice.id.action;
+
+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.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class Get_thenResponseCode_200_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 actionPrompt() throws Exception {
+
+ // when
+ final Response actionPromptResp = domainObjectResource.actionPrompt("RTNE", "78", "contains");
+ final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
+ assertThat(actionPromptJsonResp.getStatus(), is(HttpStatusCode.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/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
new file mode 100644
index 0000000..5735936
--- /dev/null
+++ b/mothballed/tck/tck-viewer-restfulobjects/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -0,0 +1,43 @@
+/*
+ * 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.domainobjectorservice.id.action;
+
+import org.apache.isis.core.webserver.WebServer;
+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 Get_thenResponseHeaders_CacheControl_ok_TODO {
+
+ @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());
+ }
+
+
+}