Examples of PartitionedServletContext


Examples of org.impalaframework.web.servlet.wrapper.context.PartitionedServletContext

        webAttributeQualifier = new DefaultWebAttributeQualifier();
    }

    public void testGetResourceOnClassPath() throws MalformedURLException {
        servletContext = createMock(ServletContext.class);
        PartitionedServletContext wrapperContext = new PartitionedServletContext(servletContext, "", "mymodule", webAttributeQualifier, ClassUtils.getDefaultClassLoader());
       
        replay(servletContext);
       
        //in both cases the item is found on the classpath, so no call to underlying servletContext is made
        assertNotNull(wrapperContext.getResource("parentTestContext.xml"));
        assertNotNull(wrapperContext.getResource("/parentTestContext.xml"));
       
        verify(servletContext);
    }
View Full Code Here

Examples of org.impalaframework.web.servlet.wrapper.context.PartitionedServletContext

    }
   

    public void testGetResourceNotClassPath() throws MalformedURLException {
        servletContext = createMock(ServletContext.class);
        PartitionedServletContext wrapperContext = new PartitionedServletContext(servletContext, "", "mymodule", webAttributeQualifier, ClassUtils.getDefaultClassLoader());
       
        expect(servletContext.getResource("nopresent.xml")).andReturn(null);
        expect(servletContext.getResource("/nopresent.xml")).andReturn(null);
       
        replay(servletContext);
       
        //in both cases the item is found on the classpath, so no call to underlying servletContext is made
        wrapperContext.getResource("nopresent.xml");
        wrapperContext.getResource("/nopresent.xml");
       
        verify(servletContext);
    }
View Full Code Here

Examples of org.impalaframework.web.servlet.wrapper.context.PartitionedServletContext

        verify(servletContext);
    }
   
    public void testGetResourceAsStreamOnClassPath() throws MalformedURLException {
        servletContext = createMock(ServletContext.class);
        PartitionedServletContext wrapperContext = new PartitionedServletContext(servletContext, "", "mymodule", webAttributeQualifier, ClassUtils.getDefaultClassLoader());
       
        replay(servletContext);
       
        //in both cases the item is found on the classpath, so no call to underlying servletContext is made
        assertNotNull(wrapperContext.getResourceAsStream("parentTestContext.xml"));
        assertNotNull(wrapperContext.getResourceAsStream("/parentTestContext.xml"));
       
        verify(servletContext);
    }
View Full Code Here

Examples of org.impalaframework.web.servlet.wrapper.context.PartitionedServletContext

        verify(servletContext);
    }

    public void testGetResourceAsStreamNotClassPath() throws MalformedURLException {
        servletContext = createMock(ServletContext.class);
        PartitionedServletContext wrapperContext = new PartitionedServletContext(servletContext, "", "mymodule", webAttributeQualifier, ClassUtils.getDefaultClassLoader());
       
        expect(servletContext.getResource("nopresent.xml")).andReturn(null);
        expect(servletContext.getResource("/nopresent.xml")).andReturn(null);
       
        replay(servletContext);
       
        //in both cases the item is found on the classpath, so no call to underlying servletContext is made
        wrapperContext.getResourceAsStream("nopresent.xml");
        wrapperContext.getResourceAsStream("/nopresent.xml");
       
        verify(servletContext);
    }
View Full Code Here

Examples of org.impalaframework.web.servlet.wrapper.context.PartitionedServletContext

    public void testPartitionedContext() {
        wrapper.setEnablePartitionedServletContext(true);
        final ServletContext wrappedContext = wrapper.wrapServletContext(servletContext, "id", new SimpleModuleDefinition("mymodule"), ClassUtils.getDefaultClassLoader());
        assertTrue(wrappedContext instanceof PartitionedServletContext);
        PartitionedServletContext wrapperContext = (PartitionedServletContext) wrappedContext;
        assertEquals("id", ReflectionUtils.invokeMethod(wrapperContext, "getApplicationId"));
    }
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.