KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > servletunit > struts > StrutsServletConfigWrapper


1 // StrutsTestCase - a JUnit extension for testing Struts actions
2
// within the context of the ActionServlet.
3
// Copyright (C) 2002 Deryl Seale
4
//
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the Apache Software License as
7
// published by the Apache Software Foundation; either version 1.1
8
// of the License, or (at your option) any later version.
9
//
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 JavaDoc;
22 import javax.servlet.ServletContext JavaDoc;
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 JavaDoc context;
34     
35     public StrutsServletConfigWrapper(ServletConfig JavaDoc config) {
36     super(config);
37     }
38
39     public ServletContext JavaDoc getServletContext() {
40     return this.context;
41     }
42
43     public void setServletContext(ServletContext JavaDoc context) {
44     this.context = context;
45     }
46
47 }
48
Popular Tags