Examples of StrutsMockServletContext


Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        stringWriter = new StringWriter();
        writer = new PrintWriter(stringWriter);
        response = new StrutsMockHttpServletResponse();
        response.setWriter(writer);
        servletContext = new StrutsMockServletContext();
        stack = ActionContext.getContext().getValueStack();
        context = new ActionContext(stack.getContext());
        context.put(StrutsStatics.HTTP_RESPONSE, response);
        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
        invocation = new MockActionInvocation();
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        stringWriter = new StringWriter();
        writer = new PrintWriter(stringWriter);
        response = new StrutsMockHttpServletResponse();
        response.setWriter(writer);
        request = new MockHttpServletRequest();
        servletContext = new StrutsMockServletContext();
        stack = ActionContext.getContext().getValueStack();
        context = new ActionContext(stack.getContext());
        context.put(StrutsStatics.HTTP_RESPONSE, response);
        context.put(StrutsStatics.HTTP_REQUEST, request);
        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

    public void testIfStrutsEncodingIsSetProperty() throws Exception {
        FreemarkerManager mgr = new FreemarkerManager();
        mgr.setEncoding("UTF-8");
        mgr.setFileManager(new DefaultFileManager());
        StrutsMockServletContext servletContext = new StrutsMockServletContext();
        servletContext.setAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY, null);
        freemarker.template.Configuration conf = mgr.getConfiguration(servletContext);
        assertEquals(conf.getDefaultEncoding(), "UTF-8");
    }
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

    }

    public void testTemplateLoaderBaseOnFile() throws Exception {
        // given
        DummyFreemarkerManager manager = new DummyFreemarkerManager();
        StrutsMockServletContext servletContext = new StrutsMockServletContext();
        servletContext.setAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY, null);

        String tmpPath = "file://" + FileUtils.getTempDirectoryPath();
       
        // when
        manager.load(servletContext, tmpPath);
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

   
    stringWriter = new StringWriter();
    writer = new PrintWriter(stringWriter);
    response = new StrutsMockHttpServletResponse();
    response.setWriter(writer);
    servletContext = new StrutsMockServletContext();
    stack = ValueStackFactory.getFactory().createValueStack();
    context = new ActionContext(stack.getContext());
    context.put(StrutsStatics.HTTP_RESPONSE, response);
    context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
    invocation = new MockActionInvocation();
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

*/
public class FreemarkerManagerTest extends StrutsTestCase {
 
  public void testIfStrutsEncodingIsSetProperty() throws Exception {
    Settings.set(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
    StrutsMockServletContext servletContext = new StrutsMockServletContext();
    servletContext.setAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY, null);
    freemarker.template.Configuration conf = FreemarkerManager.getInstance().getConfiguration(servletContext);
    assertEquals(conf.getDefaultEncoding(), "UTF-8");
  }
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        stringWriter = new StringWriter();
        writer = new PrintWriter(stringWriter);
        response = new StrutsMockHttpServletResponse();
        response.setWriter(writer);
        request = new MockHttpServletRequest();
        servletContext = new StrutsMockServletContext();
        stack = ActionContext.getContext().getValueStack();
        context = new ActionContext(stack.getContext());
        context.put(StrutsStatics.HTTP_RESPONSE, response);
        context.put(StrutsStatics.HTTP_REQUEST, request);
        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        stringWriter = new StringWriter();
        writer = new PrintWriter(stringWriter);
        response = new StrutsMockHttpServletResponse();
        response.setWriter(writer);
        servletContext = new StrutsMockServletContext();
        stack = ActionContext.getContext().getValueStack();
        context = new ActionContext(stack.getContext());
        context.put(StrutsStatics.HTTP_RESPONSE, response);
        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
        invocation = new MockActionInvocation();
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        ActionContext context = ActionContext.getContext();

        context.put(StrutsStatics.HTTP_REQUEST, request);
        context.put(StrutsStatics.HTTP_RESPONSE, response);

        StrutsMockServletContext servletContext = new StrutsMockServletContext();

        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
        invocation = new MockActionInvocation();
        invocation.setAction(action);
        invocation.setInvocationContext(context);
View Full Code Here

Examples of org.apache.struts2.views.jsp.StrutsMockServletContext

        stringWriter = new StringWriter();
        writer = new PrintWriter(stringWriter);
        response = new StrutsMockHttpServletResponse();
        response.setWriter(writer);
        request = new MockHttpServletRequest();
        servletContext = new StrutsMockServletContext();
        stack = ActionContext.getContext().getValueStack();
        context = new ActionContext(stack.getContext());
        context.put(StrutsStatics.HTTP_RESPONSE, response);
        context.put(StrutsStatics.HTTP_REQUEST, request);
        context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
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.