Package org.springframework.mock.web

Examples of org.springframework.mock.web.MockServletContext$MimeTypeResolver


    public void testNoSpringContext() throws Exception {
        // to cover situations where there will be logged an error
        Container container = EasyMock.createNiceMock(Container.class);
        EasyMock.replay(container);
       
        StrutsSpringObjectFactory fac = new StrutsSpringObjectFactory(null, null, null, new MockServletContext(), null, container);

        assertEquals(AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, fac.getAutowireStrategy());
    }
View Full Code Here


    public void testWithSpringContext() throws Exception {
        Container container = EasyMock.createNiceMock(Container.class);
        EasyMock.replay(container);

        ConfigurableWebApplicationContext ac = new XmlWebApplicationContext();
        ServletContext msc = (ServletContext) new MockServletContext();
        msc.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ac);
        ac.setServletContext(msc);
        ac.setConfigLocations(new String[] {"org/apache/struts2/spring/StrutsSpringObjectFactoryTest-applicationContext.xml"});
        ac.refresh();
        StrutsSpringObjectFactory fac = new StrutsSpringObjectFactory("constructor", null, null, msc, null, container);
View Full Code Here

    protected void setupAfterInitDispatcher(Dispatcher dispatcher) {
        // empty by default
    }

    protected void initServletMockObjects() {
        servletContext = new MockServletContext(resourceLoader);
        response = new MockHttpServletResponse();
        request = new MockHttpServletRequest();
        pageContext = new MockPageContext(servletContext, request, response);
    }
View Full Code Here

    protected void setupBeforeInitDispatcher() throws Exception {
    }

    protected void initServletMockObjects() {
        servletContext = new MockServletContext(resourceLoader);
        response = new MockHttpServletResponse();
        request = new MockHttpServletRequest();
        pageContext = new MockPageContext(servletContext, request, response);
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        servletContext = new MockServletContext();

        result = new XSLTResult();
        stack = ActionContext.getContext().getValueStack();

        MyAction action = new MyAction();
View Full Code Here

    private MockServletContext servletContext;

    @Before
    public void setup() {
        token = new DefaultCsrfToken("header", "param", "token");
        servletContext = new MockServletContext();
    }
View Full Code Here

    private MockServletContext servletContext;

    @Before
    public void setup() throws Exception {
        token = new DefaultCsrfToken("header", "param", "token");
        servletContext = new MockServletContext();
        mockWebTestUtils();
    }
View Full Code Here

    public void setUp() throws Exception {
        SecurityContextHolder.getContext().setAuthentication(currentUser);
        StaticWebApplicationContext ctx = new StaticWebApplicationContext();
        ctx.registerSingleton("expressionHandler", DefaultWebSecurityExpressionHandler.class);
        ctx.registerSingleton("wipe", MockWebInvocationPrivilegeEvaluator.class);
        MockServletContext servletCtx = new MockServletContext();
        servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);
        authorizeTag = new JspAuthorizeTag();
        authorizeTag.setPageContext(new MockPageContext(servletCtx, request, new MockHttpServletResponse()));
    }
View Full Code Here

        Map beanMap = new HashMap();
        beanMap.put("pe", pe);
        when(ctx.getBeansOfType(PermissionEvaluator.class)).thenReturn(beanMap);

        MockServletContext servletCtx = new MockServletContext();
        servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ctx);
        pageContext = new MockPageContext(servletCtx, new MockHttpServletRequest(), new MockHttpServletResponse());
        tag.setPageContext(pageContext);
    }
View Full Code Here

    @Before
    public void setup() {
        tag = new AuthzTag();
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        servletContext = new MockServletContext();
    }
View Full Code Here

TOP

Related Classes of org.springframework.mock.web.MockServletContext$MimeTypeResolver

Copyright © 2018 www.massapicom. 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.