01: // StrutsTestCase - a JUnit extension for testing Struts actions
02: // within the context of the ActionServlet.
03: // Copyright (C) 2002 Deryl Seale
04: //
05: // This library is free software; you can redistribute it and/or
06: // modify it under the terms of the Apache Software License as
07: // published by the Apache Software Foundation; either version 1.1
08: // of the License, or (at your option) any later version.
09: //
10: // This library is distributed in the hope that it will be useful,
11: // but WITHOUT ANY WARRANTY; without even the implied warranty of
12: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: // Apache Software Foundation Licens for more details.
14: //
15: // You may view the full text here: http://www.apache.org/LICENSE.txt
16:
17: package servletunit.struts;
18:
19: import org.apache.cactus.server.ServletConfigWrapper;
20:
21: import javax.servlet.ServletConfig;
22: import javax.servlet.ServletContext;
23:
24: /**
25: * A wrapper for the ServletConfig class. This is used in
26: * CactusStrutsTestCase so that we can use out own ServletContext
27: * wrapper class. This allows us to to use the ActionServlet
28: * as a black box, rather than mimic its behavior as was previously
29: * the case.
30: */
31: public class StrutsServletConfigWrapper extends ServletConfigWrapper {
32:
33: private ServletContext context;
34:
35: public StrutsServletConfigWrapper(ServletConfig config) {
36: super (config);
37: }
38:
39: public ServletContext getServletContext() {
40: return this .context;
41: }
42:
43: public void setServletContext(ServletContext context) {
44: this.context = context;
45: }
46:
47: }
|