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 2013/04/27 20:32:05 UTC
[46/50] [abbrv] ISIS-233: more tck tests for RO viewer.
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentLength_ok_TODO.java
index 5905a2c..7de8aa6 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -39,23 +39,4 @@ public class Put_thenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentType_ok_TODO.java
index 8b1edee..78ab327 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/collection/Put_thenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Put_thenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_CacheControl_ok_TODO.java
index 080558e..828224c 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,4 @@ public class Delete_thenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentLength_ok_TODO.java
index 6817fbc..5fcfd83 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -39,23 +39,5 @@ public class Delete_thenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentType_ok_TODO.java
index e943156..7438f08 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Delete_thenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Delete_thenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenRepresentation_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenRepresentation_ok_TODO.java
index ef674ce..05ef7a9 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenRepresentation_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenRepresentation_ok_TODO.java
@@ -1,5 +1,78 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid.property;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+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.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.isis.core.tck.dom.scalars.ApplibValuedEntityRepository;
+import org.apache.isis.core.webserver.WebServer;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectPropertyRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+
public class Get_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("to get working again")
+ @Test
+ public void propertyDetails() throws Exception {
+
+ // when
+ final Response idPropertyResp = domainObjectResource.propertyDetails("OID","1", "id");
+ final RestfulResponse<ObjectPropertyRepresentation> idPropertyJsonResp = RestfulResponse.ofT(idPropertyResp);
+ assertThat(idPropertyJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ // then
+ final ObjectPropertyRepresentation propertyDetailsRepr = idPropertyJsonResp.getEntity();
+
+ // _self.link
+ final LinkRepresentation selfLink = propertyDetailsRepr.getLink("_self.link");
+ assertThat(selfLink.getRel(), is("member"));
+ assertThat(selfLink.getHref(), matches(".+objects/OID:1/properties/id"));
+ assertThat(selfLink.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ // _self.object
+ final LinkRepresentation selfObject = propertyDetailsRepr.getLink("_self.object");
+ assertThat(selfObject.getRel(), is("object"));
+ assertThat(selfObject.getHref(), matches(".+objects/OID:1"));
+ assertThat(selfObject.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ // type
+ final LinkRepresentation type = propertyDetailsRepr.getLink("type");
+ assertThat(type.getRel(), is("type"));
+ assertThat(type.getHref(), matches(".+vnd\\.string\\+json"));
+ assertThat(type.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ assertThat(propertyDetailsRepr.getString("memberType"), is("property"));
+ assertThat(propertyDetailsRepr.getString("value"), is(ApplibValuedEntityRepository.class.getName()));
+ assertThat(propertyDetailsRepr.getString("disabledReason"), is(not(nullValue())));
+ }
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_CacheControl_ok_TODO.java
index eeb6ea1..00b2de8 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_thenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentLength_ok_TODO.java
index a7f8bd4..97b45d1 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -18,13 +18,12 @@
*/
package org.apache.isis.viewer.restfulobjects.tck.domainobject.oid.property;
+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;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
public class Get_thenResponseHeaders_ContentLength_ok_TODO {
@@ -39,23 +38,5 @@ public class Get_thenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentType_ok_TODO.java
index 6fa75c7..68eeefa 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_thenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_thenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_CacheControl_ok_TODO.java
index 5a93877..49e8c1b 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,5 @@ public class Get_whenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentLength_ok_TODO.java
index a59b276..6e5e668 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentLength_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_whenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentType_ok_TODO.java
index 59572fb..b304818 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Get_whenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_whenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_CacheControl_ok_TODO.java
index 6023482..0c1b0f3 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,4 @@ public class Put_thenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
index 098594d..bca850b 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -39,23 +39,5 @@ public class Put_thenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
index 9788f94..42880d5 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobject/oid/property/Put_thenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Put_thenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok_TODO.java
index d4cc93b..f0e94fb 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenRepresentation_ok_TODO.java
@@ -1,5 +1,86 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action;
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+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.Ignore;
+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.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;
+
public class Get_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("to get working again")
+ @Test
+ public void actionPrompt() throws Exception {
+
+ // when
+ final Response actionPromptResp = domainObjectResource.actionPrompt("OID","1", "list");
+ final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
+ assertThat(actionPromptJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));
+
+ // then
+ final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
+
+ // _self.link
+ final LinkRepresentation selfLink = actionPromptRepr.getLink("_self.link");
+ assertThat(selfLink.getRel(), is("member"));
+ assertThat(selfLink.getHref(), matches(".+objects/OID:1/actions/list"));
+ assertThat(selfLink.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ // _self.object
+ final LinkRepresentation selfObject = actionPromptRepr.getLink("_self.object");
+ assertThat(selfObject.getRel(), is("object"));
+ assertThat(selfObject.getHref(), matches(".+objects/OID:1"));
+ assertThat(selfObject.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ // type
+ final LinkRepresentation type = actionPromptRepr.getLink("type");
+ assertThat(type.getRel(), is("type"));
+ assertThat(type.getHref(), matches(".+vnd\\.list\\+json"));
+ assertThat(type.getHttpMethod(), is(RestfulHttpMethod.GET));
+
+ assertThat(actionPromptRepr.getString("memberType"), is("action"));
+ assertThat(actionPromptRepr.getString("actionType"), is("USER"));
+ assertThat(actionPromptRepr.getInt("numParameters"), is(0));
+ assertThat(actionPromptRepr.getArray("parameters").size(), is(0));
+
+ final LinkRepresentation invokeLink = actionPromptRepr.getLink("invoke");
+ assertThat(invokeLink.getRel(), is("invoke"));
+ assertThat(invokeLink.getHref(), matches(".+objects/OID:1/actions/list/invoke"));
+ assertThat(invokeLink.getHttpMethod(), is(RestfulHttpMethod.POST));
+ assertThat(invokeLink.getArguments(), is(not(nullValue())));
+ assertThat(invokeLink.getArguments().isArray(), is(true));
+ assertThat(invokeLink.getArguments().size(), is(0));
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
index c767beb..5735936 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,5 @@ public class Get_thenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentLength_ok_TODO.java
index 00d1d50..5b1facb 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_thenResponseHeaders_ContentLength_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentType_ok_TODO.java
index 261e4b2..dc9bbc5 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/Get_thenResponseHeaders_ContentType_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_thenResponseHeaders_ContentType_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TODO.java
deleted file mode 100644
index 4ccc054..0000000
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TODO.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.invoke;
-
-import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasProfile;
-import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasStatus;
-import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Ignore;
-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.client.RestfulResponse.Header;
-import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.util.UrlEncodingUtils;
-import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
-import org.apache.isis.viewer.restfulobjects.tck.Util;
-
-public class Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TODO {
-
- @Rule
- public IsisWebServerRule webServerRule = new IsisWebServerRule();
-
- private RestfulClient client;
-
- private DomainServiceResource serviceResource;
-
- @Before
- public void setUp() throws Exception {
- client = webServerRule.getClient();
-
- serviceResource = client.getDomainServiceResource();
- }
-
- @Ignore("to write - copied from req_safe")
- @Test
- public void usingClientFollow() throws Exception {
-
- // given, when
- final JsonRepresentation givenAction = Util.givenAction(client, "ActionsEntities", "subListWithOptionalRange");
- final ObjectActionRepresentation actionRepr = givenAction.as(ObjectActionRepresentation.class);
-
- final LinkRepresentation invokeLink = actionRepr.getInvoke();
-
- assertThat(invokeLink, isLink(client)
- .rel(Rel.INVOKE)
- .httpMethod(RestfulHttpMethod.GET)
- .href(Matchers.endsWith(":39393/services/ActionsEntities/actions/subListWithOptionalRange/invoke"))
- .build());
-
- invokeLink.withMethod(RestfulHttpMethod.POST);
-
- // when
- JsonRepresentation args = JsonRepresentation.newMap();
- args = JsonRepresentation.newMap();
- args.mapPut("id.value", 123);
-
- final RestfulResponse<ActionResultRepresentation> restfulResponse = client.followT(invokeLink, args);
-
- // then
- thenResponseIsErrorWithInvalidReason(restfulResponse);
- }
-
-
- // not possible to test using resourceProxy
-
-
- private static void thenResponseIsErrorWithInvalidReason(final RestfulResponse<ActionResultRepresentation> restfulResponse) throws JsonParseException, JsonMappingException, IOException {
- assertThat(restfulResponse, hasStatus(HttpStatusCode.METHOD_NOT_ALLOWED));
- assertThat(restfulResponse.getHeader(Header.WARNING), is("object is immutable")); // not a good message, but as per spec
-
- // hmmm... what is the media type, though? the spec doesn't say. testing for a generic one.
- assertThat(restfulResponse.getHeader(Header.CONTENT_TYPE), hasProfile(MediaType.APPLICATION_JSON));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TOFIX.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TOFIX.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TOFIX.java
new file mode 100644
index 0000000..6f8bada
--- /dev/null
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TOFIX.java
@@ -0,0 +1,112 @@
+/*
+ * 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.invoke;
+
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasProfile;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasStatus;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Ignore;
+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.client.RestfulResponse.Header;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.util.UrlEncodingUtils;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+
+public class Get_givenActionSemanticsOfNotIdempotent_thenResponseCode_205_bad_TOFIX {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ private RestfulClient client;
+
+ private DomainServiceResource serviceResource;
+
+ @Before
+ public void setUp() throws Exception {
+ client = webServerRule.getClient();
+
+ serviceResource = client.getDomainServiceResource();
+ }
+
+ @Ignore("to write - copied from req_safe")
+ @Test
+ public void usingClientFollow() throws Exception {
+
+ // given, when
+ final JsonRepresentation givenAction = Util.givenAction(client, "ActionsEntities", "subListWithOptionalRange");
+ final ObjectActionRepresentation actionRepr = givenAction.as(ObjectActionRepresentation.class);
+
+ final LinkRepresentation invokeLink = actionRepr.getInvoke();
+
+ assertThat(invokeLink, isLink(client)
+ .rel(Rel.INVOKE)
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(Matchers.endsWith(":39393/services/ActionsEntities/actions/subListWithOptionalRange/invoke"))
+ .build());
+
+ invokeLink.withMethod(RestfulHttpMethod.POST);
+
+ // when
+ JsonRepresentation args = JsonRepresentation.newMap();
+ args = JsonRepresentation.newMap();
+ args.mapPut("id.value", 123);
+
+ final RestfulResponse<ActionResultRepresentation> restfulResponse = client.followT(invokeLink, args);
+
+ // then
+ thenResponseIsErrorWithInvalidReason(restfulResponse);
+ }
+
+
+ // not possible to test using resourceProxy
+
+
+ private static void thenResponseIsErrorWithInvalidReason(final RestfulResponse<ActionResultRepresentation> restfulResponse) throws JsonParseException, JsonMappingException, IOException {
+ assertThat(restfulResponse, hasStatus(HttpStatusCode.METHOD_NOT_ALLOWED));
+ assertThat(restfulResponse.getHeader(Header.WARNING), is("object is immutable")); // not a good message, but as per spec
+
+ // hmmm... what is the media type, though? the spec doesn't say. testing for a generic one.
+ assertThat(restfulResponse.getHeader(Header.CONTENT_TYPE), hasProfile(MediaType.APPLICATION_JSON));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_ok_TODO.java
index cd56d2b..5056aa9 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_ok_TODO.java
@@ -1,10 +1,28 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_givenNoValidatableArgs_whenQueryArg_XroValidateOnly_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());
+ }
+
@Ignore
@Test
public void success() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_ok_TODO.java
index b8b0415..9671e8d 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_ok_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_givenRefArg_whnArgIsHrefAndLinksToEntityOfWrongType_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());
+ }
+
@Ignore
@Test
public void success() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
new file mode 100644
index 0000000..b44a5ea
--- /dev/null
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
@@ -0,0 +1,117 @@
+/*
+ * 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.invoke;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasProfile;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+
+import org.apache.isis.core.commons.matchers.IsisMatchers;
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.Header;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation.ResultType;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ListRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_thenRespHeaders_ContentType_andContentLength_andRespCode_200_ok {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ private RestfulClient client;
+
+ private DomainServiceResource serviceResource;
+
+ @Before
+ public void setUp() throws Exception {
+ client = webServerRule.getClient();
+
+ serviceResource = client.getDomainServiceResource();
+ }
+
+ @Test
+ public void usingClientFollow() throws Exception {
+
+ // given
+ final JsonRepresentation givenAction = Util.givenAction(client, "ActionsEntities", "list");
+ final ObjectActionRepresentation actionRepr = givenAction.as(ObjectActionRepresentation.class);
+
+ final LinkRepresentation invokeLink = actionRepr.getInvoke();
+
+ assertThat(invokeLink, isLink(client)
+ .rel(Rel.INVOKE)
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(Matchers.endsWith(":39393/services/ActionsEntities/actions/list/invoke"))
+ .arguments(JsonRepresentation.newMap())
+ .build());
+
+ // when
+ final RestfulResponse<ActionResultRepresentation> restfulResponse = client.followT(invokeLink);
+
+ // then
+ then(restfulResponse);
+ }
+
+ @Test
+ public void usingResourceProxy() throws Exception {
+
+ // given, when
+ Response response = serviceResource.invokeActionQueryOnly("ActionsEntities", "list", null);
+ RestfulResponse<ActionResultRepresentation> restfulResponse = RestfulResponse.ofT(response);
+
+ then(restfulResponse);
+ }
+
+ private static void then(final RestfulResponse<ActionResultRepresentation> restfulResponse) throws JsonParseException, JsonMappingException, IOException {
+
+ assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+ assertThat(restfulResponse.getHeader(Header.CONTENT_TYPE), hasProfile(RestfulMediaType.APPLICATION_JSON_ACTION_RESULT));
+ assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(IsisMatchers.greaterThan(1000)));
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenResponseHeaders_CacheControl_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenResponseHeaders_CacheControl_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenResponseHeaders_CacheControl_ok_TODO.java
index 38b3aa3..dbdedb6 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenResponseHeaders_CacheControl_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_thenResponseHeaders_CacheControl_ok_TODO.java
@@ -39,23 +39,4 @@ public class Get_thenResponseHeaders_CacheControl_ok_TODO {
client = new RestfulClient(webServer.getBase());
}
- @Ignore
- @Test
- public void noCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void shortTermCaching() throws Exception {
-
- }
-
- @Ignore
- @Test
- public void longTermCaching() throws Exception {
-
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_TODO.java
index 176d22f..b604cee 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenArgIsValid_and_thenQueryArg_XroValidateOnly_2xx_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());
+ }
+
@Ignore
@Test
public void success() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenCreatedNewObject_thenResponseCode_201_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenCreatedNewObject_thenResponseCode_201_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenCreatedNewObject_thenResponseCode_201_ok_TODO.java
index 9245a59..c88eb8e 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenCreatedNewObject_thenResponseCode_201_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenCreatedNewObject_thenResponseCode_201_ok_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenCreatedNewObject_thenResponseCode_201_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());
+ }
+
@Ignore
@Test
public void todo() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenErrorThrown_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenErrorThrown_thenRepresentation_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenErrorThrown_thenRepresentation_ok_TODO.java
index baedd69..8404d32 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenErrorThrown_thenRepresentation_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenErrorThrown_thenRepresentation_ok_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenErrorThrown_thenRepresentation_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());
+ }
+
@Ignore
@Test
public void todo() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_TODO.java
index 6abcaa9..faab93e 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenInvalidArg_andQueryArg_XroValidateOnly_then_4xx_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());
+ }
+
@Ignore
@Test
public void success() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepr_andRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepr_andRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepr_andRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
deleted file mode 100644
index 2ead161..0000000
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepr_andRespHeaders_ContentType_andContentLength_andRespCode_200_ok.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.invoke;
-
-import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasProfile;
-import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
-import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.Response;
-
-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.RestfulMediaType;
-import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
-import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
-import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.Header;
-import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation.ResultType;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
-import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ListRepresentation;
-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 org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class Get_whenList_thenRepr_andRespHeaders_ContentType_andContentLength_andRespCode_200_ok {
-
- @Rule
- public IsisWebServerRule webServerRule = new IsisWebServerRule();
-
- private RestfulClient client;
-
- private DomainServiceResource serviceResource;
-
- @Before
- public void setUp() throws Exception {
- client = webServerRule.getClient();
-
- serviceResource = client.getDomainServiceResource();
- }
-
- @Test
- public void usingClientFollow() throws Exception {
-
- // given
- final JsonRepresentation givenAction = Util.givenAction(client, "ActionsEntities", "list");
- final ObjectActionRepresentation actionRepr = givenAction.as(ObjectActionRepresentation.class);
-
- final LinkRepresentation invokeLink = actionRepr.getInvoke();
-
- assertThat(invokeLink, isLink(client)
- .rel(Rel.INVOKE)
- .httpMethod(RestfulHttpMethod.GET)
- .href(Matchers.endsWith(":39393/services/ActionsEntities/actions/list/invoke"))
- .arguments(JsonRepresentation.newMap())
- .build());
-
- // when
- final RestfulResponse<ActionResultRepresentation> restfulResponse = client.followT(invokeLink);
-
- // then
- then(restfulResponse);
- }
-
- @Test
- public void usingResourceProxy() throws Exception {
-
- // given, when
- Response response = serviceResource.invokeActionQueryOnly("ActionsEntities", "list", null);
- RestfulResponse<ActionResultRepresentation> restfulResponse = RestfulResponse.ofT(response);
-
- then(restfulResponse);
- }
-
- private static void then(final RestfulResponse<ActionResultRepresentation> restfulResponse) throws JsonParseException, JsonMappingException, IOException {
-
- assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
- assertThat(restfulResponse.getHeader(Header.CONTENT_TYPE), hasProfile(RestfulMediaType.APPLICATION_JSON_ACTION_RESULT));
- assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(2090));
-
- final ActionResultRepresentation actionResultRepr = restfulResponse.getEntity();
-
- assertThat(actionResultRepr.getResultType(), is(ResultType.LIST));
- final ListRepresentation listRepr = actionResultRepr.getResult().as(ListRepresentation.class);
- assertThat(listRepr.getValue().size(), is(5));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepresentation_ok.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepresentation_ok.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepresentation_ok.java
new file mode 100644
index 0000000..6e4f1ef
--- /dev/null
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenList_thenRepresentation_ok.java
@@ -0,0 +1,111 @@
+/*
+ * 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.invoke;
+
+import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.hasProfile;
+import static org.apache.isis.viewer.restfulobjects.tck.RestfulMatchers.isLink;
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status.Family;
+
+import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.Rel;
+import org.apache.isis.viewer.restfulobjects.applib.RepresentationType;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulHttpMethod;
+import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulClient;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.Header;
+import org.apache.isis.viewer.restfulobjects.applib.client.RestfulResponse.HttpStatusCode;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ActionResultRepresentation.ResultType;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainServiceResource;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ListRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ObjectActionRepresentation;
+import org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation;
+import org.apache.isis.viewer.restfulobjects.tck.IsisWebServerRule;
+import org.apache.isis.viewer.restfulobjects.tck.Util;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class Get_whenList_thenRepresentation_ok {
+
+ @Rule
+ public IsisWebServerRule webServerRule = new IsisWebServerRule();
+
+ private RestfulClient client;
+
+ private DomainServiceResource serviceResource;
+
+ @Before
+ public void setUp() throws Exception {
+ client = webServerRule.getClient();
+
+ serviceResource = client.getDomainServiceResource();
+ }
+
+ @Test
+ public void usingResourceProxy() throws Exception {
+
+ // given, when
+ Response response = serviceResource.invokeActionQueryOnly("ActionsEntities", "list", null);
+ RestfulResponse<ActionResultRepresentation> restfulResponse = RestfulResponse.ofT(response);
+
+ // then
+ assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
+
+ final ActionResultRepresentation actionResultRepr = restfulResponse.getEntity();
+
+ assertThat(actionResultRepr.getResultType(), is(ResultType.LIST));
+ final ListRepresentation listRepr = actionResultRepr.getResult().as(ListRepresentation.class);
+
+ // then list value
+ assertThat(listRepr.getValue(), is(not(nullValue())));
+ assertThat(listRepr.getValue().size(), is(5));
+
+ final JsonRepresentation domainObjectLinkRepr = listRepr.getValue().arrayGet(0);
+
+ assertThat(domainObjectLinkRepr, is(not(nullValue())));
+ assertThat(domainObjectLinkRepr, isLink()
+ .rel(Rel.ELEMENT)
+ .title("Untitled Actions Entity")
+ .httpMethod(RestfulHttpMethod.GET)
+ .href(matches("http://localhost:\\d+/objects/RTNE/67"))
+ .type(RepresentationType.DOMAIN_OBJECT.getMediaType())
+ .arguments(JsonRepresentation.newMap())
+ .build());
+
+ // then list link element-type
+ assertThat(listRepr.getLinks(), is(not(nullValue())));
+ final LinkRepresentation elementTypeLink = listRepr.getLinkWithRel(Rel.ELEMENT_TYPE);
+ assertThat(elementTypeLink, is(not(nullValue())));
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_andContentLength__andRespCode_200_ok.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_andContentLength__andRespCode_200_ok.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_andContentLength__andRespCode_200_ok.java
index a7b1856..b9a05ad 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_andContentLength__andRespCode_200_ok.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_andContentLength__andRespCode_200_ok.java
@@ -19,6 +19,7 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.apache.isis.core.commons.matchers.IsisMatchers;
import org.apache.isis.viewer.restfulobjects.applib.JsonRepresentation;
import org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation;
import org.apache.isis.viewer.restfulobjects.applib.RestfulMediaType;
@@ -90,7 +91,7 @@ public class Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_and
assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
assertThat(restfulResponse.getHeader(Header.CONTENT_TYPE), hasProfile(RestfulMediaType.APPLICATION_JSON_ACTION_RESULT));
- assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(3248));
+ assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(IsisMatchers.greaterThan(1000)));
final ActionResultRepresentation actionResultRepr = restfulResponse.getEntity();
@@ -98,30 +99,15 @@ public class Get_whenObject_isNotNull_thenRepr_ok_andRespHeaders_ContentType_and
final DomainObjectRepresentation objRepr = actionResultRepr.getResult().as(DomainObjectRepresentation.class);
assertThat(objRepr.getMembers(), is(not(nullValue())));
- assertThat(objRepr.getMembers().size(), is(greaterThan(0)));
+ assertThat(objRepr.getMembers().size(), is(IsisMatchers.greaterThan(0)));
assertThat(objRepr.getTitle(), is(not(nullValue())));
assertThat(objRepr.getLinks(), is(not(nullValue())));
- assertThat(objRepr.getMembers().size(), is(greaterThan(0)));
+ assertThat(objRepr.getMembers().size(), is(IsisMatchers.greaterThan(0)));
assertThat(objRepr.getExtensions(), is(not(nullValue())));
}
- private static Matcher<Integer> greaterThan(final int i) {
- return new TypeSafeMatcher<Integer>() {
-
- @Override
- public void describeTo(Description description) {
- description.appendText("greater than " + i);
- }
-
- @Override
- protected boolean matchesSafely(Integer item) {
- return item > i;
- }
- };
- }
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenRepresentation_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenRepresentation_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenRepresentation_ok_TODO.java
index b5703a1..21ec3c9 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenRepresentation_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenRepresentation_ok_TODO.java
@@ -1,13 +1,24 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenScalar_thenRepresentation_ok_TODO {
- @Ignore
- @Test
- public void todo() throws Exception {
-
+ @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());
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentLength_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentLength_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentLength_ok_TODO.java
index 04e261c..b0d6d93 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentLength_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentLength_ok_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenScalar_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());
+ }
+
@Ignore
@Test
public void todo() throws Exception {
http://git-wip-us.apache.org/repos/asf/isis/blob/430e8b3c/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentType_ok_TODO.java
----------------------------------------------------------------------
diff --git a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentType_ok_TODO.java b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentType_ok_TODO.java
index cafafa2..490d8788 100644
--- a/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentType_ok_TODO.java
+++ b/component/viewer/restfulobjects/tck/src/test/java/org/apache/isis/viewer/restfulobjects/tck/domainobjectorservice/id/action/invoke/Get_whenScalar_thenResponseHeaders_ContentType_ok_TODO.java
@@ -1,10 +1,27 @@
package org.apache.isis.viewer.restfulobjects.tck.domainobjectorservice.id.action.invoke;
+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.tck.IsisWebServerRule;
+
public class Get_whenScalar_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());
+ }
+
@Ignore
@Test
public void todo() throws Exception {