You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by vm...@apache.org on 2003/01/23 13:32:26 UTC
cvs commit: jakarta-cactus/petals/ant/src/confs/share/resin20 resin.conf
vmassol 2003/01/23 04:32:26
Added: petals/ant/src/confs/share/orion16 server.xml principals.xml
application.xml default-web-site.xml mime.types
rmi.xml global-web-application.xml
petals/ant/src/java/org/apache/cactus/petal/ant
StopServerHelper.java EnhydraRun.java
AbstractServerRun.java StartServerHelper.java
RunServerTestsTask.java ResinRun.java
petals/ant/src/confs/share/orion14 server.xml
global-web-application.xml rmi.xml application.xml
mime.types principals.xml default-web-site.xml
petals/ant/src/confs/share/orion15 application.xml rmi.xml
mime.types server.xml global-web-application.xml
default-web-site.xml principals.xml
petals/ant/src/confs/j2ee13 web.xml
petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles
EmbeddedLDAP.index EmbeddedLDAP.tran
EmbeddedLDAP.delete EmbeddedLDAP.data
EmbeddedLDAP.trpos EmbeddedLDAP.twpos
petals/ant/src/confs/share/weblogic61 fileRealm.properties
weblogic.xml config.xml SerializedSystemIni.dat
petals/ant/src/confs/j2ee12/tomcat32 server.xml
tomcat-users.xml
petals/ant/src/confs/share/weblogic70
DefaultAuthenticatorInit.ldift weblogic.xml
SerializedSystemIni.dat config.xml
fileRealm.properties
petals/ant/src/confs/j2ee12/enhydra31 multiserver.conf
petals/ant .cvsignore build.properties.sample build.xml
petals/ant/src/confs/j2ee12/weblogic51 weblogic.policy
weblogic.properties
petals/ant/src/confs/j2ee12 web.xml
petals/ant/src/confs/j2ee12/tomcat33 server.xml
tomcat-users.xml modules.xml
petals/ant/src/confs/share/tomcat4x server.xml
tomcat-users.xml
petals/ant/src/confs/share log_server.properties
log_client.properties
petals/ant/src/confs/j2ee13/jboss3x users.properties
jboss-web.xml roles.properties
petals/ant/src/scripts/share build-tests-tomcat-40.xml
build-share.xml
petals/ant/src/confs/j2ee12/resin12 resin.conf
petals/ant/src/scripts/j2ee13 build.xml
petals/ant/src/confs/j2ee13/resin13 resin.conf
petals/ant/src/confs/share/resin20 resin.conf
Log:
- First commit of the new Ant Petal (the "Petal" name can still be changed later if we don't like it). ATM only one script is checked in (the one for Tomcat 4.x). Here is an example of how to call the Ant Petal from a project build file:
<?xml version="1.0"?>
<project name="Test" default="test" basedir=".">
<property name="cactus.ant.petal.dir" value="E:/Dev/jakarta-cactus/petals/ant/dist"/>
<target name="war">
<mkdir dir="target"/>
<war destfile="target/my.war" webxml="conf/web.xml"/>
</target>
<target name="test" depends="war">
<ant dir="${cactus.ant.petal.dir}" target="cactus.run.tomcat4x">
<property name="cactus.home.tomcat4x" value="c:/apps/jakarta-tomcat-4.1.18"/>
<property name="cactus.war" value="${basedir}/target/my.war"/>
<property name="cactus.target.dir" value="${basedir}/target/cactus"/>
<property name="cactus.src.dir" value="${basedir}/src/test-cactus"/>
</ant>
</target>
</project>
- Important missing feature: the web.xmls are not currently merged (i.e. the cactus web.xml overwrites the user web.xml)
Revision Changes Path
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/server.xml
Index: server.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE application-server PUBLIC "Orion Application Server Config" "http://www.orionserver.com/dtds/application-server.dtd">
<application-server>
<global-application name="default" path="./application.xml" />
<global-web-app-config path="./global-web-application.xml" />
<web-site path="./default-web-site.xml" />
<rmi-config path="./rmi.xml" />
</application-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/principals.xml
Index: principals.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE principals PUBLIC "//Evermind - Orion Principals//" "http://www.orionserver.com/dtds/principals.dtd">
<principals>
<groups>
<group name="administrators">
<description>administrators</description>
<permission name="administration" />
<permission name="com.evermind.server.AdministrationPermission" />
</group>
<group name="guests">
<description>guests</description>
</group>
<group name="users">
<description>users</description>
<permission name="rmi:login" />
<permission name="com.evermind.server.rmi.RMIPermission" />
</group>
</groups>
<users>
<user username="admin" password="password" deactivated="false">
<description>The default administrator</description>
<group-membership group="administrators" />
<group-membership group="guests" />
<group-membership group="users" />
</user>
<user username="testuser" password="testpassword" deactivated="false">
<description>Cactus Test User</description>
</user>
</users>
</principals>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/application.xml
Index: application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://www.orionserver.com/dtds/orion-application.dtd">
<orion-application>
<web-module id="test" path="../test.war"/>
<security-role-mapping name="test">
<user name="testuser"/>
</security-role-mapping>
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</read-access>
<write-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</write-access>
</namespace-access>
<principals path="./principals.xml" />
</orion-application>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/default-web-site.xml
Index: default-web-site.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE web-site PUBLIC "Orion Web-site" "http://www.orionserver.com/dtds/web-site.dtd">
<web-site host="[ALL]" port="@test.port@" display-name="Default Orion WebSite">
<!-- The default web-app for this site, bound to the root -->
<default-web-app application="default" name="test"/>
<web-app application="default" name="test" root="/test"/>
</web-site>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/mime.types
Index: mime.types
===================================================================
# Registered mime-types
application/activemessage
application/andrew-inset
application/applefile
application/atomicmail
application/dca-rft
application/dec-dx
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/msword doc
application/news-message-id
application/news-transmission
application/octet-stream bin dms lha lzh exe class
application/jsp jsp
application/oda oda
application/pdf pdf
application/postscript ai eps ps
application/powerpoint ppt
application/remote-printing
application/rtf rtf
application/slate
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-cdlink vcd
application/x-compress Z
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-gtar gtar
application/x-gzip gz
application/x-hdf hdf
application/x-httpd-cgi cgi
application/x-java-jnlp-file jnlp
application/x-koan skp skd skt skm
application/x-latex latex
application/x-mif mif
application/x-netcdf nc cdf
application/x-sh sh
application/x-shar shar
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
text/xml xml ent cat sty
text/dtd dtd
text/xsl xsl
application/jsp jsp
application/zip zip
audio/basic au snd
audio/mpeg mpga mp2
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ram
audio/x-pn-realaudio-plugin rpm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb xyz
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/png png
image/tiff tiff tif
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/external-body
message/news
message/partial
message/rfc822
multipart/alternative
multipart/appledouble
multipart/digest
multipart/mixed
multipart/parallel
text/html html htm
text/plain txt
text/richtext rtx
text/tab-separated-values tsv
text/x-setext etx
text/x-sgml sgml sgm
video/mpeg mpeg mpg mpe
video/quicktime qt mov
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
x-world/x-vrml wrl vrml
text/vnd.wap.wml wml
application/vnd.wap.wmlc wmlc
text/vnd.wap.wmlscript wmls
application/vnd.wap.wmlscriptc wmlsc
image/vnd.wap.wbmp wbmp
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/rmi.xml
Index: rmi.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE rmi-server PUBLIC "Orion RMI-server" "http://www.orionserver.com/dtds/rmi-server.dtd">
<rmi-server port="23791">
</rmi-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion16/global-web-application.xml
Index: global-web-application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-web-app PUBLIC '//Evermind//Orion web-application' 'http://www.orionserver.com/dtds/orion-web.dtd'>
<!-- Set development="true" to enabvle development, enable this if you
want to debug JSP sources etc -->
<orion-web-app
jsp-cache-directory="./persistence"
servlet-webdir="/servlet"
development="false"
persistence-path="./persistence/state.ser"
>
<!-- The mime-mappings for this server -->
<mime-mappings path="./mime.types" />
<servlet-chaining servlet-name="xsl" mime-type="text/xml" />
<web-app>
<servlet>
<servlet-name>xsl</servlet-name>
<servlet-class>com.evermind.servlet.XSLServlet</servlet-class>
<init-param>
<param-name>defaultContentType</param-name>
<param-value>text/html</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>com.evermind.server.http.JSPServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ssi</servlet-name>
<servlet-class>com.evermind.server.http.SSIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>perl</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>perl</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>php</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>php</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>/*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/*.cgi</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>perl</servlet-name>
<url-pattern>/*.pl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php3</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.phtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>/*.shtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
</orion-web-app>
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/StopServerHelper.java
Index: StopServerHelper.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.CallTarget;
/**
* A helper class for an Ant task that does the following : stop a running
* server by calling an Ant target to stop it in another thread and wait for
* the servlet engine to be stopped by trying to continously connect to a test
* URL. If it succeeds it means the server is not stopped yet !
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: StopServerHelper.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
*/
public class StopServerHelper implements Runnable
{
/**
* The URL that is continuously pinged to verify if the server is stopped
*/
private URL testURL;
/**
* The Ant target name that will stop the web server/servlet engine.
*/
private String stopTarget;
/**
* The tasks that wraps around this helper class
*/
private Task task;
/**
* @param theTask the Ant task that is calling this helper
*/
public StopServerHelper(Task theTask)
{
this.task = theTask;
}
/**
* @see Task#execute()
*/
public void execute() throws BuildException
{
// Verify that a test URL has been specified
if (this.testURL == null)
{
throw new BuildException("A testURL attribute must be specified");
}
// Verify that a stop target has been specified
if (this.stopTarget == null)
{
throw new BuildException("A stopTarget Ant target name must be "
+ "specified");
}
// Try connecting in case the server is already stopped.
try
{
HttpURLConnection connection =
(HttpURLConnection) this.testURL.openConnection();
connection.connect();
StartServerHelper.readFully(connection);
connection.disconnect();
}
catch (IOException e)
{
// Server is not running. Make this task a no-op.
return;
}
// Call the target that stops the server, in another thread.
Thread thread = new Thread(this);
thread.start();
// Wait a few ms more (just to make sure)
try
{
Thread.sleep(500);
}
catch (InterruptedException e)
{
throw new BuildException("Interruption during sleep", e);
}
// Continuously try calling the test URL until it fails
while (true)
{
try
{
HttpURLConnection connection =
(HttpURLConnection) this.testURL.openConnection();
connection.connect();
StartServerHelper.readFully(connection);
connection.disconnect();
}
catch (IOException e)
{
break;
}
try
{
Thread.sleep(500);
}
catch (InterruptedException ee)
{
throw new BuildException("Interruption during sleep", ee);
}
}
// Wait a few ms more (just to be sure !)
try
{
Thread.sleep(500);
}
catch (InterruptedException e)
{
throw new BuildException("Interruption during sleep", e);
}
this.task.log("Server stopped !");
// We're done ... Ant will continue processing other tasks
}
/**
* The thread that calls the Ant target that stops the web server/servlet
* engine.
*/
public void run()
{
// Call the Ant target using the "antcall" task.
CallTarget callee;
callee = (CallTarget) (this.task.getProject().createTask("antcall"));
callee.setOwningTarget(this.task.getOwningTarget());
callee.setTaskName(this.task.getTaskName());
callee.setLocation(this.task.getLocation());
callee.setInheritAll(true);
callee.init();
callee.setTarget(this.stopTarget);
callee.execute();
}
/**
* @param theTestURL the test URL to ping
*/
public void setTestURL(String theTestURL)
{
try
{
this.testURL = new URL(theTestURL);
}
catch (MalformedURLException e)
{
throw new BuildException("Bad URL [" + theTestURL + "]", e);
}
}
/**
* @param theStopTarget the Ant target to call
*/
public void setStopTarget(String theStopTarget)
{
this.stopTarget = theStopTarget;
}
}
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/EnhydraRun.java
Index: EnhydraRun.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import java.lang.reflect.Method;
/**
* Starts/stop Enhydra by setting up a listener socket.
*
* @author <a href="mailto:digital@ix.net.au">Robert Leftwich</a>
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: EnhydraRun.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
* @see AbstractServerRun
*/
public class EnhydraRun extends AbstractServerRun
{
/**
* @param theArgs the command line arguments
*/
public EnhydraRun(String[] theArgs)
{
super(theArgs);
}
/**
* Entry point to start/stop the Enhydra server.
*
* @param theArgs the command line arguments
*/
public static void main(String[] theArgs)
{
EnhydraRun enhydra = new EnhydraRun(theArgs);
enhydra.doRun();
}
/**
* Start the Enhydra server. We use reflection so that the Enhydra jars do
* not need to be in the classpath to compile this class.
*/
protected void doStartServer()
{
try
{
Class enhydraClass =
Class.forName("com.lutris.multiServer.MultiServer");
Method initMethod = enhydraClass.getMethod("main",
new Class[] {this.args.getClass()});
initMethod.invoke(null, new Object[] {this.args});
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Cannot create instance of MultiServer");
}
}
/**
* Stops the Enhydra server. We use reflection so that the Enhydra jars do
* not need to be in the classpath to compile this class.
*/
protected void doStopServer()
{
try
{
Class enhydraClass =
Class.forName("com.lutris.multiServer.MultiServer");
Method shutDownMethod = enhydraClass.getMethod("shutdown", null);
shutDownMethod.invoke(null, null);
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Cannot stop running instance of "
+ "MultiServer");
}
}
}
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/AbstractServerRun.java
Index: AbstractServerRun.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Vector;
/**
* Abstract class for starting/stopping an application server. When this
* application is first called to start the server, a listener socket is
* set up. Then, we it is later called to stop the server, we connect to the
* listener socket and tell the server to stop.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
* @author <a href="mailto:digital@ix.net.au">Robert Leftwich</a>
*
* @version $Id: AbstractServerRun.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
*/
public abstract class AbstractServerRun extends Thread
{
/**
* Internal socket port that we use to stop the server.
*/
private int port = 7777;
/**
* Host name. We assume the server is started and stoppped in the same
* local machine
*/
private String host = "127.0.0.1";
/**
* The command line arguments
*/
protected String[] args;
/**
* Flag that specifies if the server is already started to prevent
* starting it if it is.
*/
private boolean isStarted = false;
/**
* @param theArgs the command line arguments
*/
public AbstractServerRun(String[] theArgs)
{
this.args = theArgs;
}
/**
* Starts the server (in a blocking mode) and set up a socket listener.
*
* @exception Exception if any error happens when starting the server
*/
protected abstract void doStartServer() throws Exception;
/**
* Stops the server by connecting to the socket set up when the server
* was started.
*
* @exception Exception if any error happens when stopping the server
*/
protected abstract void doStopServer() throws Exception;
/**
* Parse and process the command line to start/stop the server.
*/
protected void doRun()
{
// Look for a -start or -stop flag
boolean isStart = true;
Vector newArgs = new Vector();
for (int i = 0; i < this.args.length; i++)
{
if (this.args[i].equalsIgnoreCase("-start"))
{
isStart = true;
}
else if (this.args[i].equalsIgnoreCase("-stop"))
{
isStart = false;
}
else if (this.args[i].equalsIgnoreCase("-port"))
{
this.port = Integer.parseInt(this.args[i + 1]);
i++;
}
else
{
newArgs.add(this.args[i]);
}
}
// Remove the command line arguments that should not be part of the
// server command line (i.e. our own arguments).
String[] strArgs = new String[0];
this.args = (String[]) newArgs.toArray(strArgs);
if (isStart)
{
startServer();
}
else
{
stopServer();
}
}
/**
* Starts the server.
*/
private void startServer()
{
// If the server is already started, do nothing
if (this.isStarted)
{
return;
}
try
{
doStartServer();
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Error starting server");
}
// Server is now started
this.isStarted = true;
new Thread(this).start();
}
/**
* Stops the running server.
*/
private void stopServer()
{
// Open socket connection
Socket clientSocket = null;
try
{
clientSocket = new Socket(this.host, this.port);
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Error opening socket to " + this.host
+ ":" + this.port + "]");
}
finally
{
try
{
if (clientSocket != null)
{
clientSocket.close();
}
}
catch (IOException e)
{
throw new RuntimeException("Cannot close client socket");
}
}
}
/**
* Sets up a listener socket and wait until we receive a request on it to
* stop the running server.
*/
public void run()
{
ServerSocket serverSocket = setUpListenerSocket();
// Accept a client socket connection
try
{
serverSocket.accept();
}
catch (IOException e)
{
throw new RuntimeException("Error accepting connection for "
+ "server socket [" + serverSocket + "]");
}
finally
{
// Stop server socket
try
{
serverSocket.close();
}
catch (IOException e)
{
throw new RuntimeException("Cannot close server socket ["
+ serverSocket + "]");
}
}
// Stop server
try
{
this.doStopServer();
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Cannot stop server");
}
// Stop server socket
try
{
serverSocket.close();
}
catch (IOException e)
{
throw new RuntimeException("Cannot close server socket ["
+ serverSocket + "]");
}
}
/**
* Sets up the listener socket.
*
* @return the listener socket that has been set up
*/
private ServerSocket setUpListenerSocket()
{
ServerSocket serverSocket = null;
try
{
serverSocket = new ServerSocket(this.port);
}
catch (IOException e)
{
e.printStackTrace();
throw new RuntimeException("Error setting up the server "
+ "listener socket");
}
return serverSocket;
}
}
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/StartServerHelper.java
Index: StartServerHelper.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.CallTarget;
/**
* A helper class for an Ant Task that does the following :
* <ul>
* <li>create a java thread,</li>
* <li>start another Ant target in that thread. This target must be a
* blocking target that starts a web server/servlet engine,</li>
* <li>wait for that server to be started. This is done by continuously
* trying to call a URL.</li>
* </ul>.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: StartServerHelper.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
*/
public class StartServerHelper implements Runnable
{
/**
* The URL that is continuously pinged to verify if the server is running.
*/
private URL testURL;
/**
* The Ant target name that will start the web server/servlet engine.
*/
private String startTarget;
/**
* The tasks that wraps around this helper class
*/
private Task task;
/**
* True if the server was already started when this task is executed.
*/
private boolean isServerAlreadyStarted = false;
/**
* @param theTask the Ant task that is calling this helper
*/
public StartServerHelper(Task theTask)
{
this.task = theTask;
}
/**
* @return true if the server has already been started.
*/
public boolean isServerAlreadyStarted()
{
return this.isServerAlreadyStarted;
}
/**
* @see Task#execute()
*/
public void execute() throws BuildException
{
// Verify that a test URL has been specified
if (this.testURL == null)
{
throw new BuildException("A testURL attribute must be specified");
}
// Verify that a start target has been specified
if (this.startTarget == null)
{
throw new BuildException("A startTarget Ant target name must "
+ "be specified");
}
// Try connecting in case the server is already running. If so, does
// nothing
if (isURLCallable())
{
// Server is already running. Record this information so that we
// don't stop it afterwards.
this.isServerAlreadyStarted = true;
this.task.log("Server is already running", Project.MSG_DEBUG);
return;
}
else
{
this.task.log("Server is not running", Project.MSG_DEBUG);
}
// Call the target that starts the server, in another thread. The called
// target must be blocking.
Thread thread = new Thread(this);
thread.start();
// Wait a few ms more (just to make sure the servlet engine is
// ready to accept connections)
sleep(1000);
// Continuously try calling the test URL until it succeeds
while (true)
{
this.task.log("Checking if server is up ...", Project.MSG_DEBUG);
if (!isURLCallable())
{
sleep(500);
continue;
}
this.task.log("Server is up !", Project.MSG_DEBUG);
break;
}
// Wait a few ms more (just to be sure !)
sleep(500);
this.task.log("Server started", Project.MSG_DEBUG);
// We're done ... Ant will continue processing other tasks
}
/**
* Sleeps n milliseconds.
*
* @param theMs the number of milliseconds to wait
* @throws BuildException if the sleeping thread is interrupted
*/
private void sleep(int theMs) throws BuildException
{
try
{
Thread.sleep(theMs);
}
catch (InterruptedException e)
{
throw new BuildException("Interruption during sleep", e);
}
}
/**
* @return true if the test URL could be called without error or false
* otherwise
*/
private boolean isURLCallable()
{
boolean isURLCallable = false;
try
{
HttpURLConnection connection =
(HttpURLConnection) this.testURL.openConnection();
connection.connect();
readFully(connection);
connection.disconnect();
isURLCallable = true;
}
catch (IOException e)
{
// Log an information in debug mode
// Get stacktrace text
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(baos);
e.printStackTrace(writer);
writer.close();
this.task.log("Failed to call test URL. Reason :"
+ new String(baos.toByteArray()), Project.MSG_DEBUG);
}
return isURLCallable;
}
/**
* Fully reads the input stream from the passed HTTP URL connection to
* prevent (harmless) server-side exception.
*
* @param theConnection the HTTP URL connection to read from
* @exception IOException if an error happens during the read
*/
static void readFully(HttpURLConnection theConnection)
throws IOException
{
// Only read if there is data to read ... The problem is that not
// all servers return a content-length header. If there is no header
// getContentLength() returns -1. It seems to work and it seems
// that all servers that return no content-length header also do
// not block on read() operations !
if (theConnection.getContentLength() != 0)
{
byte[] buf = new byte[256];
InputStream is = theConnection.getInputStream();
while (-1 != is.read(buf))
{
// Make sure we read all the data in the stream
}
}
}
/**
* The thread that calls the Ant target that starts the web server/servlet
* engine. Must be a blocking target.
*/
public void run()
{
// Call the Ant target using the "antcall" task.
CallTarget callee;
callee = (CallTarget) (this.task.getProject().createTask("antcall"));
callee.setOwningTarget(this.task.getOwningTarget());
callee.setTaskName(this.task.getTaskName());
callee.setLocation(this.task.getLocation());
callee.setInheritAll(true);
callee.init();
callee.setTarget(this.startTarget);
callee.execute();
// Should never reach this point as the target is blocking, unless the
// server is stopped.
}
/**
* @param theTestURL the test URL to ping
*/
public void setTestURL(String theTestURL)
{
try
{
this.testURL = new URL(theTestURL);
}
catch (MalformedURLException e)
{
throw new BuildException("Bad URL [" + theTestURL + "]", e);
}
this.task.log("Test URL = [" + this.testURL + "]", Project.MSG_DEBUG);
}
/**
* @param theStartTarget the Ant target to call
*/
public void setStartTarget(String theStartTarget)
{
this.startTarget = theStartTarget;
}
}
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/RunServerTestsTask.java
Index: RunServerTestsTask.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.CallTarget;
/**
* Task to automate running in-container unit test. It has the following
* syntax when used in Ant :
* <code><pre>
* <runservertests testURL="&t;url>"
* startTarget="<start target name>"
* stopTarget="<stop target name>"
* testTarget="<test target name>"/>
* </pre></code>
* where <code><url></code> is the URL that is used by this task to
* ensure that the server is running. Indeed, the algorithm is as follow :
* <ul>
* <li>Checks if server is running by trying to open an HTTP connection to
* the URL,</li>
* <li>If it fails, call the start target and loop until the HTTP connection
* the URL can be established,</li>
* <li>Call the test target. This target is supposed to start the test,
* usually by running the junit Ant task,</li>
* <li>When the tests are finished, call the stop target to stop the server.
* Note: The stop target is called only if the server was not already running
* when this task was executed.</li>
* </ul>
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
*
* @version $Id: RunServerTestsTask.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
*/
public class RunServerTestsTask extends Task
{
/**
* the test target name.
*/
private String testTarget;
/**
* The helper object used to start the server. We use a helper so that it
* can also be reused in the <code>StartServerTask</code> task. Indeed,
* with Ant 1.3 and before there are classloaders issues with calling a
* custom task from another custom task. Using a helper is a workaround.
*/
private StartServerHelper startHelper;
/**
* The helper object used to stop the server. We use a helper so that it
* can also be reused in the <code>StopServerTask</code> task. Indeed,
* with Ant 1.3 and before there are classloaders issues with calling a
* custom task from another custom task. Using a helper is a workaround.
*/
private StopServerHelper stopHelper;
/**
* Initialize the task.
*/
public void init()
{
this.startHelper = new StartServerHelper(this);
this.stopHelper = new StopServerHelper(this);
}
/**
* @see Task#execute()
*/
public void execute() throws BuildException
{
try
{
callStart();
callTests();
}
finally
{
// Make sure we stop the server but only if it were not already
// started before the execution of this task.
if (!this.startHelper.isServerAlreadyStarted())
{
callStop();
}
}
}
/**
* Call the start server task
*/
private void callStart()
{
this.startHelper.execute();
}
/**
* Call the stop server task
*/
private void callStop()
{
this.stopHelper.execute();
}
/**
* Call the run tests target
*/
private void callTests()
{
CallTarget callee;
callee = (CallTarget) project.createTask("antcall");
callee.setOwningTarget(target);
callee.setTaskName(getTaskName());
callee.setLocation(location);
callee.setInheritAll(true);
callee.init();
callee.setTarget(this.testTarget);
callee.execute();
}
/**
* Sets the target to call to start the server.
*
* @param theStartTarget the Ant target to call
*/
public void setStartTarget(String theStartTarget)
{
this.startHelper.setStartTarget(theStartTarget);
}
/**
* Sets the target to call to stop the server.
*
* @param theStopTarget the Ant target to call
*/
public void setStopTarget(String theStopTarget)
{
this.stopHelper.setStopTarget(theStopTarget);
}
/**
* Sets the URL to call for testing if the server is running.
*
* @param theTestURL the test URL to ping
*/
public void setTestURL(String theTestURL)
{
this.startHelper.setTestURL(theTestURL);
this.stopHelper.setTestURL(theTestURL);
}
/**
* Sets the target to call to run the tests.
*
* @param theTestTarget the Ant target to call
*/
public void setTestTarget(String theTestTarget)
{
this.testTarget = theTestTarget;
}
}
1.1 jakarta-cactus/petals/ant/src/java/org/apache/cactus/petal/ant/ResinRun.java
Index: ResinRun.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 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 apache@apache.org.
*
* 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.petal.ant;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
/**
* Starts/stop Resin by setting up a listener socket.
*
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
* @author <a href="mailto:digital@ix.net.au">Robert Leftwich</a>
*
* @version $Id: ResinRun.java,v 1.1 2003/01/23 12:32:23 vmassol Exp $
* @see AbstractServerRun
*/
public class ResinRun extends AbstractServerRun
{
/**
* The started Resin server class. We use <code>Object</code> instead of
* the Resin class so that we don't need the Resin jars in the classpath
* to compile this class.
*/
private Object resinServer;
/**
* @param theArgs the command line arguments
*/
public ResinRun(String[] theArgs)
{
super(theArgs);
}
/**
* Entry point to start/stop the Resin server.
*
* @param theArgs the command line arguments
*/
public static void main(String[] theArgs)
{
ResinRun resin = new ResinRun(theArgs);
resin.doRun();
}
/**
* Start the Resin server. We use reflection so that the Resin jars do not
* need to be in the classpath to compile this class.
*/
protected void doStartServer()
{
try
{
Class resinClass =
Class.forName("com.caucho.server.http.ResinServer");
Constructor constructor = resinClass.getConstructor(
new Class[] {this.args.getClass(), boolean.class});
this.resinServer = constructor.newInstance(
new Object[] {this.args, Boolean.TRUE});
// Try Resin 2.0 first
try
{
startResin20(this.resinServer);
}
catch (NoSuchMethodException nsme)
{
// Try Resin 2.1
startResin21(this.resinServer);
}
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Cannot create instance of ResinServer");
}
}
/**
* Starts Resin 2.0.x
*
* @param theResinServer the <code>ResinServer</code> instance
* @throws Exception if an error happens when starting the server
*/
private void startResin20(Object theResinServer) throws Exception
{
Method initMethod = theResinServer.getClass().getMethod("init",
new Class[] {boolean.class});
initMethod.invoke(theResinServer, new Object[] {Boolean.TRUE});
}
/**
* Starts Resin 2.1.x
*
* @param theResinServer the <code>ResinServer</code> instance
* @throws Exception if an error happens when starting the server
*/
private void startResin21(Object theResinServer) throws Exception
{
Method initMethod = theResinServer.getClass().getMethod("init",
new Class[] {ArrayList.class});
initMethod.invoke(theResinServer, new Object[] {null});
}
/**
* Stops the Resin server. We use reflection so that the Resin jars do not
* need to be in the classpath to compile this class.
*/
protected void doStopServer()
{
try
{
Method closeMethod = this.resinServer.getClass().getMethod(
"close", null);
closeMethod.invoke(this.resinServer, null);
}
catch (Exception e)
{
e.printStackTrace();
throw new RuntimeException("Cannot stop running instance of "
+ "ResinServer");
}
}
}
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/server.xml
Index: server.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE application-server PUBLIC "Orion Application Server Config" "http://www.orionserver.com/dtds/application-server.dtd">
<application-server>
<global-application name="default" path="./application.xml" />
<global-web-app-config path="./global-web-application.xml" />
<web-site path="./default-web-site.xml" />
<rmi-config path="./rmi.xml" />
<principals path="./principals.xml" />
</application-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/global-web-application.xml
Index: global-web-application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-web-app PUBLIC '//Evermind//Orion web-application' 'http://www.orionserver.com/dtds/orion-web.dtd'>
<!-- Set development="true" to enabvle development, enable this if you
want to debug JSP sources etc -->
<orion-web-app
jsp-cache-directory="./persistence"
servlet-webdir="/servlet"
development="false"
persistence-path="./persistence/state.ser"
>
<!-- The mime-mappings for this server -->
<mime-mappings path="./mime.types" />
<servlet-chaining servlet-name="xsl" mime-type="text/xml" />
<web-app>
<servlet>
<servlet-name>xsl</servlet-name>
<servlet-class>com.evermind.servlet.XSLServlet</servlet-class>
<init-param>
<param-name>defaultContentType</param-name>
<param-value>text/html</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>com.evermind.server.http.JSPServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ssi</servlet-name>
<servlet-class>com.evermind.server.http.SSIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>perl</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>perl</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>php</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>php</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>/*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/*.cgi</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>perl</servlet-name>
<url-pattern>/*.pl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php3</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.phtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>/*.shtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
</orion-web-app>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/rmi.xml
Index: rmi.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE rmi-server PUBLIC "Orion RMI-server" "http://www.orionserver.com/dtds/rmi-server.dtd">
<rmi-server port="23791">
</rmi-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/application.xml
Index: application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://www.orionserver.com/dtds/orion-application.dtd">
<orion-application>
<web-module id="test" path="../test.war"/>
<security-role-mapping name="test">
<user name="testuser"/>
</security-role-mapping>
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</read-access>
<write-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</write-access>
</namespace-access>
</orion-application>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/mime.types
Index: mime.types
===================================================================
# Registered mime-types
application/activemessage
application/andrew-inset
application/applefile
application/atomicmail
application/dca-rft
application/dec-dx
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/msword doc
application/news-message-id
application/news-transmission
application/octet-stream bin dms lha lzh exe class
application/jsp jsp
application/oda oda
application/pdf pdf
application/postscript ai eps ps
application/powerpoint ppt
application/remote-printing
application/rtf rtf
application/slate
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-cdlink vcd
application/x-compress Z
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-gtar gtar
application/x-gzip gz
application/x-hdf hdf
application/x-httpd-cgi cgi
application/x-java-jnlp-file jnlp
application/x-koan skp skd skt skm
application/x-latex latex
application/x-mif mif
application/x-netcdf nc cdf
application/x-sh sh
application/x-shar shar
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
text/xml xml ent cat sty
text/dtd dtd
text/xsl xsl
application/jsp jsp
application/zip zip
audio/basic au snd
audio/mpeg mpga mp2
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ram
audio/x-pn-realaudio-plugin rpm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb xyz
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/png png
image/tiff tiff tif
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/external-body
message/news
message/partial
message/rfc822
multipart/alternative
multipart/appledouble
multipart/digest
multipart/mixed
multipart/parallel
text/html html htm
text/plain txt
text/richtext rtx
text/tab-separated-values tsv
text/x-setext etx
text/x-sgml sgml sgm
video/mpeg mpeg mpg mpe
video/quicktime qt mov
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
x-world/x-vrml wrl vrml
text/vnd.wap.wml wml
application/vnd.wap.wmlc wmlc
text/vnd.wap.wmlscript wmls
application/vnd.wap.wmlscriptc wmlsc
image/vnd.wap.wbmp wbmp
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/principals.xml
Index: principals.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE principals PUBLIC "//Evermind - Orion Principals//" "http://www.orionserver.com/dtds/principals.dtd">
<principals>
<groups>
<group name="administrators">
<description>administrators</description>
<permission name="administration" />
<permission name="com.evermind.server.AdministrationPermission" />
</group>
<group name="guests">
<description>guests</description>
</group>
<group name="users">
<description>users</description>
<permission name="rmi:login" />
<permission name="com.evermind.server.rmi.RMIPermission" />
</group>
</groups>
<users>
<user username="admin" password="password" deactivated="false">
<description>The default administrator</description>
<group-membership group="administrators" />
<group-membership group="guests" />
<group-membership group="users" />
</user>
<user username="testuser" password="testpassword" deactivated="false">
<description>Cactus Test User</description>
</user>
</users>
</principals>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion14/default-web-site.xml
Index: default-web-site.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE web-site PUBLIC "Orion Web-site" "http://www.orionserver.com/dtds/web-site.dtd">
<web-site host="[ALL]" port="@test.port@" display-name="Default Orion WebSite">
<!-- The default web-app for this site, bound to the root -->
<default-web-app application="default" name="test"/>
<web-app application="default" name="test" root="/test" />
</web-site>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/application.xml
Index: application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" "http://www.orionserver.com/dtds/orion-application.dtd">
<orion-application>
<web-module id="test" path="../test.war"/>
<security-role-mapping name="test">
<user name="testuser"/>
</security-role-mapping>
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</read-access>
<write-access>
<namespace-resource root="">
<security-role-mapping>
<group name="administrators" />
</security-role-mapping>
</namespace-resource>
</write-access>
</namespace-access>
<principals path="./principals.xml" />
</orion-application>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/rmi.xml
Index: rmi.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE rmi-server PUBLIC "Orion RMI-server" "http://www.orionserver.com/dtds/rmi-server.dtd">
<rmi-server port="23791">
</rmi-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/mime.types
Index: mime.types
===================================================================
# Registered mime-types
application/activemessage
application/andrew-inset
application/applefile
application/atomicmail
application/dca-rft
application/dec-dx
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/msword doc
application/news-message-id
application/news-transmission
application/octet-stream bin dms lha lzh exe class
application/jsp jsp
application/oda oda
application/pdf pdf
application/postscript ai eps ps
application/powerpoint ppt
application/remote-printing
application/rtf rtf
application/slate
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-cdlink vcd
application/x-compress Z
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-gtar gtar
application/x-gzip gz
application/x-hdf hdf
application/x-httpd-cgi cgi
application/x-java-jnlp-file jnlp
application/x-koan skp skd skt skm
application/x-latex latex
application/x-mif mif
application/x-netcdf nc cdf
application/x-sh sh
application/x-shar shar
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
text/xml xml ent cat sty
text/dtd dtd
text/xsl xsl
application/jsp jsp
application/zip zip
audio/basic au snd
audio/mpeg mpga mp2
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ram
audio/x-pn-realaudio-plugin rpm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb xyz
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/png png
image/tiff tiff tif
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/external-body
message/news
message/partial
message/rfc822
multipart/alternative
multipart/appledouble
multipart/digest
multipart/mixed
multipart/parallel
text/html html htm
text/plain txt
text/richtext rtx
text/tab-separated-values tsv
text/x-setext etx
text/x-sgml sgml sgm
video/mpeg mpeg mpg mpe
video/quicktime qt mov
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
x-world/x-vrml wrl vrml
text/vnd.wap.wml wml
application/vnd.wap.wmlc wmlc
text/vnd.wap.wmlscript wmls
application/vnd.wap.wmlscriptc wmlsc
image/vnd.wap.wbmp wbmp
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/server.xml
Index: server.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE application-server PUBLIC "Orion Application Server Config" "http://www.orionserver.com/dtds/application-server.dtd">
<application-server>
<global-application name="default" path="./application.xml" />
<global-web-app-config path="./global-web-application.xml" />
<web-site path="./default-web-site.xml" />
<rmi-config path="./rmi.xml" />
</application-server>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/global-web-application.xml
Index: global-web-application.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE orion-web-app PUBLIC '//Evermind//Orion web-application' 'http://www.orionserver.com/dtds/orion-web.dtd'>
<!-- Set development="true" to enabvle development, enable this if you
want to debug JSP sources etc -->
<orion-web-app
jsp-cache-directory="./persistence"
servlet-webdir="/servlet"
development="false"
persistence-path="./persistence/state.ser"
>
<!-- The mime-mappings for this server -->
<mime-mappings path="./mime.types" />
<servlet-chaining servlet-name="xsl" mime-type="text/xml" />
<web-app>
<servlet>
<servlet-name>xsl</servlet-name>
<servlet-class>com.evermind.servlet.XSLServlet</servlet-class>
<init-param>
<param-name>defaultContentType</param-name>
<param-value>text/html</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>com.evermind.server.http.JSPServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ssi</servlet-name>
<servlet-class>com.evermind.server.http.SSIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>perl</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>perl</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>php</servlet-name>
<servlet-class>com.evermind.server.http.CGIServlet</servlet-class>
<init-param>
<param-name>interpreter</param-name>
<param-value>php</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>/*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/*.cgi</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>perl</servlet-name>
<url-pattern>/*.pl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.php3</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>/*.phtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>/*.shtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
</orion-web-app>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/default-web-site.xml
Index: default-web-site.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE web-site PUBLIC "Orion Web-site" "http://www.orionserver.com/dtds/web-site.dtd">
<web-site host="[ALL]" port="@test.port@" display-name="Default Orion WebSite">
<!-- The default web-app for this site, bound to the root -->
<default-web-app application="default" name="test"/>
<web-app application="default" name="test" root="/test"/>
</web-site>
1.1 jakarta-cactus/petals/ant/src/confs/share/orion15/principals.xml
Index: principals.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE principals PUBLIC "//Evermind - Orion Principals//" "http://www.orionserver.com/dtds/principals.dtd">
<principals>
<groups>
<group name="administrators">
<description>administrators</description>
<permission name="administration" />
<permission name="com.evermind.server.AdministrationPermission" />
</group>
<group name="guests">
<description>guests</description>
</group>
<group name="users">
<description>users</description>
<permission name="rmi:login" />
<permission name="com.evermind.server.rmi.RMIPermission" />
</group>
</groups>
<users>
<user username="admin" password="password" deactivated="false">
<description>The default administrator</description>
<group-membership group="administrators" />
<group-membership group="guests" />
<group-membership group="users" />
</user>
<user username="testuser" password="testpassword" deactivated="false">
<description>Cactus Test User</description>
</user>
</users>
</principals>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee13/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<filter>
<filter-name>FilterRedirector</filter-name>
<filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
</filter>
<filter-mapping>
<filter-name>FilterRedirector</filter-name>
<!-- Some servlet 2.3 containers need to map the filter to a valid
resource (Orion 1.5.2 for example). Others, like Tomcat,
are happy with just any mapping.
For example, the following would work with Tomcat :
<url-pattern>/FilterRedirector</url-pattern> -->
<url-pattern>/test/filterRedirector.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
<init-param>
<param-name>param1</param-name>
<param-value>value1 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>ServletRedirectorSecure</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet>
<servlet-name>ServletRedirector_TestOverride</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
<init-param>
<param-name>param2</param-name>
<param-value>value2 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>JspRedirector</servlet-name>
<jsp-file>/jspRedirector.jsp</jsp-file>
<init-param>
<param-name>param1</param-name>
<param-value>value1 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>TestJsp</servlet-name>
<jsp-file>/test/test.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletRedirectorSecure</servlet-name>
<url-pattern>/ServletRedirectorSecure</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletRedirector_TestOverride</servlet-name>
<url-pattern>/ServletRedirectorOverride</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JspRedirector</servlet-name>
<url-pattern>/JspRedirector</url-pattern>
</servlet-mapping>
<!-- Authentication -->
<security-constraint>
<web-resource-collection>
<web-resource-name>SecurityRestriction</web-resource-name>
<description>Protect the Cactus redirector servlet.</description>
<url-pattern>/ServletRedirectorSecure</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<description>Authorized Users Group</description>
<role-name>test</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Sample Cactus Servlet Application</realm-name>
</login-config>
<security-role>
<description>Test role</description>
<role-name>test</role-name>
</security-role>
<!-- End Authentication -->
</web-app>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.index
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.tran
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.delete
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.data
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.trpos
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/testserver/ldap/ldapfiles/EmbeddedLDAP.twpos
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic61/fileRealm.properties
Index: fileRealm.properties
===================================================================
#Mon Dec 10 17:24:02 GMT 2001
acl.unlockServer.weblogic.admin=Administrators
user.system=0xb925d776addde243d018a561318650afadb954cc
user.testuser=0x52ac5510feac8b38a621a64c13be7799675e7e3c
acl.lockServer.weblogic.admin=Administrators
acl.unlockuser.weblogic.passwordpolicy=Administrators
acl.shutdown.weblogic.admin=Administrators
acl.boot.weblogic.server=Administrators,everyone
group.Administrators=system
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic61/weblogic.xml
Index: weblogic.xml
===================================================================
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 6.0//EN" "http://www.bea.com/servers/wls610/dtd/ weblogic-web-jar.dtd">
<weblogic-web-app>
<security-role-assignment>
<role-name>test</role-name>
<principal-name>testuser</principal-name>
</security-role-assignment>
</weblogic-web-app>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic61/config.xml
Index: config.xml
===================================================================
<Domain Name="testdomain">
<Server Name="testserver" NativeIOEnabled="true" ListenPort="@test.port@"/>
</Domain>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic61/SerializedSystemIni.dat
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/tomcat32/server.xml
Index: server.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>
<Logger name="tc_log"/>
<Logger name="servlet_log"/>
<Logger name="JASPER_LOG"/>
<ContextManager home="@target.tomcat32.dir@" debug="0" workDir="work" showDebugInfo="true">
<ContextInterceptor className="org.apache.tomcat.context.AutoSetup"/>
<ContextInterceptor className="org.apache.tomcat.context.WebXmlReader"/>
<ContextInterceptor className="org.apache.tomcat.context.LoaderInterceptor"/>
<ContextInterceptor className="org.apache.tomcat.context.DefaultCMSetter"/>
<ContextInterceptor className="org.apache.tomcat.context.WorkDirInterceptor"/>
<RequestInterceptor className="org.apache.tomcat.request.SessionInterceptor" noCookies="false"/>
<RequestInterceptor className="org.apache.tomcat.request.SimpleMapper1" debug="0"/>
<RequestInterceptor className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/servlet/"/>
<RequestInterceptor className="org.apache.tomcat.request.StaticInterceptor" debug="0" suppress="false"/>
<RequestInterceptor className="org.apache.tomcat.session.StandardSessionInterceptor"/>
<RequestInterceptor className="org.apache.tomcat.request.AccessInterceptor" debug="0"/>
<RequestInterceptor className="org.apache.tomcat.request.SimpleRealm" debug="0"/>
<ContextInterceptor className="org.apache.tomcat.context.LoadOnStartupInterceptor"/>
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
<Parameter name="port" value="@test.port@"/>
</Connector>
<!-- Note: we use a port different from the standard one (8007) not
to interfere with an other running tomcat -->
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
<Parameter name="port" value="8777"/>
</Connector>
<Context path="" docBase="" debug="0"/>
</ContextManager>
</Server>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/tomcat32/tomcat-users.xml
Index: tomcat-users.xml
===================================================================
<tomcat-users>
<user name="testuser" password="testpassword" roles="test" />
</tomcat-users>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/DefaultAuthenticatorInit.ldift
Index: DefaultAuthenticatorInit.ldift
===================================================================
dn: dc=@domain@
dc: @domain@
objectclass: top
objectclass: domain
dn: ou=@realm@, dc=@domain@
ou: @realm@
objectclass: top
objectclass: organizationalUnit
dn: ou=groups,ou=@realm@, dc=@domain@
ou: groups
objectclass: organizationalUnit
objectclass: top
dn: cn=Administrators,ou=groups,ou=@realm@, dc=@domain@
memberURL: ldap:///ou=groups,ou=@realm@,dc=@domain@??sub?(&(objectclass=person)(wlsMemberOf=cn=Administrators,ou=groups,ou=@realm@,dc=@domain@))
description: Administrators group
objectclass: top
objectclass: groupOfUniqueNames
objectclass: groupOfURLs
cn: Administrators
dn: cn=Deployers,ou=groups,ou=@realm@, dc=@domain@
memberURL: ldap:///ou=groups,ou=@realm@,dc=@domain@??sub?(&(objectclass=person)(wlsMemberOf=cn=Deployers,ou=groups,ou=@realm@,dc=@domain@))
description: Deployers group
objectclass: top
objectclass: groupOfUniqueNames
objectclass: groupOfURLs
cn: Deployers
dn: cn=Operators,ou=groups,ou=@realm@, dc=@domain@
memberURL: ldap:///ou=groups,ou=@realm@,dc=@domain@??sub?(&(objectclass=person)(wlsMemberOf=cn=Operators,ou=groups,ou=@realm@,dc=@domain@))
description: Operators group
objectclass: top
objectclass: groupOfUniqueNames
objectclass: groupOfURLs
cn: Operators
dn: cn=Monitors,ou=groups,ou=@realm@, dc=@domain@
memberURL: ldap:///ou=groups,ou=@realm@,dc=@domain@??sub?(&(objectclass=person)(wlsMemberOf=cn=Monitors,ou=groups,ou=@realm@,dc=@domain@))
description: Monitors group
objectclass: top
objectclass: groupOfUniqueNames
objectclass: groupOfURLs
cn: Monitors
dn: ou=people,ou=@realm@, dc=@domain@
ou: people
objectclass: organizationalUnit
objectclass: top
dn: uid=system,ou=people,ou=@realm@, dc=@domain@
description: system
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
objectclass: top
cn: system
sn: system
userpassword: {ssha}XYqqB9c/6OXoNVCOil7ZRdbb/GSIXVcE
uid: system
objectclass: wlsUser
wlsMemberOf: cn=Administrators,ou=groups,ou=@realm@,dc=@domain@
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/weblogic.xml
Index: weblogic.xml
===================================================================
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 6.0//EN" "http://www.bea.com/servers/wls610/dtd/ weblogic-web-jar.dtd">
<weblogic-web-app>
<security-role-assignment>
<role-name>test</role-name>
<principal-name>testuser</principal-name>
</security-role-assignment>
</weblogic-web-app>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/SerializedSystemIni.dat
<<Binary file>>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/config.xml
Index: config.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<Domain Name="testdomain">
<EmbeddedLDAP
Credential="{3DES}55B/7RZVVwwrYUjjEf9Cdd5f72Gj7pm7apl5R36oQfU=" Name="testdomain"/>
<FileRealm Name="wl_default_file_realm"/>
<PasswordPolicy Name="wl_default_password_policy"/>
<Realm FileRealm="wl_default_file_realm" Name="wl_default_realm"/>
<Security Name="testdomain"
PasswordPolicy="wl_default_password_policy"
Realm="wl_default_realm" RealmSetup="true"/>
<SecurityConfiguration
Credential="{3DES}VXIBKpJ4bKQa1IbvnNqcaZa6BPWIg0zhWlcSd2lrfZmn7KZ9gF7QnMZqhjswb/KzSbiBo/cuJGV7qLrkNbpL64iLduDXGin1" Name="testdomain"/>
<Server Name="testserver" NativeIOEnabled="true" ListenPort="@test.port@"/>
</Domain>
1.1 jakarta-cactus/petals/ant/src/confs/share/weblogic70/fileRealm.properties
Index: fileRealm.properties
===================================================================
#Wed Jun 19 22:19:44 BST 2002
acl.modify.weblogic.admin.acl=Administrators
acl.unlockServer.weblogic.admin=Administrators
user.system=0xa7dc9690ce40f88dac3bdd23cb32588ff5546bb6
acl.lockServer.weblogic.admin=Administrators
acl.unlockuser.weblogic.passwordpolicy=Administrators
acl.shutdown.weblogic.admin=Administrators
acl.boot.weblogic.server=Administrators,everyone
group.Administrators=system
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/enhydra31/multiserver.conf
Index: multiserver.conf
===================================================================
Server.ConfDir = "@target.enhydra31.dir@/conf"
Server.LogFile = "@target.enhydra31.dir@/logs/multiserver.log"
Server.LogToFile[] = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, INFO
Server.LogToStderr[] = EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, INFO
Application.CactusTest.Description = "Cactus Test Web Application"
Application.CactusTest.DocRoot = "@full.target.enhydra31.dir@/webapps/test"
Application.CactusTest.Running = yes
Application.CactusTest.defaultSessionTimeOut = 30
Application.CactusTest.isInvokerEnabled = true
Application.CactusTest.isWARExpanded = false
Application.CactusTest.isWARValidated = false
Application.CactusTest.isWorkDirPersistent = false
Connection.HttpConn.Type = http
Connection.HttpConn.Port = @test.port@
Channel.HttpConn.CactusTestChannel.Enabled = yes
Channel.HttpConn.CactusTestChannel.Servlet = CactusTest
Channel.HttpConn.CactusTestChannel.Url = "/test"
1.1 jakarta-cactus/petals/ant/.cvsignore
Index: .cvsignore
===================================================================
build.properties
dist
target
ant.bat
1.1 jakarta-cactus/petals/ant/build.properties.sample
Index: build.properties.sample
===================================================================
# -----------------------------------------------------------------------------
# build.properties.sample
#
# This is an example "build.properties" file, used to customize building the
# Cactus Ant Petal for your local environment. Make any changes you need, and
# rename this file to "build.properties" in the same directory that contains the
# "build.xml" file.
#
# $Id: build.properties.sample,v 1.4 2002/12/26 13:11:50 cmlenz Exp $
# -----------------------------------------------------------------------------
# WARNING: The relative paths below are relative to the directory where the
# build.xml file is located.
# -----------------------------------------------------------------------------
# Mandatory properties
# -----------------------------------------------------------------------------
# Location of all jars. Note: This is not a mandatory property. It is only
# used here so that it can be reused when defining the location of all the jars
# below. You do not have to put all the external jars in a single location.
lib.repo = c:/apps/maven/repository
# Location of the Servlet API jar (it is needed because we want to copy it
# in the Cactus distribution).
servlet.jar = ${lib.repo}/servletapi/jars/servletapi-2.3.jar
# The location of the Commons Logging jar
commons.logging.jar = ${lib.repo}/commons-logging/jars/commons-logging-1.0.1.jar
# The location of the log4j jar
log4j.jar = ${lib.repo}/log4j/jars/log4j-1.2.6.jar
# The location of the Commons Httpclient jar
commons.httpclient.jar = ${lib.repo}/commons-httpclient/jars/commons-httpclient-2.0alpha2-20030103.jar
# The location of the Httpunit jar
httpunit.jar = ${lib.repo}/httpunit/jars/httpunit-1.4.5.jar
# The location of the AspectJ runtime jar
aspectjrt.jar = ${lib.repo}/aspectj/jars/aspectjrt-1.0.6.jar
# The location of the Junit jar
junit.jar = ${lib.repo}/junit/jars/junit-3.8.1.jar
# -----------------------------------------------------------------------------
# Optional properties
# -----------------------------------------------------------------------------
# Dependancies for Checkstyle code auditing
# If not specified here, the JARs must be present in ANTHOME/lib
antlr.jar = ${lib.repo}/antlr/jars/antlr-2.7.1.jar
checkstyle.jar = ${lib.repo}/checkstyle/jars/checkstyle-2.4.jar
commons-beanutils.jar = ${lib.repo}/commons-beanutils/jars/commons-beanutils-1.5.jar
commons-collections.jar = ${lib.repo}/commons-collections/jars/commons-collections-2.1.jar
regexp.jar = ${lib.repo}/regexp/jars/regexp-1.2.jar
1.1 jakarta-cactus/petals/ant/build.xml
Index: build.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE project [
<!ENTITY common SYSTEM "file:../../common.xml">
]>
<!--
=============================================================================
Build file for the Cactus Ant Petal project.
This script should be started with the following command line :
ant <target>
Run "ant -projecthelp" to get a list of available targets. The default
target is "dist"
Note: basedir points to the main Cactus directory in order to have the same
base dir for all Cactus subprojects and thus be able to share
relative paths.
=============================================================================
-->
<project name="Cactus Ant Petal" default="dist" basedir="../..">
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
<property file="${basedir}/petals/ant/build.properties" />
<property file="${basedir}/build.properties" />
<property file="${user.home}/build.properties" />
<!-- Global project properties -->
<property name="project.name.text" value="Cactus Ant Petal"/>
<property name="project.name.file" value="cactus-petal-ant"/>
<property name="project.version" value="1.5dev"/>
<!-- Prefix to add to all distributable files -->
<property name="project.prefix" value="jakarta-"/>
<!--
========================================================================
Default values for properties not defined in build.properties or in
a higher level calling Ant script
========================================================================
-->
<property name="year" value="2000-2003"/>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
<!-- The location of the Cactus custom Ant tasks jar -->
<property name="cactus.ant.jar" value="anttasks/dist/lib/cactus-ant.jar"/>
<!--
========================================================================
Base directory for all file related operations
========================================================================
-->
<property name="base.dir" location="petals/ant"/>
<!--
========================================================================
Set the properties related to the source tree.
Note: These properties are defined in a target as some need the
j2ee.api property to be set
========================================================================
-->
<target name="properties.source">
<property name="src.dir" location="${base.dir}/src"/>
<property name="src.java.dir" location="${src.dir}/java"/>
<property name="src.script.dir" location="${src.dir}/scripts"/>
<property name="src.conf.dir" location="${src.dir}/confs"/>
<property name="build.dir" location="${base.dir}/."/>
<!-- The location of the web files generated by the Cactus framework
(i.e. the JSP Redirector) -->
<property name="cactus.framework.web"
value="framework/dist-${j2ee.api}/web"/>
<!-- The location of the Cactus framework jar -->
<property name="cactus.framework.jar"
value="framework/dist-${j2ee.api}/lib/cactus.jar"/>
</target>
<!--
========================================================================
Set the properties related to the target tree
Note: These properties are defined in a target as some need the
j2ee.api property to be set
========================================================================
-->
<target name="properties.target">
<property name="target.dir" location="${base.dir}/target"/>
<property name="target.classes.dir" location="${target.dir}/classes"/>
<property name="target.classes.java.dir"
location="${target.classes.dir}/java"/>
<property name="target.doc.dir" location="${target.dir}/doc"/>
<property name="target.doc.api.dir" location="${target.doc.dir}/api"/>
<property name="target.test.dir" location="${target.dir}/test/tomcat4x"/>
</target>
<!--
========================================================================
Set the properties related to the distribution tree
Note: These properties are defined in a target as some need the
j2ee.api property to be set
========================================================================
-->
<target name="properties.distribution">
<property name="dist.dir" location="${base.dir}/dist"/>
<property name="dist.lib.dir" location="${dist.dir}/lib"/>
<property name="dist.lib.client.dir" location="${dist.lib.dir}/client"/>
<property name="dist.lib.server.dir" location="${dist.lib.dir}/server"/>
<property name="dist.lib.common.dir" location="${dist.lib.dir}/common"/>
<property name="dist.doc.dir" location="${dist.dir}/doc"/>
<property name="dist.doc.api.dir" location="${dist.doc.dir}/api"/>
<property name="dist.script.dir" location="${dist.dir}/scripts"/>
<property name="dist.conf.dir" location="${dist.dir}/confs"/>
</target>
<!--
========================================================================
Names of deliverables
========================================================================
-->
<!-- The Ant Petal jar and helper classes -->
<property name="antpetal.jar.name" value="${project.name.file}"/>
<!-- The global Ant Petal zip -->
<property name="antpetal.zip.name" value="${project.name.file}"/>
<!--
========================================================================
Include common targets and properties
========================================================================
-->
&common;
<!--
========================================================================
Display configurable properties values
========================================================================
-->
<target name="display.properties">
<echo>----- ${project.name.text} ${project.version} -----</echo>
<echo></echo>
<echo>java.class.path = ${java.class.path}"</echo>
<echo></echo>
<echo>java.home = ${java.home}</echo>
<echo>user.home = ${user.home}</echo>
<echo>ant.home = ${ant.home}</echo>
<echo></echo>
</target>
<!--
========================================================================
Verify that all mandatory properties have been set
========================================================================
-->
<target name="check.properties">
<taskdef name="checkProperty" classname="org.apache.cactus.ant.CheckPropertiesTask">
<classpath>
<pathelement location="${cactus.ant.jar}"/>
</classpath>
</taskdef>
<checkProperty>
<property name="servlet.jar" isfile="true"/>
<property name="aspectjrt.jar" isfile="true"/>
<property name="commons.logging.jar" isfile="true"/>
<property name="commons.httpclient.jar" isfile="true"/>
<property name="junit.jar" isfile="true"/>
<property name="httpunit.jar" isfile="true"/>
<property name="log4j.jar" isfile="true"/>
</checkProperty>
</target>
<!--
========================================================================
Find out the J2EE API version
========================================================================
-->
<target name="check.j2ee.version">
<condition property="j2ee.api" value="13">
<available classname="javax.servlet.Filter">
<classpath>
<pathelement location="${servlet.jar}"/>
</classpath>
</available>
</condition>
<condition property="j2ee.api" value="12">
<available classname="javax.servlet.Servlet">
<classpath>
<pathelement location="${servlet.jar}"/>
</classpath>
</available>
</condition>
<fail message="Unsupported J2EE version" unless="j2ee.api"/>
<echo message="j2ee.api = ${j2ee.api}"/>
</target>
<!--
========================================================================
Load all dynamic properties
========================================================================
-->
<target name="load.properties"
depends="check.j2ee.version,properties.source,properties.target,properties.distribution"/>
<!--
========================================================================
Initialize the build. Must be called by all targets
========================================================================
-->
<target name="init"
depends="display.properties,check.properties,load.properties">
<tstamp/>
</target>
<!--
========================================================================
Compiles the sources
========================================================================
-->
<target name="compile" depends="init" description="Compile the sources">
<mkdir dir="${target.classes.java.dir}"/>
<javac srcdir="${src.java.dir}" destdir="${target.classes.java.dir}"
deprecation="${deprecation}" optimize="${optimize}"/>
</target>
<!--
========================================================================
Create the runtime jar file
========================================================================
-->
<target name="jar" depends="compile" description="Generate the petal jar">
<jar jarfile="${target.dir}/${antpetal.jar.name}.jar">
<manifest>
<section name="org/apache/cactus/petal/ant/">
<attribute name="Specification-Title"
value="${project.name.text}"/>
<attribute name="Specification-Version"
value="${project.version}"/>
<attribute name="Specification-Vendor"
value="Apache Software Foundation"/>
<attribute name="Implementation-Title"
value="${project.name.file}"/>
<attribute name="Implementation-Version"
value="${project.version} ${TODAY}"/>
<attribute name="Implementation-Vendor"
value="Apache Software Foundation"/>
</section>
</manifest>
<metainf dir=".">
<include name="LICENSE.cactus"/>
</metainf>
<fileset dir="${target.classes.java.dir}"/>
</jar>
</target>
<!--
========================================================================
Generate the documentation (javadoc)
========================================================================
-->
<target name="doc.check"
depends="init">
<uptodate property="doc.uptodate"
targetfile="${target.doc.api.dir}/index.html">
<srcfiles dir="${src.java.dir}"
includes="**/*.java, **/*.html"/>
</uptodate>
</target>
<target name="doc"
depends="doc.check"
unless="doc.uptodate"
description="Generates the API documentation">
<mkdir dir="${target.doc.api.dir}"/>
<javadoc
sourcepath="${src.java.dir}"
packagenames="org.apache.cactus.petal.ant.*"
destdir="${target.doc.api.dir}"
author="true"
public="true"
version="true"
use="true"
windowtitle="${project.name.text} ${project.version}"
doctitle="${project.name.text} ${project.version}"
bottom="Copyright &copy; ${year} Apache Software Foundation.
All Rights Reserved.">
</javadoc>
</target>
<!--
========================================================================
Generate the distributable files
========================================================================
-->
<target name="dist" depends="jar,doc,checkstyle"
description="Generate the distributable files">
<mkdir dir="${dist.lib.client.dir}"/>
<mkdir dir="${dist.lib.server.dir}"/>
<mkdir dir="${dist.lib.common.dir}"/>
<mkdir dir="${dist.script.dir}"/>
<mkdir dir="${dist.conf.dir}"/>
<!-- Gather all server side Cactus jars -->
<!-- (None at the moment) -->
<!-- Gather all client side Cactus jars -->
<copy tofile="${dist.lib.client.dir}/${antpetal.jar.name}-${project.version}.jar"
file="${target.dir}/${antpetal.jar.name}.jar"/>
<copy todir="${dist.lib.dir}/client" file="${servlet.jar}"/>
<copy todir="${dist.lib.dir}/client" file="${commons.httpclient.jar}"/>
<copy todir="${dist.lib.dir}/client" file="${httpunit.jar}"/>
<!-- Gather all shared (client and server) Cactus jars -->
<copy tofile="${dist.lib.common.dir}/cactus-${project.version}.jar"
file="${cactus.framework.jar}"/>
<copy todir="${dist.lib.common.dir}" file="${commons.logging.jar}"/>
<copy todir="${dist.lib.common.dir}" file="${log4j.jar}"/>
<copy todir="${dist.lib.common.dir}" file="${aspectjrt.jar}"/>
<copy todir="${dist.lib.common.dir}" file="${junit.jar}"/>
<!-- Copy the scripts for the current J2EE API -->
<filter token="cactus.petal.ant.jar.name"
value="${antpetal.jar.name}-${project.version}.jar"/>
<filter token="cactus.framework.jar.name"
value="cactus-${project.version}.jar"/>
<basename property="log4j.jar.name" file="${log4j.jar}"/>
<filter token="log4j.jar.name" value="${log4j.jar.name}"/>
<basename property="aspectjrt.jar.name" file="${aspectjrt.jar}"/>
<filter token="aspectjrt.jar.name" value="${aspectjrt.jar.name}"/>
<basename property="commons.logging.jar.name" file="${commons.logging.jar}"/>
<filter token="commons.logging.jar.name" value="${commons.logging.jar.name}"/>
<basename property="junit.jar.name" file="${junit.jar}"/>
<filter token="junit.jar.name" value="${junit.jar.name}"/>
<basename property="commons.httpclient.jar.name" file="${commons.httpclient.jar}"/>
<filter token="commons.httpclient.jar.name" value="${commons.httpclient.jar.name}"/>
<basename property="httpunit.jar.name" file="${httpunit.jar}"/>
<filter token="httpunit.jar.name" value="${httpunit.jar.name}"/>
<copy todir="${dist.script.dir}" filtering="on">
<fileset dir="${src.script.dir}/share"/>
<fileset dir="${src.script.dir}/j2ee${j2ee.api}">
<exclude name="build.xml"/>
</fileset>
</copy>
<copy todir="${dist.dir}"
file="${src.script.dir}/j2ee${j2ee.api}/build.xml"/>
<!-- Copy the confs for the current J2EE API -->
<copy todir="${dist.conf.dir}">
<fileset dir="${src.conf.dir}/share"/>
<fileset dir="${src.conf.dir}/j2ee${j2ee.api}"/>
</copy>
<!-- Copy the JSP Redirector -->
<copy todir="${dist.conf.dir}"
file="${cactus.framework.web}/jspRedirector.jsp"/>
</target>
<!--
========================================================================
Clean generated files (including distributables)
========================================================================
-->
<target name="clean" depends="load.properties"
description="Clean all generated files">
<delete dir="${target.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<!--
========================================================================
Perform a code audit using CheckStyle.
========================================================================
-->
<target name="checkstyle"
depends="init, init.checkstyle"
if="checkstyle.available"
description="Perform a code audit using Checkstyle">
<mkdir dir="${target.dir}"/>
<checkstyle config="./checkstyle.xml"
failOnViolation="false">
<fileset dir="${src.java.dir}">
<include name="**/*.java"/>
</fileset>
<formatter type="plain"/>
<formatter type="xml"
toFile="${target.dir}/checkstyle_results.xml"/>
<property key="checkstyle.header.file" file="./LICENSE.cactus"/>
</checkstyle>
</target>
</project>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/weblogic51/weblogic.policy
Index: weblogic.policy
===================================================================
grant {
permission java.security.AllPermission;
};
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/weblogic51/weblogic.properties
Index: weblogic.properties
===================================================================
weblogic.system.listenPort=@test.port@
# Define the test webapp
weblogic.httpd.webApp.test=@target.wlinstance.dir@/test
#-------------------------------------------------------------------------------
# Properties below are needed to have a functionning servlet engine
#-------------------------------------------------------------------------------
# No access.log file generated
weblogic.httpd.enableLogFile=true
# this property need to exist but the password can be anything
weblogic.password.system=password
# some security stuff
weblogic.allow.execute.weblogic.servlet=everyone
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
<init-param>
<param-name>param1</param-name>
<param-value>value1 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>ServletRedirectorSecure</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet>
<servlet-name>ServletRedirector_TestOverride</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
<init-param>
<param-name>param2</param-name>
<param-value>value2 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>JspRedirector</servlet-name>
<jsp-file>/jspRedirector.jsp</jsp-file>
<init-param>
<param-name>param1</param-name>
<param-value>value1 used for testing</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>TestJsp</servlet-name>
<jsp-file>/test/test.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletRedirector_TestOverride</servlet-name>
<url-pattern>/ServletRedirectorOverride</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletRedirectorSecure</servlet-name>
<url-pattern>/ServletRedirectorSecure</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JspRedirector</servlet-name>
<url-pattern>/JspRedirector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TestJsp</servlet-name>
<url-pattern>/TestJsp</url-pattern>
</servlet-mapping>
<!-- Authentication -->
<security-constraint>
<web-resource-collection>
<web-resource-name>SecurityRestriction</web-resource-name>
<description>Protect the Cactus redirector servlet.</description>
<url-pattern>/ServletRedirectorSecure</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<description>Authorized Users Group</description>
<role-name>test</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<description>Test role</description>
<role-name>test</role-name>
</security-role>
<!-- End Authentication -->
</web-app>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/tomcat33/server.xml
Index: server.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>
<ContextManager workDir="work">
<!-- ==================== Global modules ==================== -->
<LogEvents enabled="false" />
<AutoDeploy source="webapps" target="webapps" />
<AutoWebApp dir="webapps" host="DEFAULT" />
<SimpleMapper1 />
<SessionExpirer checkInterval="60" />
<SessionIdGenerator randomClass="java.util.Random"
randomFile="/dev/urandom" />
<!-- ========== context processing modules ========== -->
<!-- This will be the "default" profile
( all except the "global" modules can be set per context )
-->
<LogSetter name="servlet_log"
timestamps="true"
verbosityLevel = "INFORMATION"
path="servlet-${yyyyMMdd}.log"
/>
<LogSetter name="JASPER_LOG"
timestamps="true"
path="jasper-${yyyyMMdd}.log"
verbosityLevel = "INFORMATION" />
<LoaderInterceptor11 useApplicationLoader="true" />
<WebXmlReader validate="true" />
<ErrorHandler showDebugInfo="true" />
<WorkDirSetup cleanWorkDir="false" />
<Jdk12Interceptor />
<!-- Non-standard invoker, for backward compat. ( /servlet/* ) -->
<InvokerInterceptor />
<!-- you can add javaCompiler="jikes" -->
<JspInterceptor keepGenerated="true"
largeFile="false"
sendErrToClient="true"
useJspServlet="false"
/>
<StaticInterceptor debug="0" listings="true" />
<ReloadInterceptor fullReload="true" />
<SimpleSessionStore maxActiveSessions="-1" />
<AccessInterceptor />
<CredentialsInterceptor />
<SimpleRealm filename="conf/tomcat-users.xml" />
<LoadOnStartupInterceptor />
<Servlet22Interceptor />
<!-- Request processing -->
<DecodeInterceptor debug="0" />
<SessionId cookiesFirst="true" noCookies="false" />
<!-- ==================== Connectors ==================== -->
<!-- new http adapter. Attributes:
secure - use SSL ( https )
keystore, keypass - certs for SSL
port -->
<Http10Connector port="@test.port@"
secure="false"
maxThreads="100"
maxSpareThreads="50"
minSpareThreads="10" />
<!-- Note: we use a port different from the standard one (8007) not
to interfere with an other running tomcat -->
<Ajp12Connector port="8777" />
</ContextManager>
</Server>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/tomcat33/tomcat-users.xml
Index: tomcat-users.xml
===================================================================
<tomcat-users>
<user name="testuser" password="testpassword" roles="test" />
</tomcat-users>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/tomcat33/modules.xml
Index: modules.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<modules>
<module name="JNIConnectionHandler" javaClass="org.apache.tomcat.modules.server.JNIConnectionHandler"/>
<module name="WorkDirSetup" javaClass="org.apache.tomcat.modules.config.WorkDirSetup"/>
<module name="PathSetter" javaClass="org.apache.tomcat.modules.config.PathSetter"/>
<module name="ApacheConfig" javaClass="org.apache.tomcat.modules.config.ApacheConfig"/>
<module name="JservConfig" javaClass="org.apache.tomcat.modules.config.JservConfig"/>
<module name="PolicyLoader" javaClass="org.apache.tomcat.modules.config.PolicyLoader"/>
<module name="AutoWebApp" javaClass="org.apache.tomcat.modules.config.AutoWebApp"/>
<module name="Http10Interceptor" javaClass="org.apache.tomcat.modules.server.Http10Interceptor"/>
<module name="Http10Connector" javaClass="org.apache.tomcat.modules.server.Http10Interceptor"/>
<module name="JniConnector" javaClass="org.apache.tomcat.modules.server.JNIConnectionHandler"/>
<module name="Ajp12Connector" javaClass="org.apache.tomcat.modules.server.Ajp12Interceptor"/>
<module name="Ajp13Connector" javaClass="org.apache.tomcat.modules.server.Ajp13Interceptor"/>
<module name="NSConfig" javaClass="org.apache.tomcat.modules.config.NSConfig"/>
<module name="IISConfig" javaClass="org.apache.tomcat.modules.config.IISConfig"/>
<module name="AutoDeploy" javaClass="org.apache.tomcat.modules.config.AutoDeploy"/>
<module name="ServerXmlReader" javaClass="org.apache.tomcat.modules.config.ServerXmlReader"/>
<module name="LoaderInterceptor11" javaClass="org.apache.tomcat.modules.config.LoaderInterceptor11"/>
<module name="ContextXmlReader" javaClass="org.apache.tomcat.modules.config.ContextXmlReader"/>
<module name="LogSetter" javaClass="org.apache.tomcat.modules.config.LogSetter"/>
<module name="SimpleSessionStore" javaClass="org.apache.tomcat.modules.session.SimpleSessionStore"/>
<module name="SessionIdGenerator" javaClass="org.apache.tomcat.modules.session.SessionIdGenerator"/>
<module name="SessionExpirer" javaClass="org.apache.tomcat.modules.session.SessionExpirer"/>
<module name="SessionId" javaClass="org.apache.tomcat.modules.session.SessionId"/>
<module name="AccountingInterceptor" javaClass="org.apache.tomcat.modules.loggers.AccountingInterceptor"/>
<module name="LogEvents" javaClass="org.apache.tomcat.modules.loggers.LogEvents"/>
<module name="SimpleRealm" javaClass="org.apache.tomcat.modules.aaa.SimpleRealm"/>
<module name="JDBCRealm" javaClass="org.apache.tomcat.modules.aaa.JDBCRealm"/>
<module name="CredentialsInterceptor" javaClass="org.apache.tomcat.modules.aaa.CredentialsInterceptor"/>
<module name="AccessInterceptor" javaClass="org.apache.tomcat.modules.aaa.AccessInterceptor"/>
<module name="AccessLogInterceptor" javaClass="org.apache.tomcat.modules.loggers.AccessLogInterceptor"/>
<module name="InvokerInterceptor" javaClass="org.apache.tomcat.modules.generators.InvokerInterceptor"/>
<module name="ErrorHandler" javaClass="org.apache.tomcat.modules.generators.ErrorHandler"/>
<module name="Jdk12Interceptor" javaClass="org.apache.tomcat.modules.generators.Jdk12Interceptor"/>
<module name="StaticInterceptor" javaClass="org.apache.tomcat.modules.generators.StaticInterceptor"/>
<module name="ReloadInterceptor" javaClass="org.apache.tomcat.modules.mappers.ReloadInterceptor"/>
<module name="DecodeInterceptor" javaClass="org.apache.tomcat.modules.mappers.DecodeInterceptor"/>
<module name="SimpleMapper1" javaClass="org.apache.tomcat.modules.mappers.SimpleMapper1"/>
<module name="WebXmlReader" javaClass="org.apache.tomcat.facade.WebXmlReader"/>
<module name="JspInterceptor" javaClass="org.apache.tomcat.facade.JspInterceptor"/>
<module name="Servlet22Interceptor" javaClass="org.apache.tomcat.facade.Servlet22Interceptor"/>
<module name="LoadOnStartupInterceptor" javaClass="org.apache.tomcat.facade.LoadOnStartupInterceptor"/>
<module name="ProfileLoader" javaClass="org.apache.tomcat.config.ProfileLoader"/>
<module name="TagPoolManagerInterceptor" javaClass="org.apache.tomcat.facade.TagPoolManagerInterceptor"/>
<module name="TrustedLoader" javaClass="org.apache.tomcat.modules.config.TrustedLoader"/>
</modules>
1.1 jakarta-cactus/petals/ant/src/confs/share/tomcat4x/server.xml
Index: server.xml
===================================================================
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Standalone">
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="@cactus.port@" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<Engine name="Standalone" defaultHost="localhost" debug="0">
<Realm className="org.apache.catalina.realm.MemoryRealm" />
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
</Host>
</Engine>
</Service>
</Server>
1.1 jakarta-cactus/petals/ant/src/confs/share/tomcat4x/tomcat-users.xml
Index: tomcat-users.xml
===================================================================
<tomcat-users>
<user name="testuser" password="testpassword" roles="test" />
</tomcat-users>
1.1 jakarta-cactus/petals/ant/src/confs/share/log_server.properties
Index: log_server.properties
===================================================================
# Properties for configuring Log4j
# This is the configuring for logging on the server side
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = cactus_server.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n
# Any application log which uses Log4J will be logged to the Cactus log file
log4j.rootCategory=DEBUG, cactus
# By default we don't log at the DEBUG level for Cactus log, in order not to generate too
# many logs. However, should a problem arise and logs need to be sent to the Cactus dev team,
# then we will ask you to change this to DEBUG.
log4j.category.org.apache.cactus = WARN, cactus
log4j.additivity.org.apache.cactus=false
1.1 jakarta-cactus/petals/ant/src/confs/share/log_client.properties
Index: log_client.properties
===================================================================
# Properties for configuring Log4j
# This is the configuring for logging on the JUnit side (i.e. the client side)
log4j.appender.cactus = org.apache.log4j.FileAppender
log4j.appender.cactus.File = cactus_client.log
log4j.appender.cactus.Append = false
log4j.appender.cactus.layout = org.apache.log4j.PatternLayout
log4j.appender.cactus.layout.ConversionPattern = %d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n
# Any application log which uses Log4J will be logged to the Cactus log file
log4j.rootCategory=DEBUG, cactus
# By default we don't log at the DEBUG level for Cactus log, in order not to generate too
# many logs. However, should a problem arise and logs need to be sent to the Cactus dev team,
# then we will ask you to change this to DEBUG.
log4j.category.org.apache.cactus = WARN, cactus
log4j.additivity.org.apache.cactus=false
# Don't show debug logs for HttpClient
log4j.category.org.apache.commons.httpclient = WARN, cactus
log4j.additivity.org.apache.commons.httpclient=false
log4j.category.httpclient = WARN, cactus
log4j.additivity.httpclient=false
1.1 jakarta-cactus/petals/ant/src/confs/j2ee13/jboss3x/users.properties
Index: users.properties
===================================================================
testuser=testpassword
admin=admin
1.1 jakarta-cactus/petals/ant/src/confs/j2ee13/jboss3x/jboss-web.xml
Index: jboss-web.xml
===================================================================
<jboss-web>
<security-domain>java:/jaas/other</security-domain>
</jboss-web>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee13/jboss3x/roles.properties
Index: roles.properties
===================================================================
testuser=test
admin=JBossAdmin
1.1 jakarta-cactus/petals/ant/src/scripts/share/build-tests-tomcat-40.xml
Index: build-tests-tomcat-40.xml
===================================================================
<!-- Global properties -->
<property name="conf.tomcat4x.dir" value="${conf.dir}/tomcat4x"/>
<property name="cactus.target.tomcat4x" value="${cactus.target.dir}/tomcat4x"/>
<!--
========================================================================
Run Tomcat 4.x tests
========================================================================
-->
<target name="cactus.run.tomcat4x"
depends="cactus.init,cactus.setup.tomcat4x,cactus.war,cactus.deploy.tomcat4x"
if="cactus.home.tomcat4x" description="Run tests on Tomcat 4.x">
<!-- Start the servlet engine, wait for it to be started, run the
unit tests, stop the servlet engine, wait for it to be stopped.
The servlet engine is stopped if the tests fail for any reason -->
<runservertests
testURL="http://localhost:${cactus.port}/test/ServletRedirector?Cactus_Service=RUN_TEST"
startTarget="cactus.start.tomcat4x"
stopTarget="cactus.stop.tomcat4x"
testTarget="cactus.test"/>
</target>
<!--
========================================================================
Start Tomcat 4.x
========================================================================
-->
<target name="cactus.start.tomcat4x" description="Start Tomcat 4.x"
depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x">
<java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
<jvmarg value="-Dcatalina.home=${cactus.home.tomcat4x}"/>
<jvmarg value="-Dcatalina.base=${cactus.target.tomcat4x}"/>
<arg value="start"/>
<classpath>
<!-- These are ignored if -Dbuild.sysclasspath=only is used -->
<pathelement path="${java.home}/../lib/tools.jar"/>
<fileset dir="${cactus.home.tomcat4x}">
<include name="bin/bootstrap.jar"/>
</fileset>
</classpath>
</java>
</target>
<!--
========================================================================
Stop Tomcat 4.x
========================================================================
-->
<target name="cactus.stop.tomcat4x" description="Stop Tomcat 4.x"
depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x">
<java classname="org.apache.catalina.startup.Bootstrap" fork="yes">
<jvmarg value="-Dcatalina.home=${cactus.home.tomcat4x}"/>
<jvmarg value="-Dcatalina.base=${cactus.target.tomcat4x}"/>
<arg value="stop"/>
<classpath>
<!-- These are ignored if -Dbuild.sysclasspath=only is used
(this is the case for Gump builds) -->
<fileset dir="${cactus.home.tomcat4x}">
<include name="bin/bootstrap.jar"/>
</fileset>
</classpath>
</java>
</target>
<!--
========================================================================
Display a warning message if the needed servlet engine home property
is not set
========================================================================
-->
<target name="cactus.check.tomcat4x" unless="cactus.home.tomcat4x">
<echo message=""/>
<echo message="******************************************************"/>
<echo message="WARNING : The 'cactus.home.tomcat4x' property has not"/>
<echo message="been set. No test will be run on that servlet engine."/>
<echo message="******************************************************"/>
<echo message=""/>
</target>
<!--
========================================================================
Deploy the cactified webapp
========================================================================
-->
<target name="cactus.deploy.tomcat4x"
description="Deploy the webapp on Tomcat 4.x">
<!-- Copy the webapp -->
<copy todir="${cactus.target.tomcat4x}/webapps/test">
<fileset dir="${cactus.target.dir}/test"/>
</copy>
</target>
<!--
========================================================================
Set up a valid Tomcat 4.x directory structure in the
cactus.target.tomcat4x directory.
========================================================================
-->
<target name="cactus.setup.tomcat4x"
depends="cactus.check.tomcat4x" if="cactus.home.tomcat4x"
description="Set up a Tomcat 4.x directory structure">
<!-- Create work and conf directories and copy configuration files -->
<mkdir dir="${cactus.target.tomcat4x}/conf"/>
<mkdir dir="${cactus.target.tomcat4x}/work"/>
<mkdir dir="${cactus.target.tomcat4x}/webapps"/>
<!-- Delete some config file so that they will be copied every time -->
<delete file="${cactus.target.tomcat4x}/conf/server.xml"/>
<!-- Remove the auto deployed webapp so that it is redeployed every
time -->
<delete dir="${cactus.target.tomcat4x}/webapps/test"/>
<copy todir="${cactus.target.tomcat4x}/conf" filtering="on">
<fileset dir="${conf.tomcat4x.dir}"/>
</copy>
<!-- Copy the Tomcat web.xml - We need to copy this file as it has
changed between Tomcat 4.x versions and one version of it doesn't
work with another version of Tomcat 4 -->
<copy file="${cactus.home.tomcat4x}/conf/web.xml"
todir="${cactus.target.tomcat4x}/conf"/>
</target>
1.1 jakarta-cactus/petals/ant/src/scripts/share/build-share.xml
Index: build-share.xml
===================================================================
<!-- Global properties -->
<!-- Default port on which to start the containers -->
<property name="cactus.port" value="8080"/>
<!-- Tmp dir used by Cactus for its operations -->
<property name="cactus.target.dir" value="target"/>
<!-- Default Cactus test files to include in the test -->
<property name="cactus.src.includes" value="**/*Test*.java"/>
<!-- Default Cactus test files to exclude from the test -->
<property name="cactus.src.excludes" value="**/AllTests.java"/>
<!-- Default classpath for the Cactus client side -->
<path id="cactus.classpath">
<pathelement path="${java.class.path}"/>
</path>
<!--
========================================================================
Set the properties related to the source tree.
========================================================================
-->
<property name="conf.dir" value="confs"/>
<property name="lib.dir" value="lib"/>
<property name="lib.client.dir" value="${lib.dir}/client"/>
<property name="lib.server.dir" value="${lib.dir}/server"/>
<property name="lib.common.dir" value="${lib.dir}/common"/>
<property name="script.dir" value="scripts"/>
<property name="target.classes.dir" value="${cactus.target.dir}/classes"/>
<!-- Cactus related jar locations -->
<property name="cactus.petal.ant.jar"
value="${lib.client.dir}/@cactus.petal.ant.jar.name@"/>
<property name="cactus.framework.jar"
value="${lib.common.dir}/@cactus.framework.jar.name@"/>
<property name="log4j.jar"
value="${lib.common.dir}/@log4j.jar.name@"/>
<property name="aspectjrt.jar"
value="${lib.common.dir}/@aspectjrt.jar.name@"/>
<property name="commons.logging.jar"
value="${lib.common.dir}/@commons.logging.jar.name@"/>
<property name="junit.jar"
value="${lib.common.dir}/@junit.jar.name@"/>
<property name="commons.httpclient.jar"
value="${lib.client.dir}/@commons.httpclient.jar.name@"/>
<property name="httpunit.jar"
value="${lib.client.dir}/@httpunit.jar.name@"/>
<!--
========================================================================
Initialize the build. Must be called by all targets
========================================================================
-->
<target name="cactus.init">
<!-- Filters -->
<filter token="cactus.port" value="${cactus.port}"/>
<!-- Initialize Cactus custom Ant task needed for running the server
tests -->
<taskdef name="runservertests"
classname="org.apache.cactus.petal.ant.RunServerTestsTask">
<classpath>
<pathelement location="${cactus.petal.ant.jar}"/>
</classpath>
</taskdef>
</target>
<!--
========================================================================
Compile the Cactus tests.
========================================================================
-->
<target name="cactus.compile" description="Compile the Cactus tests">
<mkdir dir="${target.classes.dir}"/>
<javac destdir="${target.classes.dir}" srcdir="${cactus.src.dir}">
<classpath>
<pathelement location="${cactus.framework.jar}"/>
<pathelement location="${log4j.jar}"/>
<pathelement location="${aspectjrt.jar}"/>
<pathelement location="${commons.logging.jar}"/>
<pathelement location="${junit.jar}"/>
<path refid="cactus.classpath"/>
</classpath>
</javac>
</target>
<!--
========================================================================
Cactifify a plain war (pointed to by the cactus.war property).
========================================================================
-->
<target name="cactus.war" depends="cactus.compile"
description="Cactify the war">
<unwar src="${cactus.war}" dest="${cactus.target.dir}/test"/>
<!-- TODO: Perform a web.xml merge -->
<!-- Copy the Cactus web.xml -->
<copy todir="${cactus.target.dir}/test/WEB-INF">
<fileset dir="${conf.dir}">
<include name="web.xml"/>
</fileset>
</copy>
<!-- Copy the Cactus test classes -->
<copy todir="${cactus.target.dir}/test/WEB-INF/classes">
<fileset dir="${target.classes.dir}">
<include name="**/*.class"/>
</fileset>
</copy>
<!-- Copy the Cactus jars -->
<copy todir="${cactus.target.dir}/test/WEB-INF/lib">
<fileset dir="${lib.server.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib.common.dir}">
<include name="*.jar"/>
</fileset>
</copy>
<!-- Copy the JSP Redirector -->
<copy todir="${cactus.target.dir}/test">
<fileset dir="${conf.dir}">
<include name="jspRedirector.jsp"/>
</fileset>
</copy>
</target>
<!--
========================================================================
Trigger the Cactus test by running a JUnit Test Runner
========================================================================
-->
<target name="cactus.test">
<junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
fork="yes">
<jvmarg value="-Dcactus.contextURL=http://localhost:${cactus.port}/test"/>
<classpath>
<pathelement location="${target.classes.dir}"/>
<pathelement location="${cactus.framework.jar}"/>
<pathelement location="${log4j.jar}"/>
<pathelement location="${aspectjrt.jar}"/>
<pathelement location="${commons.logging.jar}"/>
<pathelement location="${junit.jar}"/>
<path refid="cactus.classpath"/>
<pathelement location="${commons.httpclient.jar}"/>
<pathelement location="${httpunit.jar}"/>
</classpath>
<formatter type="plain" usefile="false"/>
<!-- TODO: Automatically discover Cactus tests -->
<batchtest>
<fileset dir="${cactus.src.dir}"
includes="${cactus.src.includes}"
excludes="${cactus.src.excludes}"/>
</batchtest>
</junit>
</target>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee12/resin12/resin.conf
Index: resin.conf
===================================================================
<caucho.com>
<http-server>
<app-dir>.</app-dir>
<http port='@test.port@'/>
<host id=''>
<war-dir id='.'/>
</host>
</http-server>
</caucho.com>
1.1 jakarta-cactus/petals/ant/src/scripts/j2ee13/build.xml
Index: build.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE project [
<!ENTITY build-share SYSTEM "file:./scripts/build-share.xml">
<!ENTITY build-tests-tomcat-40 SYSTEM "file:./scripts/build-tests-tomcat-40.xml">
<!--
<!ENTITY build-tests-resin-20 SYSTEM "file:./scripts/build-tests-resin-20.xml">
<!ENTITY build-tests-resin-13 SYSTEM "file:./scripts/build-tests-resin-13.xml">
<!ENTITY build-tests-orion-14 SYSTEM "file:./scripts/build-tests-orion-14.xml">
<!ENTITY build-tests-orion-15 SYSTEM "file:./scripts/build-tests-orion-15.xml">
<!ENTITY build-tests-orion-16 SYSTEM "file:./scripts/build-tests-orion-16.xml">
<!ENTITY build-tests-weblogic-61 SYSTEM "file:./scripts/build-tests-weblogic-61.xml">
<!ENTITY build-tests-weblogic-70 SYSTEM "file:./scripts/build-tests-weblogic-70.xml">
<!ENTITY build-tests-jboss-3x SYSTEM "file:./scripts/build-tests-jboss-3x.xml">
-->
]>
<!--
=============================================================================
Generic build file for executing Cactus tests. This Ant script is expected
to be called from another Ant script, using the <ant> task.
The following Ant properties need to be passed to this script:
cactus.home.[container] Location where the container is installed
cactus.port [OPTIONAL] Port on which to start the
containers (Default is 8080)
cactus.target.dir [OPTIONAL] Tmp directory for Cactus
operations
cactus.war Location of the war to cactify
cactus.src.dir Location of Cactus java source files
cactus.src.includes [OPTIONAL] List of Cactus java test files
to include in the test. Defaults to
"**/*Test*.java".
cactus.src.excludes [OPTIONAL] List of Cactus java test files
to exclude in the test. Defaults to
"**/AllTests.java".
The following Ant references need to be passed to this script:
cactus.classpath [OPTIONAL] The classpath reference for
running junit on the client side. Only
needed if special jars need to be on the
classpath
=============================================================================
-->
<project name="Cactus Executor" default="cactus.init" basedir=".">
&build-share;
&build-tests-tomcat-40;
<!--
&build-tests-resin-20;
&build-tests-resin-13;
&build-tests-orion-14;
&build-tests-orion-15;
&build-tests-orion-16;
&build-tests-weblogic-61;
&build-tests-weblogic-70;
&build-tests-jboss-3x;
-->
</project>
1.1 jakarta-cactus/petals/ant/src/confs/j2ee13/resin13/resin.conf
Index: resin.conf
===================================================================
<caucho.com>
<http-server>
<app-dir>.</app-dir>
<http port='@test.port@'/>
<host id=''>
<war-dir id='.'/>
</host>
</http-server>
</caucho.com>
1.1 jakarta-cactus/petals/ant/src/confs/share/resin20/resin.conf
Index: resin.conf
===================================================================
<caucho.com>
<http-server>
<app-dir>.</app-dir>
<http port='@test.port@'/>
<host id=''>
<authenticator class-name='com.caucho.http.security.XmlAuthenticator'>
<init-param user='testuser:testpassword:test'/>
</authenticator>
<war-dir id='.'/>
</host>
</http-server>
</caucho.com>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>