Examples of DomainObjectRepresentation


Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        assertThat(restfulResponse.getHeader(Header.CONTENT_LENGTH), is(IsisMatchers.greaterThan(1000)));
       
        final ActionResultRepresentation actionResultRepr = restfulResponse.getEntity();

        assertThat(actionResultRepr.getResultType(), is(ResultType.DOMAIN_OBJECT));
        final DomainObjectRepresentation objRepr = actionResultRepr.getResult().as(DomainObjectRepresentation.class);
       
        assertThat(objRepr.getMembers(), is(not(nullValue())));
        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(IsisMatchers.greaterThan(0)));
       
        assertThat(objRepr.getExtensions(), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

    @Ignore("TODO")
    @Test
    public void domainObjectWithDisabledMembers() throws Exception {

        // given, when
        final DomainObjectRepresentation domainObjectRepr = givenDomainObjectRepresentationFor("OID","xxx");

        // property ('name')
        final JsonRepresentation properties = domainObjectRepr.getProperties();
        final JsonRepresentation nameProperty = properties.getRepresentation("name");
        assertThat(nameProperty.getString("disabledReason"), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final Response domainObjectResp = domainObjectResource.object(domainType, instanceId);
        final RestfulResponse<DomainObjectRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
        assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        final DomainObjectRepresentation domainObjectRepr = domainObjectJsonResp.getEntity();
        return domainObjectRepr;
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "links[rel=self]");
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();
       
        assertThat(repr.getSelf().getValue(), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "links[rel=describedby]");
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();
       
        assertThat(repr.getLinkWithRel(Rel.DESCRIBEDBY).getValue(), is(not(nullValue())));
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members.links[rel=%s]", Rel.DETAILS.getName());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();

        final JsonRepresentation membersList = repr.getMembers();
        assertThat(membersList, isMap());

        JsonRepresentation actionRepr;

        actionRepr = membersList.getRepresentation("list");
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members[%s].links[rel=%s]", "list", Rel.DETAILS.getName());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();

        final JsonRepresentation membersList = repr.getMembers();
        assertThat(membersList, isMap());

        JsonRepresentation actionRepr;

        actionRepr = membersList.getRepresentation("list");
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members[%s].links[rel=%s],members[%s].links[rel=%s]", "list", Rel.DETAILS.getName(), "newEntity", Rel.DETAILS.getName());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();

        final JsonRepresentation membersList = repr.getMembers();
        assertThat(membersList, isMap());

        JsonRepresentation actionRepr;

        actionRepr = membersList.getRepresentation("list");
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

        final RestfulRequest request = client.createRequest(RestfulHttpMethod.GET, href).withArg(RequestParameter.FOLLOW_LINKS, "members[%s].links[rel=%s]", actionId, Rel.DETAILS.getName());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = request.executeT();

        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
        final DomainObjectRepresentation repr = restfulResponse.getEntity();

        final JsonRepresentation actionLinkRepr = repr.getAction(actionId);
        return actionLinkRepr.getRepresentation("links[rel=%s].value", Rel.DETAILS.getName());
    }
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.DomainObjectRepresentation

    /**
     * For resourceProxy tests; returns the Nth entity in the list returned by invoking the specified repo and action
     */
    public static RestfulResponse<DomainObjectRepresentation> domainObjectJaxrsResponse(RestfulClient client, String repoName, String actionName, int idx) throws Exception {
        final LinkRepresentation link = Util.domainObjectLink(client, repoName, actionName, idx);
        DomainObjectRepresentation domainObjectRepr = client.follow(link).getEntity().as(DomainObjectRepresentation.class);

        final Response jaxrsResponse = client.getDomainObjectResource().object(domainObjectRepr.getDomainType(), domainObjectRepr.getInstanceId());
        final RestfulResponse<DomainObjectRepresentation> restfulResponse = RestfulResponse.ofT(jaxrsResponse);
        return restfulResponse;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.