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 2012/06/27 22:50:40 UTC
svn commit: r1354721 - in
/incubator/isis/trunk/framework/viewer/restfulobjects: ./ json-applib/
json-viewer/ restfulobjects-tck/
restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/
restfulobjects-tck/src/test/java/org/apache/isis/viewer/...
Author: danhaywood
Date: Wed Jun 27 20:50:38 2012
New Revision: 1354721
URL: http://svn.apache.org/viewvc?rev=1354721&view=rev
Log:
ISIS-233: renaming json-viewer to restfulobjects-viewer
Added:
incubator/isis/trunk/framework/viewer/restfulobjects/
- copied from r1354232, incubator/isis/trunk/framework/viewer/json/
incubator/isis/trunk/framework/viewer/restfulobjects/pom.xml
- copied, changed from r1354232, incubator/isis/trunk/framework/viewer/json/pom.xml
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/
- copied from r1354232, incubator/isis/trunk/framework/viewer/json/json-tck/
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/
- copied from r1354232, incubator/isis/trunk/framework/viewer/json/json-viewer/
Removed:
incubator/isis/trunk/framework/viewer/restfulobjects/json-applib/
incubator/isis/trunk/framework/viewer/restfulobjects/json-viewer/
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_clientAcceptHeader_exceptionHandling.java
Modified:
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/pom.xml
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_serverSideException_exceptionHandling.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/version/VersionResourceTest_representationAndHeaders.java
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/pom.xml
incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java
Copied: incubator/isis/trunk/framework/viewer/restfulobjects/pom.xml (from r1354232, incubator/isis/trunk/framework/viewer/json/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/pom.xml?p2=incubator/isis/trunk/framework/viewer/restfulobjects/pom.xml&p1=incubator/isis/trunk/framework/viewer/json/pom.xml&r1=1354232&r2=1354721&rev=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/json/pom.xml (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/pom.xml Wed Jun 27 20:50:38 2012
@@ -28,19 +28,19 @@
</parent>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json</artifactId>
+ <artifactId>restfulobjects</artifactId>
- <name>JSON Viewer</name>
+ <name>RestfulObjects Viewer</name>
<packaging>pom</packaging>
<properties>
<siteBaseDir>../..</siteBaseDir>
- <relativeUrl>viewer/json/</relativeUrl>
+ <relativeUrl>viewer/restfulobjects/</relativeUrl>
- <docbkxGuideTitle>Apache Isis JSON Viewer</docbkxGuideTitle>
+ <docbkxGuideTitle>RestfulObjects for Isis</docbkxGuideTitle>
<docbkxGuideSubTitle>Programming, Configuration and Deployment Guide</docbkxGuideSubTitle>
- <docbkxGuideName>isis-json-viewer</docbkxGuideName>
+ <docbkxGuideName>isis-restfulobjects-viewer</docbkxGuideName>
</properties>
<!-- used in Site generation for relative references. -->
@@ -95,26 +95,26 @@
<scope>import</scope>
</dependency>
- <!-- JSON Viewer -->
+ <!-- RestfulObjectRestfulObjects Viewer -->
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-applib</artifactId>
+ <artifactId>restfulobjects-applib</artifactId>
<version>0.3.1-incubating-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-applib</artifactId>
+ <artifactId>restfulobjects-applib</artifactId>
<version>0.3.1-incubating-SNAPSHOT</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-viewer</artifactId>
+ <artifactId>restfulobjects-viewer</artifactId>
<version>0.3.1-incubating-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-viewer</artifactId>
+ <artifactId>restfulobjects-viewer</artifactId>
<version>0.3.1-incubating-SNAPSHOT</version>
<type>test-jar</type>
</dependency>
@@ -126,9 +126,9 @@
<!-- USE -pl xxx TO SELECT A SINGLE MODULE -->
<modules>
- <module>json-applib</module>
- <module>json-viewer</module>
- <module>json-tck</module>
+ <module>restfulobjects-applib</module>
+ <module>restfulobjects-viewer</module>
+ <module>restfulobjects-tck</module>
</modules>
</project>
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/pom.xml?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/pom.xml (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/pom.xml Wed Jun 27 20:50:38 2012
@@ -27,17 +27,17 @@
</parent>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-tck</artifactId>
- <name>JSON Viewer for TCK</name>
+ <artifactId>restfulobjects-tck</artifactId>
+ <name>RestfulObjects Viewer for TCK</name>
<packaging>war</packaging>
<properties>
<maven.test.skip>true</maven.test.skip>
<siteBaseDir>../../..</siteBaseDir>
- <relativeUrl>viewer/json/json-tck/</relativeUrl>
+ <relativeUrl>viewer/restfulobjects/restfulobjects-tck/</relativeUrl>
<!-- until someone comes up with a better solution -->
- <distMgmtSiteUrl>file:///tmp/m2-sites/isis/viewer/json</distMgmtSiteUrl>
+ <distMgmtSiteUrl>file:///tmp/m2-sites/isis/viewer/restfulobjects</distMgmtSiteUrl>
</properties>
@@ -84,7 +84,7 @@
<!-- isis viewer -->
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-viewer</artifactId>
+ <artifactId>restfulobjects-viewer</artifactId>
</dependency>
<!-- isis runtime -->
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/RepresentationMatchers.java Wed Jun 27 20:50:38 2012
@@ -99,7 +99,7 @@ public class RepresentationMatchers {
};
}
- public static <T extends JsonRepresentation> Matcher<T> isFollowableLinkToSelf(final RestfulClient client) {
+ public static <T extends JsonRepresentation> Matcher<T> hasFollowableLinkToSelf(final RestfulClient client) {
return new TypeSafeMatcher<T>() {
@Override
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_serverSideException_exceptionHandling.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_serverSideException_exceptionHandling.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_serverSideException_exceptionHandling.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/AnyResourceTest_serverSideException_exceptionHandling.java Wed Jun 27 20:50:38 2012
@@ -21,10 +21,6 @@ package org.apache.isis.viewer.json.tck.
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-import javax.ws.rs.core.MediaType;
-
-import org.jboss.resteasy.client.ClientRequest;
-import org.jboss.resteasy.client.ClientResponse;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -32,13 +28,11 @@ import org.junit.Test;
import org.apache.isis.runtimes.dflt.webserver.WebServer;
import org.apache.isis.viewer.json.applib.HttpMethod;
import org.apache.isis.viewer.json.applib.JsonRepresentation;
-import org.apache.isis.viewer.json.applib.RepresentationType;
import org.apache.isis.viewer.json.applib.RestfulClient;
import org.apache.isis.viewer.json.applib.RestfulRequest;
import org.apache.isis.viewer.json.applib.RestfulRequest.Header;
import org.apache.isis.viewer.json.applib.RestfulResponse;
import org.apache.isis.viewer.json.applib.RestfulResponse.HttpStatusCode;
-import org.apache.isis.viewer.json.applib.homepage.HomePageRepresentation;
import org.apache.isis.viewer.json.applib.util.Parser;
import org.apache.isis.viewer.json.tck.IsisWebServerRule;
@@ -59,8 +53,8 @@ public class AnyResourceTest_serverSideE
public void runtimeException_isMapped() throws Exception {
// given
- final RestfulRequest restfulReq = client.createRequest(HttpMethod.GET, "version");
- final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean());
+ final RestfulRequest restfulReq = client.createRequest(HttpMethod.GET, "/");
+ final Header<Boolean> header = new Header<Boolean>("X-FAIL", Parser.forBoolean()); // force a failure...
restfulReq.withHeader(header, true);
// when
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_accept.java Wed Jun 27 20:50:38 2012
@@ -23,12 +23,16 @@ import static org.junit.Assert.assertTha
import javax.ws.rs.core.MediaType;
+import org.jboss.resteasy.client.ClientRequest;
+import org.jboss.resteasy.client.ClientResponse;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.apache.isis.runtimes.dflt.webserver.WebServer;
import org.apache.isis.viewer.json.applib.HttpMethod;
+import org.apache.isis.viewer.json.applib.JsonRepresentation;
import org.apache.isis.viewer.json.applib.RepresentationType;
import org.apache.isis.viewer.json.applib.RestfulClient;
import org.apache.isis.viewer.json.applib.RestfulRequest;
@@ -51,30 +55,74 @@ public class HomePageResourceTest_accept
}
@Test
- public void applicationJson() throws Exception {
+ public void noAcceptHeader_isOk() throws Exception {
+ // given
+ final RestfulRequest restfulReq = client.createRequest(HttpMethod.GET, "/");
+ // when
+ final RestfulResponse<HomePageRepresentation> restfulResp = restfulReq.executeT();
+
+ // then
+ assertThat(restfulResp.getStatus(), is(HttpStatusCode.OK));
+ }
+
+ @Test
+ public void applicationJson_profileParameterOmitted_isOk() throws Exception {
+
+ // given
final RestfulRequest request = client.createRequest(HttpMethod.GET, "/").withHeader(RestfulRequest.Header.ACCEPT, MediaType.APPLICATION_JSON_TYPE);
+
+ // when
final RestfulResponse<HomePageRepresentation> restfulResponse = request.executeT();
+ // then
assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
}
@Test
- public void applicationJson_profileHomePage() throws Exception {
+ public void applicationJson_profileParameterCorrectlySetToHomePage_isOk() throws Exception {
+ // given
final RestfulRequest request = client.createRequest(HttpMethod.GET, "/").withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.HOME_PAGE.getMediaType());
+
+ // when
final RestfulResponse<HomePageRepresentation> restfulResponse = request.executeT();
+ // then
assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
}
@Test
- public void applicationJson_invalid() throws Exception {
+ public void applicationJson_profileParameterIncorrectlySet_isNotAcceptable() throws Exception {
+ // given
final RestfulRequest request = client.createRequest(HttpMethod.GET, "/").withHeader(RestfulRequest.Header.ACCEPT, RepresentationType.USER.getMediaType());
+
+ // when
final RestfulResponse<HomePageRepresentation> restfulResponse = request.executeT();
+ // then
assertThat(restfulResponse.getStatus(), is(HttpStatusCode.NOT_ACCEPTABLE));
}
+
+ @Ignore("RestEasy seems to reject with a 500, 'No match for accept header', rather than a 405.")
+ @Test
+ public void incorrectMediaType_isNotAcceptable() throws Exception {
+
+ // given
+ final ClientRequest clientRequest = client.getClientRequestFactory().createRelativeRequest("/");
+ clientRequest.accept(MediaType.APPLICATION_ATOM_XML_TYPE);
+
+ // when
+ final ClientResponse<?> resp = clientRequest.get();
+ final RestfulResponse<JsonRepresentation> restfulResp = RestfulResponse.of(resp);
+
+ @SuppressWarnings("unused")
+ final String entity = restfulResp.getEntity().toString();
+
+ // then
+ assertThat(restfulResp.getStatus(), is(HttpStatusCode.NOT_ACCEPTABLE));
+ }
+
}
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_representationAndHeaders.java Wed Jun 27 20:50:38 2012
@@ -24,7 +24,7 @@ import static org.apache.isis.viewer.jso
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasSubType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isArray;
-import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isFollowableLinkToSelf;
+import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasFollowableLinkToSelf;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isLink;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isMap;
import static org.hamcrest.CoreMatchers.is;
@@ -110,7 +110,7 @@ public class HomePageResourceTest_repres
final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
assertThat(contentType, hasType("application"));
assertThat(contentType, hasSubType("json"));
- assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects/homepage"));
+ assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects:repr-types/homepage"));
assertThat(contentType, is(RepresentationType.HOME_PAGE.getMediaType()));
// then
@@ -125,7 +125,8 @@ public class HomePageResourceTest_repres
final HomePageRepresentation repr = givenRepresentation();
// when, then
- assertThat(repr, isFollowableLinkToSelf(client));
+ assertThat(repr, hasFollowableLinkToSelf(client));
+ assertThat(repr.getSelf(), isLink(client).returning(HttpStatusCode.OK));
}
@Test
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/home/HomePageResourceTest_xrofollowlinks.java Wed Jun 27 20:50:38 2012
@@ -73,7 +73,7 @@ public class HomePageResourceTest_xrofol
@Test
public void canFollowUser() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=user]");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/user]");
assertThat(repr.getUser().getValue(), is(not(nullValue())));
}
@@ -81,7 +81,7 @@ public class HomePageResourceTest_xrofol
@Test
public void canFollowServices() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=services]");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/services]");
assertThat(repr.getServices().getValue(), is(not(nullValue())));
}
@@ -89,7 +89,7 @@ public class HomePageResourceTest_xrofol
@Test
public void canFollowVersion() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=version]");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/version]");
assertThat(repr.getVersion().getValue(), is(not(nullValue())));
}
@@ -98,7 +98,7 @@ public class HomePageResourceTest_xrofol
@Test
public void canFollowAll() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=user],links[rel=services],links[rel=version]");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/user],links[rel=urn:org.restfulobjects:rels/services],links[rel=urn:org.restfulobjects:rels/version]");
assertThat(repr.getUser().getValue(), is(not(nullValue())));
assertThat(repr.getVersion().getValue(), is(not(nullValue())));
@@ -108,7 +108,7 @@ public class HomePageResourceTest_xrofol
@Test
public void servicesValues() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=services].values");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/services].values");
final JsonRepresentation servicesValue = repr.getServices().getValue();
assertThat(servicesValue, is(not(nullValue())));
@@ -132,7 +132,7 @@ public class HomePageResourceTest_xrofol
@Test
public void servicesValuesWithCriteria() throws Exception {
- repr = whenExecuteAndFollowLinksUsing("/", "links[rel=services].values[id=simples]");
+ repr = whenExecuteWithFollowLinksUsing("/", "links[rel=urn:org.restfulobjects:rels/services].values[id=simples]");
final JsonRepresentation servicesValue = repr.getServices().getValue();
assertThat(servicesValue, is(not(nullValue())));
@@ -140,9 +140,7 @@ public class HomePageResourceTest_xrofol
final JsonRepresentation serviceLinkList = servicesValue.getArray("values");
assertThat(serviceLinkList, isArray());
- JsonRepresentation service;
-
- service = serviceLinkList.getRepresentation("[id=%s]", "simples");
+ JsonRepresentation service = serviceLinkList.getRepresentation("[id=%s]", "simples");
assertThat(service, isMap());
assertThat(service.getString("id"), is("simples"));
assertThat(service.getRepresentation("value"), is(not(nullValue())));
@@ -151,7 +149,7 @@ public class HomePageResourceTest_xrofol
assertThat(service.getRepresentation("value"), is(nullValue()));
}
- private HomePageRepresentation whenExecuteAndFollowLinksUsing(final String uriTemplate, final String followLinks) throws JsonParseException, JsonMappingException, IOException {
+ private HomePageRepresentation whenExecuteWithFollowLinksUsing(final String uriTemplate, final String followLinks) throws JsonParseException, JsonMappingException, IOException {
request = client.createRequest(HttpMethod.GET, uriTemplate).withArg(RequestParameter.FOLLOW_LINKS, followLinks);
restfulResponse = request.executeT();
return restfulResponse.getEntity();
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/object/DomainObjectResourceTest.java Wed Jun 27 20:50:38 2012
@@ -97,8 +97,8 @@ public class DomainObjectResourceTest {
// then
final LinkRepresentation self = domainObjectRepr.getSelf();
- assertThat(self, isLink().rel(Rel.SELF).href(matches(".+objects/OID:32")).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects/domainobject"));
- assertThat(domainObjectRepr.getLinkWithRel(Rel.DESCRIBEDBY), isLink().href(matches(".+" + ChildEntity.class.getName())).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects/domaintype"));
+ assertThat(self, isLink().rel(Rel.SELF).href(matches(".+objects/OID:32")).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects:repr-types/object"));
+ assertThat(domainObjectRepr.getLinkWithRel(Rel.DESCRIBEDBY), isLink().href(matches(".+" + ChildEntity.class.getName())).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects:repr-types/domain-type"));
assertThat(domainObjectRepr.getTitle(), is("parent 4 - child 2"));
assertThat(domainObjectRepr.getOid(), is("OID:32"));
@@ -144,7 +144,7 @@ public class DomainObjectResourceTest {
final DomainObjectRepresentation domainObjectRepr = givenDomainObjectRepresentationFor("OID:32");
// then
- assertThat(domainObjectRepr.getLinkWithRel(Rel.DESCRIBEDBY), isLink().href(matches(".+" + ChildEntity.class.getName())).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects/domaintype"));
+ assertThat(domainObjectRepr.getLinkWithRel(Rel.DESCRIBEDBY), isLink().href(matches(".+" + ChildEntity.class.getName())).httpMethod(HttpMethod.GET).type(MediaType.APPLICATION_JSON_TYPE).typeParameter("profile", "urn:org.restfulobjects:repr-types/domain-type"));
}
@Test
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/serviceId/DomainServiceResourceTest_serviceId_representationAndHeaders.java Wed Jun 27 20:50:38 2012
@@ -21,7 +21,7 @@ package org.apache.isis.viewer.json.tck.
import static org.apache.isis.core.commons.matchers.IsisMatchers.matches;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.assertThat;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isArray;
-import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isFollowableLinkToSelf;
+import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasFollowableLinkToSelf;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isLink;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isMap;
import static org.hamcrest.CoreMatchers.is;
@@ -109,7 +109,7 @@ public class DomainServiceResourceTest_s
final DomainObjectRepresentation repr = givenRepresentation("simples");
// when, then
- assertThat(repr, isFollowableLinkToSelf(client));
+ assertThat(repr, hasFollowableLinkToSelf(client));
}
@Test
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/service/services/DomainServiceResourceTest_services_representationAndHeaders.java Wed Jun 27 20:50:38 2012
@@ -20,7 +20,7 @@ package org.apache.isis.viewer.json.tck.
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.assertThat;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isArray;
-import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isFollowableLinkToSelf;
+import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasFollowableLinkToSelf;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isLink;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isMap;
import static org.hamcrest.CoreMatchers.is;
@@ -95,7 +95,7 @@ public class DomainServiceResourceTest_s
final ListRepresentation repr = givenRepresentation();
// when, then
- assertThat(repr, isFollowableLinkToSelf(client));
+ assertThat(repr, hasFollowableLinkToSelf(client));
}
@Test
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/user/UserResourceTest_representationAndHeaders.java Wed Jun 27 20:50:38 2012
@@ -24,7 +24,7 @@ import static org.apache.isis.viewer.jso
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasSubType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isArray;
-import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isFollowableLinkToSelf;
+import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasFollowableLinkToSelf;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isLink;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isMap;
import static org.hamcrest.CoreMatchers.is;
@@ -117,7 +117,7 @@ public class UserResourceTest_representa
final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
assertThat(contentType, hasType("application"));
assertThat(contentType, hasSubType("json"));
- assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects/user"));
+ assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects:repr-types/user"));
assertThat(contentType, is(RepresentationType.USER.getMediaType()));
// then
@@ -132,7 +132,7 @@ public class UserResourceTest_representa
final UserRepresentation repr = givenRepresentation();
// when, then
- assertThat(repr, isFollowableLinkToSelf(client));
+ assertThat(repr, hasFollowableLinkToSelf(client));
}
private UserRepresentation givenRepresentation() throws JsonParseException, JsonMappingException, IOException {
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/version/VersionResourceTest_representationAndHeaders.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/version/VersionResourceTest_representationAndHeaders.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/version/VersionResourceTest_representationAndHeaders.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-tck/src/test/java/org/apache/isis/viewer/json/tck/resources/version/VersionResourceTest_representationAndHeaders.java Wed Jun 27 20:50:38 2012
@@ -24,7 +24,7 @@ import static org.apache.isis.viewer.jso
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasSubType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasType;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isArray;
-import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isFollowableLinkToSelf;
+import static org.apache.isis.viewer.json.tck.RepresentationMatchers.hasFollowableLinkToSelf;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isLink;
import static org.apache.isis.viewer.json.tck.RepresentationMatchers.isMap;
import static org.hamcrest.CoreMatchers.is;
@@ -125,7 +125,7 @@ public class VersionResourceTest_represe
final MediaType contentType = restfulResponse.getHeader(Header.CONTENT_TYPE);
assertThat(contentType, hasType("application"));
assertThat(contentType, hasSubType("json"));
- assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects/version"));
+ assertThat(contentType, hasParameter("profile", "urn:org.restfulobjects:repr-types/version"));
assertThat(contentType, is(RepresentationType.VERSION.getMediaType()));
// then
@@ -140,7 +140,7 @@ public class VersionResourceTest_represe
final VersionRepresentation repr = givenRepresentation();
// when, then
- assertThat(repr, isFollowableLinkToSelf(client));
+ assertThat(repr, hasFollowableLinkToSelf(client));
}
private VersionRepresentation givenRepresentation() throws JsonParseException, JsonMappingException, IOException {
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/pom.xml?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/pom.xml (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/pom.xml Wed Jun 27 20:50:38 2012
@@ -23,16 +23,16 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json</artifactId>
+ <artifactId>restfulobjects</artifactId>
<version>0.3.1-incubating-SNAPSHOT</version>
</parent>
- <artifactId>json-viewer</artifactId>
- <name>JSON Viewer Implementation</name>
+ <artifactId>restfulobjects-viewer</artifactId>
+ <name>RestfulObjects Viewer Implementation</name>
<properties>
<siteBaseDir>../../..</siteBaseDir>
- <relativeUrl>viewer/json/viewer/</relativeUrl>
+ <relativeUrl>viewer/restfulobjects/viewer/</relativeUrl>
</properties>
<!-- used in Site generation for relative references. -->
@@ -41,7 +41,7 @@
<dependencies>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
- <artifactId>json-applib</artifactId>
+ <artifactId>restfulobjects-applib</artifactId>
</dependency>
<dependency>
Modified: incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java?rev=1354721&r1=1354232&r2=1354721&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java (original)
+++ incubator/isis/trunk/framework/viewer/restfulobjects/restfulobjects-viewer/src/main/java/org/apache/isis/viewer/json/viewer/resources/home/HomePageReprRenderer.java Wed Jun 27 20:50:38 2012
@@ -147,7 +147,7 @@ public class HomePageReprRenderer extend
private void addLinkToDomainTypes() {
- final JsonRepresentation link = LinkBuilder.newBuilder(getResourceContext(), Rel.TYPES, RepresentationType.TYPE_LIST, "domainTypes").build();
+ final JsonRepresentation link = LinkBuilder.newBuilder(getResourceContext(), Rel.DOMAIN_TYPES, RepresentationType.TYPE_LIST, "domainTypes").build();
final LinkFollower linkFollower = getLinkFollower().follow("links[rel=types]");
if (linkFollower.matches(link)) {