Examples of PortalPreferenceImpl


Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

        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.portal.model.impl.PortalPreferenceImpl

        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.portal.model.impl.PortalPreferenceImpl

        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.portal.model.impl.PortalPreferenceImpl

        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.portal.model.impl.PortalPreferenceImpl

        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.portal.model.impl.PortalPreferenceImpl

        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

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

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

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

        expect(service.getPreference(PortalPreferenceKeys.JAVASCRIPT_DEBUG_MODE)).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.portal.model.impl.PortalPreferenceImpl

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

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

        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.portal.model.impl.PortalPreferenceImpl

    @Test
    public void testUpdatePreferences_invalidPageSizeValue() {
        ModelMap model = new ExtendedModelMap();
        HashMap<String, PortalPreference> preferenceMap = new HashMap<String, PortalPreference>();
        PortalPreference pageSizePref = new PortalPreferenceImpl(PortalPreferenceKeys.PAGE_SIZE, "invalid");
        preferenceMap.put(PortalPreferenceKeys.PAGE_SIZE, pageSizePref);
        PortalPreferenceForm form = new PortalPreferenceForm(preferenceMap);
        final BindingResult errors = new BeanPropertyBindingResult(form, "form");
        SessionStatus sessionStatus = createMock(SessionStatus.class);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.PortalPreferenceImpl

    }

    @Test
    public void testValidate_Valid() throws Exception {
        Map<String, PortalPreference> preferenceMap = new HashMap<String, PortalPreference>();
        preferenceMap.put(TITLE_SUFFIX, new PortalPreferenceImpl(TITLE_SUFFIX, "- Rave unit test"));
        preferenceMap.put(PAGE_SIZE, new PortalPreferenceImpl(PAGE_SIZE, "10"));
        PortalPreferenceForm form = new PortalPreferenceForm(preferenceMap);
        Errors errors = new BindException(form, "form");
        validator.validate(form, errors);

        assertFalse(errors.hasErrors());
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.