Package org.apache.isis.viewer.json.applib.domainobjects

Examples of org.apache.isis.viewer.json.applib.domainobjects.DomainObjectResource


    @Ignore("to get working again")
    @Test
    public void actionPrompt() throws Exception {
        // given
        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        // 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();
View Full Code Here


    @Ignore("to get working again")
    @Test
    public void actionPostInvoke_returningList() throws Exception {

        // given
        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        final JsonRepresentation body = JsonRepresentation.newArray();

        // when
        final Response actionInvokeResp = domainObjectResource.invokeAction("OID:1", "list", body.asInputStream());
        final RestfulResponse<ScalarValueRepresentation> actionInvokeJsonResp = RestfulResponse.ofT(actionInvokeResp);
        assertThat(actionInvokeJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        final ScalarValueRepresentation actionInvokeRepr = actionInvokeJsonResp.getEntity();
View Full Code Here

        assertThat(domainObjectIconLink.getRel(), is("icon"));
        assertThat(domainObjectIconLink.getHref(), matches("http://localhost:\\d+/images/null.png")); // TODO
    }

    private DomainObjectRepresentation givenDomainObjectRepresentationFor(final String oidStr) throws JsonParseException, JsonMappingException, IOException {
        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        final Response domainObjectResp = domainObjectResource.object(oidStr);
        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

    @Test
    public void returnsDomainObjectRepresentation() throws Exception {

        // given
        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        // when
        final Response domainObjectResp = domainObjectResource.object("OID:6");
        final RestfulResponse<DomainObjectRepresentation> domainObjectJsonResp = RestfulResponse.ofT(domainObjectResp);
        assertThat(domainObjectJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        final DomainObjectRepresentation domainObjectRepr = domainObjectJsonResp.getEntity();
View Full Code Here

    @Ignore("to get working again")
    @Test
    public void propertyDetails() throws Exception {
        // given
        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        // 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();
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.json.applib.domainobjects.DomainObjectResource

Copyright © 2018 www.massapicom. 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.