Examples of MockPageContext


Examples of com.sun.faces.mock.MockPageContext

        session = new MockHttpSession();
        request = new MockHttpServletRequest(session);
        response = new MockHttpServletResponse();

        // Set up JSP API Objects
        pageContext = new MockPageContext();
        pageContext.initialize(servlet, request, response, null,
                               true, 1024, true);

        // Set up Faces API Objects
  FactoryFinder.setFactory(FactoryFinder.APPLICATION_FACTORY,
View Full Code Here

Examples of com.technoetic.mocks.servlets.jsp.MockPageContext

    public ServletTestSupport() {
        request = new HttpServletRequestSimulator();
        response = new XHttpServletResponseSimulator();
        session = (HttpSessionSimulator)request.getSession();
        pageContext = new MockPageContext();
        pageContext.getRequestReturn = request;
        pageContext.getResponseReturn = response;
        servletConfig = new ServletConfigSimulator();
        pageContext.getServletConfigReturn = servletConfig;
        servletContext = new XServletContextSimulator();
View Full Code Here

Examples of net.sf.jsptest.compiler.jsp20.mock.MockPageContext

  }

  private MockPageContext configurePageContext(ServletContext httpContext,
      HttpServletRequest httpRequest, HttpSession httpSession,
      MockJspWriter jspWriter) {
    MockPageContext pageContext = new MockPageContext();
    pageContext.setRequest(httpRequest);
    pageContext.setServletContext(httpContext);
    pageContext.setSession(httpSession);
    pageContext.setJspWriter(jspWriter);
    return pageContext;
  }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.mock.MockPageContext

    private File log2;
    private File log3;

    public void setUp() {
        tag = new CruiseControlTagSupport();
        MockPageContext pageContext = new MockPageContext();
        tag.setPageContext(pageContext);
        request = new MockServletRequest("context", "servlet");
        pageContext.setHttpServletRequest(request);

        logDir = new File("testresults/");
        if (!logDir.exists()) {
            assertTrue("Failed to create test result dir", logDir.mkdir());
        }
View Full Code Here

Examples of org.ajax4jsf.tests.MockPageContext

    dataTable = new HtmlDataTable();
    parentTag = new DataTableTag();
    parentTag.setBinding(application.getExpressionFactory()
        .createValueExpression(dataTable, UIComponent.class));
    parentTag.setPageContext(new MockPageContext());
    List<UIComponentClassicTagBase> list = new ArrayList<UIComponentClassicTagBase>();
    list.add(parentTag);
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.internal.mock.servlet.MockPageContext

  }

  private void checkRelease(javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException,
      IllegalAccessException, InvocationTargetException, IOException,
      SAXException {
    tag.setPageContext(new MockPageContext());

    HashMap<String, Object> initialValues = new HashMap<String, Object>();
    PropertyDescriptor[] descriptors =
        PropertyUtils.getPropertyDescriptors(tag);
View Full Code Here

Examples of org.apache.myfaces.tobago.mock.servlet.MockPageContext

  }

  private void checkRelease(javax.servlet.jsp.tagext.Tag tag) throws NoSuchMethodException,
      IllegalAccessException, InvocationTargetException, IOException,
      SAXException {
    tag.setPageContext(new MockPageContext());

    HashMap initialValues = new HashMap();
    PropertyDescriptor descriptors[] =
        PropertyUtils.getPropertyDescriptors(tag);
View Full Code Here

Examples of org.apache.myfaces.tobago.mock.servlet.MockPageContext

    super.setUp();

    ServletContext servletContext = new MockServletContext();
    HttpServletRequest request = new MockHttpServletRequest();
    HttpServletResponse response = new MockHttpServletResponse();
    pageContext = new MockPageContext(request);
    ExternalContext externalContext =
        new MockExternalContext(servletContext, request, response);
    Lifecycle lifecycle = null;
    facesContext = new MockFacesContext(externalContext, lifecycle);
    // Set up Faces API Objects
View Full Code Here

Examples of org.apache.struts.mock.MockPageContext

        // -- configure the request
        this.request = new MockHttpServletRequest(new MockHttpSession());

        pageContext =
            new MockPageContext(servletConfig, request,
                new MockHttpServletResponse());
    }
View Full Code Here

Examples of org.apache.struts.mock.MockPageContext

        MockHttpServletResponse mockHttpServletResponse =
            new MockHttpServletResponse();

        mockServletConfig.setServletContext(mockServletContext);

        MockPageContext mockPageContext =
            new MockPageContext(mockServletConfig, mockHttpServletRequest,
                mockHttpServletResponse);

        ModuleConfig foundModuleConfig = null;

        try {
            foundModuleConfig = tagutils.getModuleConfig(mockPageContext);
            fail("Expected ModuleConfig to not be found");
        } catch (NullPointerException ignore) {
            // expected result
        }

        mockHttpServletRequest.setAttribute(Globals.MODULE_KEY, moduleConfig);

        mockPageContext.getServletContext().setAttribute(Globals.MODULE_KEY,
            mockPageContext);

        foundModuleConfig = tagutils.getModuleConfig(mockPageContext);
        assertNotNull(foundModuleConfig);
    }
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.