craigmcc 01/08/21 21:52:46
Modified: workflow build.xml
Added: workflow/src/test/org/apache/commons/workflow/web
WebContextTestCase.java WebExecuteTestCase.java
Log:
Add baseline tests for WebContext that are extensions of the
BaseContextTestCase and BaseExecuteTestCase test suites. No web-specific
tests are included yet. Including them means it's probably time to delve
into Cactus, Latka, HttpClient, and so on.
Revision Changes Path
1.7 +22 -2 jakarta-commons-sandbox/workflow/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/workflow/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 2001/08/22 04:14:15 1.6
+++ build.xml 2001/08/22 04:52:45 1.7
@@ -3,7 +3,7 @@
<!--
"Workflow" component of the Jakarta Commons Subproject
- $Id: build.xml,v 1.6 2001/08/22 04:14:15 craigmcc Exp $
+ $Id: build.xml,v 1.7 2001/08/22 04:52:45 craigmcc Exp $
-->
@@ -256,7 +256,9 @@
test.BaseContext,
test.BaseExecute,
test.CoreExecute,
- test.IOExecute"
+ test.IOExecute,
+ test.WebContext,
+ test.WebExecute"
description="Run all unit test cases">
</target>
@@ -304,6 +306,24 @@
failonerror="${test.failonerror}">
<sysproperty key="ioexecute.url" value="${ioexecute.url}"/>
<arg value="org.apache.commons.workflow.io.IOExecuteTestCase"/>
+ <classpath refid="test.classpath"/>
+ </java>
+ </target>
+
+ <target name="test.WebContext">
+ <echo message="Running WebContext tests ..."/>
+ <java classname="${test.runner}" fork="yes"
+ failonerror="${test.failonerror}">
+ <arg value="org.apache.commons.workflow.web.WebContextTestCase"/>
+ <classpath refid="test.classpath"/>
+ </java>
+ </target>
+
+ <target name="test.WebExecute">
+ <echo message="Running WebExecute tests ..."/>
+ <java classname="${test.runner}" fork="yes"
+ failonerror="${test.failonerror}">
+ <arg value="org.apache.commons.workflow.web.WebExecuteTestCase"/>
<classpath refid="test.classpath"/>
</java>
</target>
1.1
jakarta-commons-sandbox/workflow/src/test/org/apache/commons/workflow/web/WebContextTestCase.java
Index: WebContextTestCase.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/workflow/src/test/org/apache/commons/workflow/web/WebContextTestCase.java,v
1.1 2001/08/22 04:52:46 craigmcc Exp $
* $Revision: 1.1 $
* $Date: 2001/08/22 04:52:46 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 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", "Commons", 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.commons.workflow.web;
import java.util.EmptyStackException;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.jpath.JPathContext;
import org.apache.commons.workflow.Context;
import org.apache.commons.workflow.Scope;
import org.apache.commons.workflow.base.BaseContextTestCase;
/**
* <p>Test Case for the WebContext class. These tests exercise those
* functions that are not dependent upon an associated Activity.</p>
*
* @author Craig R. McClanahan
* @version $Revision: 1.1 $ $Date: 2001/08/22 04:52:46 $
*/
public class WebContextTestCase extends BaseContextTestCase {
// ----------------------------------------------------- Instance Variables
// ----------------------------------------------------------- Constructors
/**
* Construct a new instance of this test case.
*
* @param name Name of the test case
*/
public WebContextTestCase(String name) {
super(name);
}
// -------------------------------------------------- Overall Test Methods
/**
* Set up instance variables required by this test case.
*/
public void setUp() {
context = new WebContext();
}
/**
* Return the tests included in this test suite.
*/
public static Test suite() {
return (new TestSuite(WebContextTestCase.class));
}
/**
* Tear down instance variables required by this test case.
*/
public void tearDown() {
context = null;
}
// ------------------------------------------------ Individual Test Methods
}
1.1
jakarta-commons-sandbox/workflow/src/test/org/apache/commons/workflow/web/WebExecuteTestCase.java
Index: WebExecuteTestCase.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-commons-sandbox/workflow/src/test/org/apache/commons/workflow/web/WebExecuteTestCase.java,v
1.1 2001/08/22 04:52:46 craigmcc Exp $
* $Revision: 1.1 $
* $Date: 2001/08/22 04:52:46 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2001 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", "Commons", 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.commons.workflow.web;
import java.util.EmptyStackException;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.workflow.Activity;
import org.apache.commons.workflow.Context;
import org.apache.commons.workflow.Scope;
import org.apache.commons.workflow.Step;
import org.apache.commons.workflow.StepException;
import org.apache.commons.workflow.base.BaseActivity;
import org.apache.commons.workflow.base.BaseExecuteTestCase;
import org.apache.commons.workflow.base.TestStep;
/**
* <p>Test Case for the BaseActivity class. These tests exercise
* basic <code>Activity</code> execution capabilities, without requiring
* any existing <code>Step</code> implementations, against a
* <code>WebContext</code> instance.</p>
*
* @author Craig R. McClanahan
* @version $Revision: 1.1 $ $Date: 2001/08/22 04:52:46 $
*/
public class WebExecuteTestCase extends BaseExecuteTestCase {
// ----------------------------------------------------- Instance Variables
// ----------------------------------------------------------- Constructors
/**
* Construct a new instance of this test case.
*
* @param name Name of the test case
*/
public WebExecuteTestCase(String name) {
super(name);
}
// --------------------------------------------------- Overall Test Methods
/**
* Set up instance variables required by this test case.
*/
public void setUp() {
activity = new BaseActivity();
context = new WebContext();
}
/**
* Return the tests included in this test suite.
*/
public static Test suite() {
return (new TestSuite(WebExecuteTestCase.class));
}
/**
* Tear down instance variables required by this test case.
*/
public void tearDown() {
activity = null;
context = null;
}
// ------------------------------------------------ Individual Test Methods
}