01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.test;
06:
07: import com.mockrunner.mock.web.MockServletContext;
08: import org.springframework.beans.BeansException;
09: import org.springframework.context.ApplicationContext;
10: import org.springframework.context.support.ClassPathXmlApplicationContext;
11: import org.springframework.ui.context.Theme;
12: import org.springframework.web.context.WebApplicationContext;
13: import javax.servlet.ServletContext;
14:
15: /**
16: * A spring application context used for GeoServer testing.
17: *
18: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
19: *
20: */
21: public class GeoServerTestApplicationContext extends
22: ClassPathXmlApplicationContext implements WebApplicationContext {
23: ServletContext servletContext;
24:
25: public GeoServerTestApplicationContext(String configLocation,
26: ServletContext servletContext) throws BeansException {
27: this (new String[] { configLocation }, servletContext);
28: }
29:
30: public GeoServerTestApplicationContext(String[] configLocation,
31: ServletContext servletContext) throws BeansException {
32: super (configLocation, false);
33: this .servletContext = servletContext;
34: }
35:
36: public ServletContext getServletContext() {
37: return servletContext;
38: }
39:
40: public Theme getTheme(String themeName) {
41: return null;
42: }
43: }
|