Examples of RpcResult


Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        String pageName = "name";
        String layoutName = "layout";
        expect(pageService.updatePage(PAGE_ID, pageName, layoutName)).andReturn(page);
        replay(pageService);

        RpcResult result = pageApi.updatePageProperties(PAGE_ID, pageName, layoutName);

        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat((Page)result.getResult(), is (page));
        assertThat(result.isError(), is(false));
        assertThat(result.getErrorCode(), is (RpcResult.ErrorCode.NO_ERROR));
        assertThat(result.getErrorMessage(), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

    @Test
    public void movePage_nonNullMoveAfterPageId() {
        expect(pageService.movePage(PAGE_ID, PAGE_2_ID)).andReturn(page);
        replay(pageService);

        RpcResult result = pageApi.movePage(PAGE_ID, PAGE_2_ID);

        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat((Page)result.getResult(), is(page));
        assertThat(result.isError(), is(false));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.NO_ERROR));
        assertThat(result.getErrorMessage(), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

    @Test
    public void movePage_nullMoveAfterPageId() {
        expect(pageService.movePageToDefault(PAGE_2_ID)).andReturn(page2);
        replay(pageService);

        RpcResult result = pageApi.movePage(PAGE_2_ID, null);

        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat((Page)result.getResult(), is(page2));
        assertThat(result.isError(), is(false));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.NO_ERROR));
        assertThat(result.getErrorMessage(), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        final int PAGE_ID = 1;
        final long WIDGET_ID = 2;

        expect(pageService.addWidgetToPage(PAGE_ID, WIDGET_ID)).andReturn(new RegionWidget());
        replay(pageService);
        RpcResult result = pageApi.addWidgetToPage(PAGE_ID, WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(notNullValue()));
        assertThat(result.isError(), is(false));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.NO_ERROR));
        assertThat(result.getErrorMessage(), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        final int PAGE_ID = 1;
        final long WIDGET_ID = 2;

        expect(pageService.addWidgetToPage(PAGE_ID, WIDGET_ID)).andThrow(new IllegalArgumentException(PARAM_ERROR_MESSAGE));
        replay(pageService);
        RpcResult result = pageApi.addWidgetToPage(PAGE_ID, WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(nullValue()));
        assertThat(result.isError(), is(true));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.INVALID_PARAMS));
        assertThat(result.getErrorMessage(), is(equalTo(PARAM_ERROR_MESSAGE)));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        final int PAGE_ID = 1;
        final long WIDGET_ID = 2;

        expect(pageService.addWidgetToPage(PAGE_ID, WIDGET_ID)).andThrow(new RuntimeException(INTERNAL_ERROR_MESSAGE));
        replay(pageService);
        RpcResult result = pageApi.addWidgetToPage(PAGE_ID, WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(nullValue()));
        assertThat(result.isError(), is(true));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.INTERNAL_ERROR));
        assertThat(result.getErrorMessage(), is(equalTo(INTERNAL_ERROR_MESSAGE)));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

    public void deleteWidget_invalidParams() {
        final long WIDGET_ID = 2;

        expect(pageService.removeWidgetFromPage(WIDGET_ID)).andThrow(new IllegalArgumentException(PARAM_ERROR_MESSAGE));
        replay(pageService);
        RpcResult result = pageApi.removeWidgetFromPage(WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(nullValue()));
        assertThat(result.isError(), is(true));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.INVALID_PARAMS));
        assertThat(result.getErrorMessage(), is(equalTo(PARAM_ERROR_MESSAGE)));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

    public void deleteWidget_internalError() {
        final long WIDGET_ID = 2;

        expect(pageService.removeWidgetFromPage(WIDGET_ID)).andThrow(new RuntimeException(INTERNAL_ERROR_MESSAGE));
        replay(pageService);
        RpcResult result = pageApi.removeWidgetFromPage(WIDGET_ID);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(nullValue()));
        assertThat(result.isError(), is(true));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.INTERNAL_ERROR));
        assertThat(result.getErrorMessage(), is(equalTo(INTERNAL_ERROR_MESSAGE)));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        final String PAGE_NAME = "My New Page";
        final String PAGE_LAYOUT_CODE = "layout1";

        expect(pageService.addNewPage(PAGE_NAME, PAGE_LAYOUT_CODE)).andReturn(new Page());
        replay(pageService);
        RpcResult result = pageApi.addPage(PAGE_NAME, PAGE_LAYOUT_CODE);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(notNullValue()));
        assertThat(result.isError(), is(false));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.NO_ERROR));
        assertThat(result.getErrorMessage(), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.web.api.rpc.model.RpcResult

        final String PAGE_NAME = "My New Page";
        final String PAGE_LAYOUT_CODE = "layout1";

        expect(pageService.addNewPage(PAGE_NAME, PAGE_LAYOUT_CODE)).andThrow(new IllegalArgumentException(PARAM_ERROR_MESSAGE));
        replay(pageService);
        RpcResult result = pageApi.addPage(PAGE_NAME, PAGE_LAYOUT_CODE);
        verify(pageService);
        assertThat(result, is(notNullValue()));
        assertThat(result.getResult(), is(nullValue()));
        assertThat(result.isError(), is(true));
        assertThat(result.getErrorCode(), is(RpcResult.ErrorCode.INVALID_PARAMS));
        assertThat(result.getErrorMessage(), is(equalTo(PARAM_ERROR_MESSAGE)));
    }
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.