Examples of PortalPreference


Examples of org.apache.rave.model.PortalPreference

        assertThat(converter.convert(template), is(sameInstance(template)));
    }

    @Test
    public void nullConversion() {
        PortalPreference template = null;
        assertThat(converter.convert(template), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

    }


    @Test
    public void convertValid() {
        PortalPreference template = new PortalPreferenceImpl();
        template.setKey("KEY");
        template.setValue("VALUE");

        JpaPortalPreference jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPortalPreference.class)));
        assertThat(jpaTemplate.getKey(), is(equalTo(template.getKey())));
        assertThat(jpaTemplate.getValue(), is(equalTo(template.getValue())));
    }
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

public class PortalPreferenceFormTest {
    private Map<String, PortalPreference> preferenceMap = new HashMap<String, PortalPreference>();

    @Before
    public void setUp() throws Exception {
        PortalPreference titlePref = new PortalPreferenceImpl(TITLE_SUFFIX, "Test portal");
        preferenceMap.put(TITLE_SUFFIX, titlePref);
        PortalPreference pageSizePref = new PortalPreferenceImpl(PAGE_SIZE, "20");
        preferenceMap.put(PAGE_SIZE, pageSizePref);
        PortalPreference javaScriptDebugMode = new PortalPreferenceImpl(JAVASCRIPT_DEBUG_MODE, "0");
        preferenceMap.put(JAVASCRIPT_DEBUG_MODE, javaScriptDebugMode);
        PortalPreference initialWidgetStatus = new PortalPreferenceImpl(INITIAL_WIDGET_STATUS, "PUBLISHED");
        preferenceMap.put(INITIAL_WIDGET_STATUS, initialWidgetStatus);
    }
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        tag.setPageContext(pageContext);
    }

    @Test
    public void doStartTag_debugOn() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.SHOW_STACK_TRACE, SHOW_STACK_TRACE_ON);

        expect(service.getPreference(PortalPreferenceKeys.SHOW_STACK_TRACE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        verify(service, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_debugOff() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.SHOW_STACK_TRACE, SHOW_STACK_TRACE_OFF);

        expect(service.getPreference(PortalPreferenceKeys.SHOW_STACK_TRACE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        verify(service, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_exception() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.SHOW_STACK_TRACE, SHOW_STACK_TRACE_OFF);

        expect(service.getPreference(PortalPreferenceKeys.SHOW_STACK_TRACE)).andThrow(new RuntimeException("error"));
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        verify(service, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_nullPreference() throws IOException, JspException {
        PortalPreference portalPreference = null;

        expect(service.getPreference(PortalPreferenceKeys.SHOW_STACK_TRACE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        verify(service, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_emptyPreference() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.SHOW_STACK_TRACE, "");

        expect(service.getPreference(PortalPreferenceKeys.SHOW_STACK_TRACE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        tag.setPageContext(pageContext);
    }

    @Test
    public void doStartTag_debugOn() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.JAVASCRIPT_DEBUG_MODE, DEBUG_ON);

        expect(service.getPreference(PortalPreferenceKeys.JAVASCRIPT_DEBUG_MODE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
View Full Code Here

Examples of org.apache.rave.model.PortalPreference

        verify(service, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_debugOff() throws IOException, JspException {
        PortalPreference portalPreference = new PortalPreferenceImpl(PortalPreferenceKeys.JAVASCRIPT_DEBUG_MODE, DEBUG_OFF);

        expect(service.getPreference(PortalPreferenceKeys.JAVASCRIPT_DEBUG_MODE)).andReturn(portalPreference);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PortalPreferenceService.class)).andReturn(service).anyTimes();
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.