mraible
Nov 21st, 2004, 09:29 PM
I have the following in a TestCase's setUp() method. It works fine in 1.1.1:
// initialize Spring
MockServletContext sc = new MockServletContext("");
sc.addInitParameter(ContextLoader.CONFIG_LOCATION_ PARAM,
"/WEB-INF/applicationContext*.xml");
ServletContextListener contextListener = new ContextLoaderListener();
ServletContextEvent event = new ServletContextEvent(sc);
contextListener.contextInitialized(event);
However, in 1.1.2 it results in the following error:
[junit] java.lang.UnsupportedOperationException: getResourcePaths
[junit] at org.springframework.mock.web.MockServletContext.ge tResourcePaths(MockServletContext.java:128)
[junit] at org.springframework.web.context.support.ServletCon textResourcePatternResolver.doRetrieveMatchingServ letContextResources(ServletContextResourcePatternR esolver.java:100)
[junit] at org.springframework.web.context.support.ServletCon textResourcePatternResolver.doFindPathMatchingFile Resources(ServletContextResourcePatternResolver.ja va:79)
[junit] at org.springframework.core.io.support.PathMatchingRe sourcePatternResolver.findPathMatchingFileResource s(PathMatchingResourcePatternResolver.java:192)
[junit] at org.springframework.core.io.support.PathMatchingRe sourcePatternResolver.getResources(PathMatchingRes ourcePatternResolver.java:145)
[junit] at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:142)
// initialize Spring
MockServletContext sc = new MockServletContext("");
sc.addInitParameter(ContextLoader.CONFIG_LOCATION_ PARAM,
"/WEB-INF/applicationContext*.xml");
ServletContextListener contextListener = new ContextLoaderListener();
ServletContextEvent event = new ServletContextEvent(sc);
contextListener.contextInitialized(event);
However, in 1.1.2 it results in the following error:
[junit] java.lang.UnsupportedOperationException: getResourcePaths
[junit] at org.springframework.mock.web.MockServletContext.ge tResourcePaths(MockServletContext.java:128)
[junit] at org.springframework.web.context.support.ServletCon textResourcePatternResolver.doRetrieveMatchingServ letContextResources(ServletContextResourcePatternR esolver.java:100)
[junit] at org.springframework.web.context.support.ServletCon textResourcePatternResolver.doFindPathMatchingFile Resources(ServletContextResourcePatternResolver.ja va:79)
[junit] at org.springframework.core.io.support.PathMatchingRe sourcePatternResolver.findPathMatchingFileResource s(PathMatchingResourcePatternResolver.java:192)
[junit] at org.springframework.core.io.support.PathMatchingRe sourcePatternResolver.getResources(PathMatchingRes ourcePatternResolver.java:145)
[junit] at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:142)