vmassol 02/05/05 07:28:50
Modified: framework/src/java/j2ee13/org/apache/cactus/client
FilterHttpClient.java
framework/src/java/share/org/apache/cactus
AbstractTestCase.java WebRequest.java
framework/src/java/share/org/apache/cactus/client
JspHttpClient.java ServletHttpClient.java
framework/src/java/share/org/apache/cactus/util
Configuration.java
Added: framework/src/java/share/org/apache/cactus Request.java
framework/src/java/share/org/apache/cactus/util
JspConfiguration.java ServletConfiguration.java
framework/src/java/j2ee13/org/apache/cactus/util
FilterConfiguration.java
Log:
preparing for support of different client protocols (ex: JMS)
Revision Changes Path
1.4 +4 -4
jakarta-cactus/framework/src/java/j2ee13/org/apache/cactus/client/FilterHttpClient.java
Index: FilterHttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/j2ee13/org/apache/cactus/client/FilterHttpClient.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FilterHttpClient.java 14 Apr 2002 15:56:27 -0000 1.3
+++ FilterHttpClient.java 5 May 2002 14:28:50 -0000 1.4
@@ -57,7 +57,7 @@
package org.apache.cactus.client;
import org.apache.cactus.WebRequest;
-import org.apache.cactus.util.Configuration;
+import org.apache.cactus.util.FilterConfiguration;
/**
* Manage the logic for calling the Servlet redirector for executing a test on
@@ -65,7 +65,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: FilterHttpClient.java,v 1.3 2002/04/14 15:56:27 vmassol Exp $
+ * @version $Id: FilterHttpClient.java,v 1.4 2002/05/05 14:28:50 vmassol Exp $
*/
public class FilterHttpClient extends AbstractHttpClient
{
@@ -82,10 +82,10 @@
// Check if user has overriden the servlet redirector
if (theRequest.getRedirectorName() != null) {
- url = Configuration.getContextURL() + "/" +
+ url = FilterConfiguration.getContextURL() + "/" +
theRequest.getRedirectorName();
} else {
- url = Configuration.getFilterRedirectorURL();
+ url = FilterConfiguration.getFilterRedirectorURL();
}
return url;
1.5 +5 -2
jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractTestCase.java
Index: AbstractTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/AbstractTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractTestCase.java 28 Apr 2002 20:19:17 -0000 1.4
+++ AbstractTestCase.java 5 May 2002 14:28:50 -0000 1.5
@@ -68,11 +68,14 @@
/**
* Abstract class that is a thin layer on top of JUnit and that knows about
- * test cases that are executed on the server side.
+ * test cases that are executed on the server side. This class is independent
+ * of the protocol used to communicate from the Cactus client side and the
+ * Cactus server side; it can be HTTP, JMS, etc. Subclasses will define
+ * additional behaviour that depends on the protocol.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: AbstractTestCase.java,v 1.4 2002/04/28 20:19:17 vmassol Exp $
+ * @version $Id: AbstractTestCase.java,v 1.5 2002/05/05 14:28:50 vmassol Exp $
*/
public abstract class AbstractTestCase extends TestCase
{
1.3 +2 -2
jakarta-cactus/framework/src/java/share/org/apache/cactus/WebRequest.java
Index: WebRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/WebRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- WebRequest.java 14 Apr 2002 10:46:25 -0000 1.2
+++ WebRequest.java 5 May 2002 14:28:50 -0000 1.3
@@ -92,9 +92,9 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Robertson</a>
*
- * @version $Id: WebRequest.java,v 1.2 2002/04/14 10:46:25 vmassol Exp $
+ * @version $Id: WebRequest.java,v 1.3 2002/05/05 14:28:50 vmassol Exp $
*/
-public class WebRequest
+public class WebRequest implements Request
{
/**
* The request parameters that need to be sent in the body (POST)
1.1
jakarta-cactus/framework/src/java/share/org/apache/cactus/Request.java
Index: Request.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
* Foundation" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.cactus;
/**
* Tagging interface that represents all Requests objects that are used on
* the Cactus client side to store information related to the request that
* will be sent to the Cactus redirector (on the Cactus Server side).
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
* @version $Id: Request.java,v 1.1 2002/05/05 14:28:50 vmassol Exp $
*/
public interface Request
{
}
1.3 +4 -4
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/JspHttpClient.java
Index: JspHttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/JspHttpClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JspHttpClient.java 14 Apr 2002 15:56:27 -0000 1.2
+++ JspHttpClient.java 5 May 2002 14:28:50 -0000 1.3
@@ -57,7 +57,7 @@
package org.apache.cactus.client;
import org.apache.cactus.WebRequest;
-import org.apache.cactus.util.Configuration;
+import org.apache.cactus.util.JspConfiguration;
/**
* Manage the logic for calling the JSP redirector for executing a test on
@@ -65,7 +65,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: JspHttpClient.java,v 1.2 2002/04/14 15:56:27 vmassol Exp $
+ * @version $Id: JspHttpClient.java,v 1.3 2002/05/05 14:28:50 vmassol Exp $
*/
public class JspHttpClient extends AbstractHttpClient
{
@@ -82,10 +82,10 @@
// Check if user has overriden the servlet redirector
if (theRequest.getRedirectorName() != null) {
- url = Configuration.getContextURL() + "/" +
+ url = JspConfiguration.getContextURL() + "/" +
theRequest.getRedirectorName();
} else {
- url = Configuration.getJspRedirectorURL();
+ url = JspConfiguration.getJspRedirectorURL();
}
return url;
1.3 +4 -4
jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ServletHttpClient.java
Index: ServletHttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/client/ServletHttpClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServletHttpClient.java 14 Apr 2002 15:56:27 -0000 1.2
+++ ServletHttpClient.java 5 May 2002 14:28:50 -0000 1.3
@@ -57,7 +57,7 @@
package org.apache.cactus.client;
import org.apache.cactus.WebRequest;
-import org.apache.cactus.util.Configuration;
+import org.apache.cactus.util.ServletConfiguration;
/**
* Manage the logic for calling the Servlet redirector for executing a test on
@@ -65,7 +65,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: ServletHttpClient.java,v 1.2 2002/04/14 15:56:27 vmassol Exp $
+ * @version $Id: ServletHttpClient.java,v 1.3 2002/05/05 14:28:50 vmassol Exp $
*/
public class ServletHttpClient extends AbstractHttpClient
{
@@ -82,10 +82,10 @@
// Check if user has overriden the servlet redirector
if (theRequest.getRedirectorName() != null) {
- url = Configuration.getContextURL() + "/" +
+ url = ServletConfiguration.getContextURL() + "/" +
theRequest.getRedirectorName();
} else {
- url = Configuration.getServletRedirectorURL();
+ url = ServletConfiguration.getServletRedirectorURL();
}
return url;
1.2 +2 -37
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java
Index: Configuration.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/util/Configuration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Configuration.java 14 Apr 2002 15:56:28 -0000 1.1
+++ Configuration.java 5 May 2002 14:28:50 -0000 1.2
@@ -66,7 +66,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
- * @version $Id: Configuration.java,v 1.1 2002/04/14 15:56:28 vmassol Exp $
+ * @version $Id: Configuration.java,v 1.2 2002/05/05 14:28:50 vmassol Exp $
*/
public class Configuration
{
@@ -102,7 +102,7 @@
*
* @return the cactus configuration as a <code>ResourceBundle</code>.
*/
- private static final ResourceBundle getConfiguration()
+ protected static final ResourceBundle getConfiguration()
{
if (config == null) {
// Has the user passed the location of the cactus configuration file
@@ -128,45 +128,10 @@
/**
* @return the context URL under which our application to test runs.
- * @throw MissingResourceException if the property defining the context
- * is missing.
*/
public static String getContextURL()
{
return getConfiguration().getString("cactus.contextURL");
- }
-
- /**
- * @return the Servlet redirector
- * @throw MissingResourceException if the property defining the servlet
- * redirector is missing.
- */
- public static String getServletRedirectorURL()
- {
- return getContextURL() + "/" +
- getConfiguration().getString("cactus.servletRedirectorName");
- }
-
- /**
- * @return the JSP redirector
- * @throw MissingResourceException if the property defining the JSP
- * redirector is missing.
- */
- public static String getJspRedirectorURL()
- {
- return getContextURL() + "/" +
- getConfiguration().getString("cactus.jspRedirectorName");
- }
-
- /**
- * @return the Filter redirector
- * @throw MissingResourceException if the property defining the Filter
- * redirector is missing.
- */
- public static String getFilterRedirectorURL()
- {
- return getContextURL() + "/" +
- getConfiguration().getString("cactus.filterRedirectorName");
}
/**
1.1
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/JspConfiguration.java
Index: JspConfiguration.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
* Foundation" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.cactus.util;
/**
* Provides acces to JSP specific configuration parameters.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
* @version $Id: JspConfiguration.java,v 1.1 2002/05/05 14:28:50 vmassol Exp $
*/
public class JspConfiguration extends Configuration
{
/**
* @return the JSP redirector
*/
public static String getJspRedirectorURL()
{
return getContextURL() + "/" +
getConfiguration().getString("cactus.jspRedirectorName");
}
}
1.1
jakarta-cactus/framework/src/java/share/org/apache/cactus/util/ServletConfiguration.java
Index: ServletConfiguration.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
* Foundation" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.cactus.util;
/**
* Provides acces to Servlet specific configuration parameters.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
* @version $Id: ServletConfiguration.java,v 1.1 2002/05/05 14:28:50 vmassol Exp $
*/
public class ServletConfiguration extends Configuration
{
/**
* @return the Servlet redirector
*/
public static String getServletRedirectorURL()
{
return getContextURL() + "/" +
getConfiguration().getString("cactus.servletRedirectorName");
}
}
1.1
jakarta-cactus/framework/src/java/j2ee13/org/apache/cactus/util/FilterConfiguration.java
Index: FilterConfiguration.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
* Foundation" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.cactus.util;
/**
* Provides acces to Filter specific configuration parameters.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
*
* @version $Id: FilterConfiguration.java,v 1.1 2002/05/05 14:28:50 vmassol Exp $
*/
public class FilterConfiguration extends Configuration
{
/**
* @return the Filter redirector
*/
public static String getFilterRedirectorURL()
{
return getContextURL() + "/" +
getConfiguration().getString("cactus.filterRedirectorName");
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>