Package org.springframework.mock.web

Examples of org.springframework.mock.web.MockServletConfig


    ServletServiceAdapterComponent comp =
      (ServletServiceAdapterComponent)initedAdapters.get(configFile);
   
    if (comp == null) {
      servlet.setConfFile(configFile);
      servlet.init(new MockServletConfig(new MockServletContext()));
     
      initedAdapters.put(configFile, comp);
     
      return servlet.getBuiltComponent();
    }
View Full Code Here


        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:org/springmodules/web/tapestry/applicationContext.xml");
        ContextLoader contextLoader = new ContextLoader();
        contextLoader.initWebApplicationContext(servletContext);

        MockServletConfig servletConfig = new MockServletConfig(servletContext, "servlet");
        ApplicationServlet servlet = new ApplicationServlet();
        servlet.init(servletConfig);

        Registry hiveMindRegistry = (Registry) servletContext.getAttribute("org.apache.tapestry.Registry:servlet");
        assertNotNull("HiveMind registry is not available in servlet context", hiveMindRegistry);
View Full Code Here

    private MessageDispatcherServlet servlet;

    @Before
    public void setUp() throws Exception {
        config = new MockServletConfig(new MockServletContext(), "spring-ws");
        servlet = new MessageDispatcherServlet();
    }
View Full Code Here

        super.setUp();

        servlet =
            (HttpServlet)Class.forName("org.apache.wink.server.internal.servlet.RestServlet")
                .newInstance();
        MockServletConfig servletConfig = new MockServletConfig();
        servletConfig.addInitParameter("javax.ws.rs.Application", getApplicationClassName());

        String propertiesFile = getPropertiesFile();
        if (propertiesFile != null) {
            servletConfig.addInitParameter("propertiesLocation", propertiesFile);
        }

        tls.set(this);
        servlet.init(servletConfig);
    }
View Full Code Here

            new AbstractRepositoryServletTestCase.TestWebapplicationContext( applicationContext, mockServletContext );

        mockServletContext.setAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
                                         webApplicationContext );

        MockServletConfig mockServletConfig = new MockServletConfig()
        {
            @Override
            public ServletContext getServletContext()
            {
                return mockServletContext;
View Full Code Here

            new TestWebapplicationContext( applicationContext, mockServletContext );

        mockServletContext.setAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
                                         webApplicationContext );

        MockServletConfig mockServletConfig = new MockServletConfig()
        {
            @Override
            public ServletContext getServletContext()
            {
                return mockServletContext;
View Full Code Here

            new TestWebapplicationContext( applicationContext, mockServletContext );

        mockServletContext.setAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
                                         webApplicationContext );

        MockServletConfig mockServletConfig = new MockServletConfig()
        {
            @Override
            public ServletContext getServletContext()
            {
                return mockServletContext;
View Full Code Here

        super.setUp();

        this.safeServlet = new SafeDispatcherServlet();

        this.mockContext = new MockServletContext();
        this.mockConfig = new MockServletConfig(this.mockContext);
    }
View Full Code Here

        fail("Should have thrown ApplicationContextException since init() failed.");
    }

    public void testServiceSucceeds() {
        this.mockConfig = new MockServletConfig(this.mockContext, "cas");
        this.safeServlet.init(this.mockConfig);

        ServletRequest mockRequest = new MockHttpServletRequest();
        ServletResponse mockResponse = new MockHttpServletResponse();
View Full Code Here

    Log4jConfigServlet servlet = new Log4jConfigServlet();

    MockServletContext sc = new MockServletContext("", new FileSystemResourceLoader());
    sc.addInitParameter(Log4jWebConfigurer.CONFIG_LOCATION_PARAM,
        "test/org/springframework/util/testlog4j.properties");
    servlet.init(new MockServletConfig(sc));

    try {
      doTestLogOutput();
    }
    finally {
View Full Code Here

TOP

Related Classes of org.springframework.mock.web.MockServletConfig

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.