You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/01/26 21:12:33 UTC
cvs commit: jakarta-tomcat/src/tests/webpages/WEB-INF/classes/calendar Serialize.java
costin 00/01/26 12:12:33
Modified: . build.xml
src/share/org/apache/tomcat/context WarInterceptor.java
src/share/org/apache/tomcat/shell Constants.java
src/share/org/apache/tomcat/shell/deployment Config.java
ContextConfig.java
src/shell env.tomcat tomcat.bat tomcat.sh tomcatEnv.bat
src/tests/webpages/WEB-INF/classes/calendar Serialize.java
Added: src/etc test-tomcat.xml
src/share/org/apache/tomcat/task GTest.java
Removed: src/shell ant
Log:
First step to a new directory structure.
Changed build.xml and fixed various files
Revision Changes Path
1.21 +102 -143 jakarta-tomcat/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat/build.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- build.xml 2000/01/15 17:56:45 1.20
+++ build.xml 2000/01/26 20:12:29 1.21
@@ -2,171 +2,129 @@
<property name="build.compiler" value="classic"/>
<property name="tomcat.build" value="../build/tomcat"/>
<property name="tomcat.home" value="../dist/tomcat"/>
- <property name="test.classpath" value="${tomcat.build}/classes:../jakarta-tools/moo.jar" />
- <!-- Create directories, copy static files -->
+ <!-- ==================== Copy static files ==================== -->
+ <!-- IF YOU CHANGE, sync dist.prepare !!! -->
<target name="prepare">
<mkdir dir="${tomcat.build}"/>
<mkdir dir="${tomcat.build}/classes"/>
- <mkdir dir="${tomcat.build}/etc"/>
+ <mkdir dir="${tomcat.build}/conf"/>
<mkdir dir="${tomcat.build}/src"/>
<mkdir dir="${tomcat.build}/lib"/>
+ <mkdir dir="${tomcat.build}/bin"/>
+ <mkdir dir="${tomcat.build}/webapps"/>
- <copydir src="src/webpages" dest="${tomcat.build}/webpages"/>
- <copydir src="src/examples" dest="${tomcat.build}/examples"/>
- <copydir src="src/share/javax" dest="${tomcat.build}/src/javax"/>
- <copyfile src="../jakarta-ant/lib/xml.jar" dest="${tomcat.build}/lib/xml.jar"/>
-
- <copydir src="src/shell" dest="${tomcat.build}" />
-
- <!-- XXX clean this up ! -->
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.xml"
- dest="${tomcat.build}/server.xml"/>
- <!-- XXX Where should it be ? -->
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.xml"
- dest="${tomcat.build}/etc/server.xml"/>
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.dtd"
- dest="${tomcat.build}/etc/server.dtd"/>
+ <copydir src="src/shell" dest="${tomcat.build}/bin" />
+ <copydir src="src/etc" dest="${tomcat.build}/conf"/>
+ <copydir src="src/doc" dest="${tomcat.build}/doc"/>
+ <copydir src="src/share/javax" dest="${tomcat.home}/src/javax"/>
+
+ <!-- include ant, it is used for testing and will be used for
+ configuration and few other tasks -->
+ <copydir src="${ant.home}/bin" dest="${tomcat.build}/bin"/>
+ <copyfile src="${ant.home}/lib/xml.jar" dest="${tomcat.build}/lib/xml.jar"/>
+ <copyfile src="${ant.home}/lib/ant.jar" dest="${tomcat.build}/lib/ant.jar"/>
+
<copyfile src="src/share/org/apache/tomcat/deployment/web.xml"
- dest="${tomcat.build}/etc/web.xml"/>
+ dest="${tomcat.build}/conf/web.xml"/>
<copyfile src="src/share/org/apache/tomcat/deployment/web.dtd"
- dest="${tomcat.build}/etc/web.dtd"/>
-
+ dest="${tomcat.build}/conf/web.dtd"/>
<copyfile src="LICENSE" dest="${tomcat.build}/LICENSE"/>
- <copyfile src="src/etc/readme" dest="${tomcat.build}/README"/>
- <copyfile src="src/etc/Tomcat+Apache-HOWTO" dest="${tomcat.build}/Tomcat+Apache-HOWTO"/>
- <copyfile src="src/etc/faq" dest="${tomcat.build}/FAQ"/>
- <copyfile src="src/etc/tomcat.conf" dest="${tomcat.build}/etc/tomcat.conf"/>
- <copyfile src="src/etc/SimpleStartup.java"
- dest="${tomcat.build}/etc/SimpleStartup.java"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/tomcat.sh"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/ant"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/startup.sh"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/shutdown.sh"/>
</target>
- <target name="main" depends="prepare">
+ <!-- ==================== Build tomcat ==================== -->
+ <target name="tomcat" depends="prepare">
<javac srcdir="src/share" destdir="${tomcat.build}/classes"
- classpath="${tomcat.build}/lib/xml.jar" debug="on"/>
- <javac srcdir="src/examples/WEB-INF/classes"
- destdir="${tomcat.build}/examples/WEB-INF/classes"
- classpath="${tomcat.build}/classes"/>
- <javac srcdir="src/webpages/WEB-INF/classes"
- destdir="${tomcat.build}/webpages/WEB-INF/classes"
- classpath="${tomcat.build}/classes"/>
-
- <javac srcdir="src/examples/jsp/plugin/applet"
- destdir="${tomcat.build}/examples/jsp/plugin/applet"/>
-
+ classpath="${tomcat.build}/lib/xml.jar" debug="on"/>
<rmic base="${tomcat.build}/classes"
- class="org.apache.tomcat.shell.AdminImpl"/>
-
-<!--
-
- <javac srcdir="${tomcat.build}/examples/WEB-INF/classes/jsp/tags"
- destdir="${tomcat.build}/examples/WEB-INF/classes/jsp/tags"
- classpath="${tomcat.build}/classes"/>
- <mkdir dir="${tomcat.build}/examples/jsp/libs"/>
- <jar jarfile="${tomcat.build}/examples/jsp/libs/taglib.jar"
- basedir="${tomcat.build}/examples/WEB-INF/classes/jsp/tags"
- items="examples,META-INF/taglib.tld"/>
--->
- <chmod perm="+x" src="${tomcat.build}/tomcat.sh"/>
- </target>
-
- <target name="dist" depends="main">
- <!-- cut & paste of "prepare", with tomcat.home instead of tomcat_build
- XXX create "parametrized" targets
- XXX do we need all the files in tomcat_build ??
- -->
- <mkdir dir="${tomcat.home}" />
- <mkdir dir="${tomcat.home}/lib" />
- <mkdir dir="${tomcat.home}/etc" />
- <mkdir dir="${tomcat.home}/src" />
- <mkdir dir="${tomcat.home}/examples" />
- <mkdir dir="${tomcat.home}/webpages" />
-
- <copydir src="src/share/javax" dest="${tomcat.home}/src/javax"/>
- <copyfile src="../jakarta-ant/lib/ant.jar" dest="${tomcat.home}/lib/ant.jar"/>
- <copyfile src="../jakarta-ant/lib/xml.jar" dest="${tomcat.home}/lib/xml.jar"/>
-
- <copydir src="src/shell" dest="${tomcat.home}" />
-
- <!-- XXX clean this up ! -->
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.xml"
- dest="${tomcat.home}/server.xml"/>
- <!-- XXX Where should it be ? -->
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.xml"
- dest="${tomcat.home}/etc/server.xml"/>
- <copyfile src="src/share/org/apache/tomcat/shell/deployment/server.dtd"
- dest="${tomcat.home}/etc/server.dtd"/>
- <copyfile src="src/share/org/apache/tomcat/deployment/web.xml"
- dest="${tomcat.home}/etc/web.xml"/>
- <copyfile src="src/share/org/apache/tomcat/deployment/web.dtd"
- dest="${tomcat.home}/etc/web.dtd"/>
-
- <copyfile src="src/etc/tomcat.conf" dest="${tomcat.home}/etc/tomcat.conf"/>
- <copyfile src="src/etc/license.txt" dest="${tomcat.home}/LICENSE"/>
- <copyfile src="src/etc/readme" dest="${tomcat.home}/README"/>
- <copyfile src="src/etc/faq" dest="${tomcat.home}/FAQ"/>
- <copyfile src="src/etc/SimpleStartup.java"
- dest="${tomcat.home}/etc/SimpleStartup.java"/>
-
- <copydir src="${tomcat.build}/webpages" dest="${tomcat.home}/webpages"/>
- <copydir src="${tomcat.build}/examples" dest="${tomcat.home}/examples"/>
- <chmod perm="+x" src="${tomcat.home}/tomcat.sh"/>
-
- <!-- XXX add manifest for autorun! -->
- <jar jarfile="${tomcat.home}/webserver.jar"
- basedir="${tomcat.build}/classes"
- items="org/apache/tomcat"/>
- <jar jarfile="${tomcat.home}/lib/servlet.jar"
- basedir="${tomcat.build}/classes"
- items="javax/servlet"/>
- <jar jarfile="${tomcat.home}/lib/jasper.jar"
- basedir="${tomcat.build}/classes"
- items="org/apache/jasper"/>
+ class="org.apache.tomcat.shell.AdminImpl"/>
</target>
- <target name="test" depends="main">
- <mkdir dir="${tomcat.build}/test"/>
- <mkdir dir="${tomcat.build}/test/classes"/>
- <mkdir dir="${tomcat.build}/test/lib"/>
- <mkdir dir="${tomcat.build}/test/webpages"/>
-
- <copydir src="src/tests/webpages"
- dest="${tomcat.build}/test/webpages"/>
-
- <copydir src="src/tests/bin" dest="${tomcat.build}/test"/>
- <copyfile src="src/tests/server.xml"
- dest="${tomcat.build}/test/server.xml"/>
- <copyfile src="src/tests/testlist.txt"
- dest="${tomcat.build}/test/testlist.txt"/>
- <copyfile src="../jakarta-tools/moo.jar"
- dest="${tomcat.build}/test/lib/moo.jar"/>
- <copyfile src="../jakarta-ant/lib/ant.jar"
- dest="${tomcat.build}/test/lib/ant.jar"/>
- <copyfile src="../jakarta-tools/moo.jar"
- dest="${tomcat.build}/test/webpages/WEB-INF/lib/moo.jar"/>
-
- <javac srcdir="src/tests/share"
- destdir="${tomcat.build}/test/classes"
- classpath="${test.classpath}"/>
+ <!-- ==================== Build all web applications ==================== -->
+ <target name="webapps" depends="prepare">
+ <!-- Examples -->
+ <mkdir dir="${tomcat.build}/webapps/examples"/>
+ <copydir src="src/examples" dest="${tomcat.build}/webapps/examples"/>
+ <javac srcdir="src/examples/WEB-INF/classes"
+ destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
+ classpath="${tomcat.build}/classes"/>
+ <javac srcdir="src/examples/jsp/plugin/applet"
+ destdir="${tomcat.build}/webapps/examples/jsp/plugin/applet"/>
+ <jar jarfile="${tomcat.build}/webapps/examples.war"
+ basedir="${tomcat.build}/webapps/examples"
+ items="." />
+
+ <!-- Root context -->
+ <mkdir dir="${tomcat.build}/webapps/ROOT"/>
+ <copydir src="src/webpages" dest="${tomcat.build}/webapps/ROOT"/>
+ <javac srcdir="src/webpages/WEB-INF/classes"
+ destdir="${tomcat.build}/webapps/ROOT/WEB-INF/classes"
+ classpath="${tomcat.build}/classes"/>
+ <jar jarfile="${tomcat.build}/webapps/ROOT.war"
+ basedir="${tomcat.build}/webapps/ROOT"
+ items="." />
+
+ <!-- Test application -->
+ <mkdir dir="${tomcat.build}/webapps/test"/>
+ <copydir src="src/tests/webpages" dest="${tomcat.build}/webapps/test"/>
<javac srcdir="src/tests/webpages/WEB-INF/classes"
- destdir="${tomcat.build}/test/webpages/WEB-INF/classes"
- classpath="${test.classpath}"/>
+ destdir="${tomcat.build}/webapps/test/WEB-INF/classes"
+ classpath="${tomcat.build}/classes"/>
+ <jar jarfile="${tomcat.build}/webapps/test.war"
+ basedir="${tomcat.build}/webapps/test"
+ items="." />
</target>
-
- <target name="servlet">
- <mkdir dir="${tomcat.build}"/>
- <mkdir dir="${tomcat.build}/classes"/>
-
- <javac srcdir="src/share/javax" destdir="${tomcat.build}/classes"/>
+ <!-- ==================== Copy the files to distribution format ==================== -->
+ <target name="dist" depends="main,webapps">
+ <mkdir dir="${tomcat.home}"/>
+ <mkdir dir="${tomcat.home}/classes"/>
+ <mkdir dir="${tomcat.home}/conf"/>
+ <mkdir dir="${tomcat.home}/src"/>
+ <mkdir dir="${tomcat.home}/lib"/>
+ <mkdir dir="${tomcat.home}/bin"/>
+ <mkdir dir="${tomcat.home}/webapps"/>
+ <mkdir dir="${tomcat.home}/webapps/ROOT"/>
+
+ <copydir src="${tomcat.build}/webapps/ROOT" dest="${tomcat.home}/webapps/ROOT"/>
+ <copydir src="${tomcat.build}/bin" dest="${tomcat.home}/bin" />
+ <copydir src="${tomcat.build}/conf" dest="${tomcat.home}/conf"/>
+ <copydir src="${tomcat.build}/doc" dest="${tomcat.home}/doc"/>
+ <copydir src="${tomcat.build}/src" dest="${tomcat.home}/src"/>
+ <copydir src="${tomcat.build}/lib" dest="${tomcat.home}/lib"/>
+ <copyfile src="${tomcat.build}/LICENSE" dest="${tomcat.home}/LICENSE"/>
+
+ <!-- Copy only war format for examples and test -->
+ <copyfile src="${tomcat.build}/webapps/examples.war"
+ dest="${tomcat.home}/webapps/examples.war"/>
+ <copyfile src="${tomcat.build}/webapps/test.war"
+ dest="${tomcat.home}/webapps/test.war"/>
+
+ <!-- create tomcat jar files -->
+ <jar jarfile="${tomcat.home}/lib/webserver.jar"
+ basedir="${tomcat.build}/classes"
+ items="org/apache/tomcat"/>
+ <jar jarfile="${tomcat.home}/lib/servlet.jar"
+ basedir="${tomcat.build}/classes"
+ items="javax/servlet"/>
+ <jar jarfile="${tomcat.home}/lib/jasper.jar"
+ basedir="${tomcat.build}/classes"
+ items="org/apache/jasper"/>
- <jar jarfile="../jakarta-tools/servlet-2.2.0.jar"
- basedir="${tomcat.build}/classes"
- items="javax"/>
+ <!-- Change permissions for unix -->
+ <chmod perm="+x" src="${tomcat.home}/bin/tomcat.sh"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/ant"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/startup.sh"/>
+ <chmod perm="+x" src="${tomcat.build}/bin/shutdown.sh"/>
</target>
-
+
+ <!-- ==================== Admin ==================== -->
<target name="clean">
<deltree dir="${tomcat.build}"/>
</target>
@@ -175,6 +133,7 @@
<deltree dir="${tomcat.home}"/>
</target>
- <target name="all" depends="clean,main,dist,test"/>
+ <target name="all" depends="clean,main,dist"/>
+ <target name="main" depends="tomcat,webapps"/>
</project>
1.1 jakarta-tomcat/src/etc/test-tomcat.xml
Index: test-tomcat.xml
===================================================================
<project name="TestRun" default="main" basedir="." init="init">
<target name="init">
<property name="host" value="localhost" />
<property name="port" value="8080" />
<property name="gdir" value="jsp/Golden" />
<taskdef name="test" class="tests.Test" />
<taskdef name="gtest" class="tests.GTest" />
</target>
<!-- ==================== File tests ==================== -->
<target name="file">
<gtest description="Content Type Test"
request="GET /test/binaries/image1.gif HTTP/1.0"
expectHeaders="Content-Type:image/gif" />
<gtest description="File Integrity and Length Test"
request="GET /test/binaries/image1.gif HTTP/1.0"
goldenFile="${gdir}/image1.gif"
exactMatch="true" />
<gtest description="Welcome File Test1"
request="GET /test/welcome HTTP/1.0"
expectHeaders="Location:/welcome/"
returnCode="HTTP/1.0 302" />
<gtest description="Welcome File Test2"
request="GET /test/binaries HTTP/1.0"
returnCode="HTTP/1.0 200" />
<gtest description="Welcome File Test3"
request="GET /test/welcome/ HTTP/1.0"
returnCode="HTTP/1.0 200"
goldenFile="${gdir}/welcome.txt" />
</target>
<!-- ==================== Dispatch tests ==================== -->
<target name="dispatch">
<gtest description="SimpleRedirect"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?/index.html HTTP/1.0"
expectHeaders="Location:http://${host}:${port}/index.html"
returnCode="HTTP/1.0 302"
/>
<gtest description="SimpleRedirect2"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?index.html HTTP/1.0"
expectHeaders="Location:http://${host}:${port}/test/servlet/index.html"
returnCode="HTTP/1.0 302"
/>
<gtest description="SimpleInclude"
request="GET /test/servlet/dispatch.SimpleIncludeServlet HTTP/1.0"
expectHeaders="Content-Type:text/foobar"
returnCode="HTTP/1.0 200"
goldenFile="${gdir}/SimpleInclude.txt"
/>
<gtest description="SimpleForward"
request="GET /test/servlet/dispatch.SimpleForwardServlet HTTP/1.0"
expectHeaders="Content-Type:text/funky"
returnCode="HTTP/1.0 200"
goldenFile="${gdir}/SimpleForward.txt"
/>
<gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="PreInclude"
/>
<gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="PostInclude"
/>
<gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="Included servlet error: 500:"
/>
<gtest description="Mismatch2"
request="GET /test/servlet/dispatch.Mismatch2 HTTP/1.0"
returnCode="HTTP/1.0 200"
goldenFile="${gdir}/Mismatch2.txt"
/>
<gtest description="IncludeMismatch1-1"
request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="LINE1"
/>
<gtest description="IncludeMismatch1-2"
request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="error: 500"
/>
<gtest description="IncludeMismatch1-3"
request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
returnCode="HTTP/1.0 200"
responseMatch="LINE1"
/>
<gtest description="IncludeFile"
request="GET /test/servlet/dispatch.IncludeFileServlet HTTP/1.0"
returnCode="HTTP/1.0 200"
expectHeaders="Content-Type:text/foobar"
goldenFile="${gdir}/IncludeFile.txt"
/>
<gtest description="ForwardWithQuery"
request="GET /test/servlet/dispatch.ForwardWithQueryServlet?name=Sun%20Microsystems&age=100000&city=Cupertino HTTP/1.0"
returnCode="HTTP/1.0 200"
expectHeaders="Content-Type:text/funky"
goldenFile="${gdir}/ForwardWithQuery.txt"
/>
</target>
<!-- ==================== Jsp tests ==================== -->
<target name="jsp">
<gtest request="GET /test/jsp/HelloWorld.jsp HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
<gtest request="GET /test/doesNotExist.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/ HTTP/1.0"
goldenFile="${gdir}/index.txt"
description="Serves index.html"
/>
<gtest request="GET /test/jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
description="Getting -- HTTP/1.0 302 Found"
magnitude="false" />
<gtest request="GET /test/.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/HelloWorld.jsp?????? HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
<gtest request="GET /test/jsp/HelloWorld.jsp?a=b&c=d HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
<gtest request="GET /test/jsp/HelloWorld.jsp?&& HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
<gtest request="GET /test/jsp/declaration/IntegerOverflow.jsp HTTP/1.0"
returnCode="HTTP/1.0 500 Internal Server Error"
/>
<gtest request="GET /test/jsp/error/err.jsp HTTP/1.0"
goldenFile="${gdir}/Err.txt"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/forward/forward.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/jsptoserv/jsptoservlet.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/jsptoservlet.txt"
/>
<gtest request="GET /test/jsp/initDestroy.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/classTest.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/classTest.txt"
/>
<gtest request="GET /test/jsp/import.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/import.txt"
/>
<gtest request="GET /test/jsp/buffer.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/buffer.txt"
/>
<gtest request="GET /test/jsp/buffer1.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/buffer2.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/buffer3.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/buffer4.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/comments.jsp HTTP/1.0"
returnCode="HTTP/1.0 500 Internal Server Error"
/>
<gtest request="GET /test/jsp/parse.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/parse.txt"
/>
<gtest request="GET /test/jsp/pageInfo.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageLanguage.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageIsThreadSafe.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageSession.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageAutoFlush.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageError.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/pageExtends.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageIsErrorPage.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageContentType.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/pageImport2.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageImport.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/pageImport.txt"
/>
<gtest request="GET /test/jsp/beanTest1.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/beanTest.txt"
/>
<gtest request="GET /test/jsp/beanTest2.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/beanScopePage.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/beanScopeSession.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/implicitOut.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitOut.txt"
/>
<gtest request="GET /test/jsp/implicitConfig.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitConfig.txt"
/>
<gtest request="GET /test/jsp/implicitException.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitException.txt"
/>
<gtest request="GET /test/jsp/implicitPageContext.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitPageContext.txt"
/>
<gtest request="GET /test/jsp/implicitContext.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitContext.txt"
/>
<gtest request="GET /test/jsp/implicitRequest.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitRequest.txt"
/>
<gtest request="GET /test/jsp/implicitResponse.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitResponse.txt"
/>
<gtest request="GET /test/jsp/implicitSession.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitSession.txt"
/>
<gtest request="GET /test/jsp/implicitPageContext.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/implicitPageContext.txt"
/>
<gtest request="GET /test/jsp/pageInvalid.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageDouble.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/pageContent3.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/servlet/servletParam1 HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/servletParam1.txt"
/>
<gtest request="GET /test/servlet/servletParam2 HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/servletParam2.txt"
/>
<gtest request="GET /test/servlet/ServletParam HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/ServletParam.txt"
/>
<gtest request="GET /test/jsp/bigDeclaration.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/jsp/include/include.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
goldenFile="${gdir}/Include.txt"
/>
</target>
<target name="wrong_request">
<gtest request="GET /test/*.jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET *jsp HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
magnitude="false" />
<gtest request="GET /test/jsp/HelloWorld.jsp HTTP"
returnCode="HTTP/1.0 400"
/>
<gtest request="GET /test/jsp/HelloWorld.jsp 1.0"
returnCode="HTTP/1.0 400"
/>
<gtest request="GET /test/jsp/HelloWorld.jsp /1.0"
returnCode="HTTP/1.0 400"
/>
</target>
<target name="get">
<gtest request="GET /test/request/uri/does/not/exist"
responseMatch="Error: 404"
/>
<gtest request="GET /test/request/uri/does/not/exist HTTP/1.0"
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest request="GET /test/"
returnCode="Error: "
magnitude="false" />
<gtest request=" GET / "
returnCode="Error: "
magnitude="false" />
<gtest request="GET /test/ HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request=" GET / HTTP/1.0"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GET /test/index.ht ml HTTP/1.0"
returnCode="HTTP/1.0 400 Bad Request"
/>
<gtest request=" GET /index.ht ml HTTP/1.0 "
returnCode="HTTP/1.0 400 Bad Request"
/>
<gtest request="GET /test/servlet HTTP/1.0"
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest request="GET /test/servlet/ HTTP/1.0"
returnCode="HTTP/1.0 404"
/>
<gtest request="GET /test/servlet/foo HTTP/1.0"
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest request="GET /test/welcome HTTP/1.0"
returnCode="HTTP/1.0 302"
/>
</target>
<target name="requestMap">
<gtest description="/foo/bar/index.html : 1.0 : 200"
request="GET /test/foo/bar/index.html HTTP/1.0"
responseMatch="Servlet: Servlet1"
/>
<gtest description="/foo/bar/index.bop : 1.0 : 200"
request="GET /test/foo/bar/index.bop HTTP/1.0"
responseMatch="Servlet: Servlet1"
/>
<gtest description="/baz : 1.0 : 200"
request="GET /test/baz HTTP/1.0"
responseMatch="Servlet: Servlet2"
/>
<gtest description="/baz/index.html : 1.0 : 200"
request="GET /test/baz/index.html HTTP/1.0"
responseMatch="Servlet: Servlet2"
/>
<gtest description="/catalog : 1.0 : 200"
request="GET /test/catalog HTTP/1.0"
responseMatch="Servlet: Servlet3"
/>
<gtest description="/catalog/index.html : 1.0 : 200"
request="GET /test/catalog/index.html HTTP/1.0"
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest description="/catalog/racecar.bop : 1.0 : 200"
request="GET /test/catalog/racecar.bop HTTP/1.0"
responseMatch="Servlet: Servlet4"
/>
<gtest description="/index.bop : 1.0 : 200"
request="GET /test/index.bop HTTP/1.0"
responseMatch="Servlet: Servlet4"
/>
</target>
<target name="post">
<gtest request="POST /test/servlet/request.NotThere HTTP/1.0"
content="name=lightness of being"
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="GHOST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="HTTP/1.0 501 Not Implemented"
/>
<gtest request="POST /test/servlet/request.EchoServlet HT TP/1.0"
content="name=lightness of being"
returnCode="Error: 400"
/>
<gtest request="POST "
content="name=lightness of being"
returnCode="Error: 400"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content=""
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST /test/servlet HTTP/1.0"
content=""
returnCode="HTTP/1.0 404 Not Found"
/>
<gtest request="POST /test/servlet/ HTTP/1.0"
content=""
returnCode="HTTP/1.0 404"
/>
<gtest request="POST /test/ HTTP/0.9"
content=""
returnCode="HTTP/1.0 400 Bad Request"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/0.9"
content="name=lightness of being"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/0.9"
content="name=lightness of being,,,,,,,....###///&&@@@@@***"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/0.9"
content="name=lightness of being,,,,,,,....###///&&&&@@@@@***"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST \/test/servlet/request.EchoServlet?name=sun&age=2000 HTTP/0.9"
content="name=lightness of being,,,,,,,....###///&@@@@@***"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST \ HTTP/0.9"
content="name=lightness of being"
returnCode="Error: 400"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="post /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="HTTP/1.0 501 Not Implemented"
/>
<gtest request="GET http://www.javasoft.com/index.html HTTP/1.0 "
returnCode="HTTP/1.0 400 Bad Request"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
headers="Content-Encoding: x-gzip"
content="name=lightness of being"
returnCode="HTTP/1.0 200 OK"
/>
<gtest request="POST /test/servlet/request.EchoServlet HTTP/4.4"
content="name=lightness of being"
returnCode="HTTP/1.0 200 OK"
/>
</target>
<target name="startup">
<java class="org.apache.tomcat.shell.Startup" args="" />
</target>
<target name="client" depends="jsp,wrong_request">
</target>
<target name="shutdown">
<java class="org.apache.tomcat.shell.Startup" args="" />
</target>
<target name="main" depends="startup,client,shutdown" />
</project>
1.4 +2 -0 jakarta-tomcat/src/share/org/apache/tomcat/context/WarInterceptor.java
Index: WarInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/WarInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WarInterceptor.java 2000/01/13 18:20:31 1.3
+++ WarInterceptor.java 2000/01/26 20:12:29 1.4
@@ -82,6 +82,8 @@
public int handleContextInit(Context ctx) {
if (ctx.getDocumentBase().getProtocol().equalsIgnoreCase("war")) {
+ // System.out.println("CTX: " + ctx.getDocumentBase() + " " +
+ // ctx.isWARExpanded());
if (ctx.isWARExpanded()) {
File warDir = new File(ctx.getWorkDir(),
Constants.Context.WARExpandDir);
1.3 +5 -5 jakarta-tomcat/src/share/org/apache/tomcat/shell/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Constants.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Constants.java 1999/12/31 01:18:36 1.2
+++ Constants.java 2000/01/26 20:12:29 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Constants.java,v 1.2 1999/12/31 01:18:36 craigmcc Exp $
- * $Revision: 1.2 $
- * $Date: 1999/12/31 01:18:36 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Constants.java,v 1.3 2000/01/26 20:12:29 costin Exp $
+ * $Revision: 1.3 $
+ * $Date: 2000/01/26 20:12:29 $
*
* ====================================================================
*
@@ -74,7 +74,7 @@
public static final String Package = "org.apache.tomcat.shell";
public static class Server {
- public static final String ConfigFile = "server.xml";
+ public static final String ConfigFile = "conf/server.xml";
public static final String LogFile = "serverlog.txt";
}
@@ -143,7 +143,7 @@
public static class Default {
public static final int ADMIN_PORT = -1;
public static final String WORK_DIR = "work";
- public static final boolean IS_WORK_DIR_PERSISTENT = false;
+ public static final boolean IS_WORK_DIR_PERSISTENT = true;
public static final int SessionTimeOut = 30;
public static final boolean IS_WAR_EXPANDED = true;
public static final boolean IS_WAR_VALIDATED = false;
1.2 +17 -7 jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/Config.java
Index: Config.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/Config.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Config.java 1999/10/09 00:20:54 1.1
+++ Config.java 2000/01/26 20:12:30 1.2
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/Config.java,v 1.1 1999/10/09 00:20:54 duncan Exp $
- * $Revision: 1.1 $
- * $Date: 1999/10/09 00:20:54 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/Config.java,v 1.2 2000/01/26 20:12:30 costin Exp $
+ * $Revision: 1.2 $
+ * $Date: 2000/01/26 20:12:30 $
*
* ====================================================================
*
@@ -125,11 +125,21 @@
if (! f.exists() &&
(! isArg(Constants.Arg.NoConfig))) {
- // createConfigFile(configFile);
- InputStream is =
- this.getClass().getResourceAsStream(configFile);
- loadConfig(is, validate);
+ /* Creating a "default" config with examples and root
+ is confusing and doesn't work anyway ( since examples and root are in
+ different directories, we can't guess the location )
+ Also, it means something is wrong - and it's better to
+ warn the user, so he can correct it
+ */
+ System.out.println("No config file found " + configFile );
+ throw new StartupException("No config file found " + configFile );
+
+ // System.out.println("No config file found " + configFile );
+ // InputStream is =
+ // this.getClass().getResourceAsStream(configFile);
+
+ // loadConfig(is, validate);
} else {
try {
configURL = URLUtil.resolve(configFile, null);
1.4 +4 -3 jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/ContextConfig.java
Index: ContextConfig.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/ContextConfig.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ContextConfig.java 2000/01/10 19:23:57 1.3
+++ ContextConfig.java 2000/01/26 20:12:30 1.4
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/ContextConfig.java,v 1.3 2000/01/10 19:23:57 costin Exp $
- * $Revision: 1.3 $
- * $Date: 2000/01/10 19:23:57 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/deployment/ContextConfig.java,v 1.4 2000/01/26 20:12:30 costin Exp $
+ * $Revision: 1.4 $
+ * $Date: 2000/01/26 20:12:30 $
*
* ====================================================================
*
@@ -114,6 +114,7 @@
try {
db = URLUtil.resolve(documentBase);
+ System.out.println("Resolved " + documentBase + " to " + db);
} catch (MalformedURLException mue) {
}
1.1 jakarta-tomcat/src/share/org/apache/tomcat/task/GTest.java
Index: GTest.java
===================================================================
/**
*
*
*/
package org.apache.tomcat.task;
import java.net.*;
import java.io.*;
import java.util.*;
import java.net.*;
import org.apache.tools.ant.*;
// derived from Jsp
public class GTest extends Task {
String prefix="http://localhost:8080/test";
String host="localhost";
int port=8080;
int debug=0;
String description="No description";
String request;
Hashtable requestHeaders;
String content;
// Expected response
boolean magnitude=true;
boolean exactMatch=false;
// Match the body against a golden file
String goldenFile;
// Match the body against a string
String responseMatch;
// the response should include the following headers
Hashtable expectHeaders;
// Match request line
String returnCode="";
// Actual response
String responseLine;
String responseBody;
Hashtable headers;
public GTest() {
}
public void setPrefix(String prefix) {
this.prefix=prefix;
}
public void setHost(String h) {
this.host=h;
}
public void setPort(String portS) {
this.port=Integer.valueOf( portS).intValue();
}
public void setExactMatch(String exact) {
exactMatch=Boolean.valueOf( exact ).booleanValue();
}
/** Set the port as int - different name to avoid confusing ant
*/
public void setPortInt(int i) {
this.port=i;
}
/** Description should be in <test description=""/>
*/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description=description;
}
public void setContent(String s) {
this.content=s;
}
public void setDebug( String debugS ) {
debug=Integer.valueOf( debugS).intValue();
}
public void setMagnitude( String magnitudeS ) {
magnitude = Boolean.valueOf(magnitudeS).booleanValue();
}
public void setGoldenFile( String s ) {
this.goldenFile=s;
}
public void setExpectHeaders( String s ) {
this.expectHeaders=new Hashtable();
parseHeader( s, expectHeaders );
}
public void setResponseMatch( String s ) {
this.responseMatch=s;
}
public void setRequest( String s ) {
this.request=s;
}
public void setReturnCode( String s ) {
this.returnCode=s;
}
public void setHeaders( String s ) {
requestHeaders=new Hashtable();
parseHeader( s, requestHeaders );
}
public void execute() throws BuildException {
try {
boolean result=runTest();
if(result) {
if( "No description".equals( description )) {
System.out.println("OK " + request );
}
else
System.out.println("OK " + description + " (" + request + ")");
} else {
System.out.println("==================== FAIL ====================");
System.out.println("(" + description + ")" + request );
}
} catch(Exception ex ) {
System.out.println("==================== FAIL ====================");
System.out.println("(" + description + ")" + request );
ex.printStackTrace();
}
}
// XXX move to exec, get rid of TestResult
public boolean runTest()
throws Exception
{
dispatch(request, null);
return checkResponse( magnitude );
}
private boolean checkResponse(boolean testCondition)
throws Exception
{
boolean responseStatus = true;
// If returnCode doesn't match
if( request.indexOf( "HTTP/1." ) > -1) {
boolean match= ( responseLine!=null && responseLine.indexOf(returnCode) > -1);
if( match != testCondition ) {
responseStatus = false;
System.out.println("ERROR in: " + request);
System.out.println(" Expecting: " + returnCode );
System.out.println(" Got : " + responseLine);
}
}
if( expectHeaders != null ) {
// Check if we got the expected headers
if(headers==null) {
System.out.println("ERROR no response header, expecting header");
}
Enumeration e=expectHeaders.keys();
while( e.hasMoreElements()) {
String key=(String)e.nextElement();
String value=(String)expectHeaders.get(key);
String respValue=(String)headers.get(key);
if( respValue==null || respValue.indexOf( value ) <0 ) {
System.out.println("ERROR expecting header " + key + ":" +
value + " GOT: " + respValue+ " HEADERS(" + headers + ")");
return false;
}
}
}
if( responseMatch != null ) {
// check if we got the string we wanted
if( responseBody == null ) {
System.out.println("ERROR: got no response, expecting " + responseMatch);
return false;
}
if( responseBody.indexOf( responseMatch ) < 0) {
System.out.println("ERROR: expecting match on " + responseMatch);
System.out.println("GOT: " );
System.out.println(responseBody );
}
}
// compare the body
if( goldenFile==null) return responseStatus;
// Get the expected result from the "golden" file.
StringBuffer expResult = getExpectedResult();
// Compare the results and set the status
boolean cmp=true;
if(exactMatch)
cmp=compare(responseBody, expResult.toString() );
else
cmp=compareWeek( responseBody, expResult.toString());
if( cmp != testCondition ) {
responseStatus = false;
System.out.println("ERROR (" + cmp + "," + testCondition + ")in : " + request);
System.out.println("====================Expecting: ");
System.out.println(expResult);
System.out.println("====================Got:");
System.out.println(responseBody);
System.out.println("====================");
}
return responseStatus;
}
/** Invoke a request, set headers, responseLine, body
*/
private void dispatch(String request, Hashtable requestHeaders)
throws Exception
{
// XXX headers are ignored
Socket s = null;
s = new Socket( host, port);
InputStream is= s.getInputStream();
// Write the request
OutputStreamWriter out=new OutputStreamWriter(s.getOutputStream());
PrintWriter pw = new PrintWriter(out);
pw.println(request);
if( content != null) {
pw.println("Content-Length: " + content.length());
}
if( request.indexOf( "HTTP/1." ) > -1)
pw.println("");
if( content != null) {
pw.println(content);
// XXX no /n at the end -see HTTP specs!
}
pw.flush();
try {
// http 0.9
if( request.indexOf( "HTTP/1." ) > -1) {
responseLine = read( is );
headers=parseHeaders( is );
}
// else do content matching as well
StringBuffer result = readBody( is );
if(result!=null)
responseBody=result.toString();
} catch( SocketException ex ) {
s.close();
return;
}
s.close();
}
// Parse a file into a String.
private StringBuffer getExpectedResult()
throws IOException
{
StringBuffer expResult = new StringBuffer("NONE");
try {
InputStream in = this.getClass().getResourceAsStream(goldenFile);
return readBody ( in );
} catch (Exception ex) {
System.out.println("\tGolden file not found: " + goldenFile);
return expResult;
}
}
// Compare the actual result and the expected result.
private boolean compare(String str1, String str2) {
if ( str1==null || str2==null) return false;
if ( str1.length() != str2.length() ) {
System.out.println("Wrong size " + str1.length() +" " + str2.length() );
return false;
}
for(int i=0; i<str1.length() ; i++ ) {
if (str1.charAt( i ) != str2.charAt( i ) ) {
System.out.println("Error at " + i + " " + str1.charAt(1) +
str2.charAt(i));
return false;
}
}
return true;
}
// Compare the actual result and the expected result.
// Original compare - ignores spaces ( because most
// golden files are wrong !)
private boolean compareWeek(String str1, String str2) {
if ( str1==null || str2==null) return false;
StringTokenizer st1=new StringTokenizer(str1);
StringTokenizer st2=new StringTokenizer(str2);
while (st1.hasMoreTokens() && st2.hasMoreTokens()) {
String tok1 = st1.nextToken();
String tok2 = st2.nextToken();
if (!tok1.equals(tok2)) {
System.out.println("\tFAIL*** : Rtok1 = " + tok1
+ ", Etok2 = " + tok2);
return false;
}
}
if (st1.hasMoreTokens() || st2.hasMoreTokens()) {
return false;
} else {
return true;
}
}
// XXX return byte [], fix the reading !!!!!
StringBuffer readBody( InputStream input )
throws Exception
{
StringBuffer sb = new StringBuffer();
while (true) {
int ch = input.read();
if (ch < 0) {
if (sb.length() == 0) {
return (null);
} else {
break;
}
}
sb.append((char) ch);
}
return sb;
}
// ==================== Code from JSERV !!! ====================
/**
* Parse the incoming HTTP request headers, and set the corresponding
* request properties.
*
*
* @exception IOException if an input/output error occurs
*/
private Hashtable parseHeaders(InputStream is) throws IOException {
Hashtable headers=new Hashtable();
while (true) {
// Read the next header line
String line = read(is);
if ((line == null) || (line.length() < 1)) {
break;
}
parseHeader( line, headers);
}
return headers;
}
private void parseHeader(String line, Hashtable headers) {
// Parse the header name and value
int colon = line.indexOf(":");
if (colon < 0) {
System.out.println("ERROR: Wrong Header Line: " + line );
return;
}
String name = line.substring(0, colon).trim();
String value = line.substring(colon + 1).trim();
// System.out.println("HEADER: " +name + " " + value);
headers.put(name, value);
}
/**
* Read a line from the specified servlet input stream, and strip off
* the trailing carriage return and newline (if any). Return the remaining
* characters that were read as a string.
*
* @returns The line that was read, or <code>null</code> if end of file
* was encountered
*
* @exception IOException if an input/output error occurred
*/
private String read(InputStream input) throws IOException {
// Read the next line from the input stream
StringBuffer sb = new StringBuffer();
while (true) {
int ch = input.read();
if (ch < 0) {
if (sb.length() == 0) {
return (null);
} else {
break;
}
} else if (ch == '\n') {
break;
}
sb.append((char) ch);
}
// Strip any trailing carriage return
int n = sb.length();
if ((n > 0) && (sb.charAt(n - 1) == '\r')) {
sb.setLength(n - 1);
}
// Convert the line to a String and return it
return (sb.toString());
}
}
1.2 +1 -1 jakarta-tomcat/src/shell/env.tomcat
Index: env.tomcat
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/shell/env.tomcat,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- env.tomcat 1999/10/15 19:30:16 1.1
+++ env.tomcat 2000/01/26 20:12:31 1.2
@@ -29,7 +29,7 @@
if [ X${TOM_CLASSPATH} = X ]; then
echo $baseDir
TOM_CLASSPATH=.
- TOM_CLASSPATH=${baseDir}/webserver.jar:${TOM_CLASSPATH}
+ TOM_CLASSPATH=${baseDir}/lib/webserver.jar:${TOM_CLASSPATH}
TOM_CLASSPATH=${baseDir}/lib/servlet.jar:${TOM_CLASSPATH}
TOM_CLASSPATH=${baseDir}/lib/jasper.jar:${TOM_CLASSPATH}
1.8 +2 -2 jakarta-tomcat/src/shell/tomcat.bat
Index: tomcat.bat
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcat.bat,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- tomcat.bat 2000/01/13 17:01:44 1.7
+++ tomcat.bat 2000/01/26 20:12:31 1.8
@@ -1,11 +1,11 @@
@echo off
-rem $Id: tomcat.bat,v 1.7 2000/01/13 17:01:44 rubys Exp $
+rem $Id: tomcat.bat,v 1.8 2000/01/26 20:12:31 costin Exp $
rem A batch file to start/stop tomcat server.
rem This batch file written and tested under Windows NT
rem Improvements to this file are welcome
-set jsdkJars=.\webserver.jar;.\lib\servlet.jar
+set jsdkJars=.\lib\webserver.jar;.\lib\servlet.jar
set jspJars=.\lib\jasper.jar
set beanJars=.\webpages\WEB-INF\classes\jsp\beans
set miscJars=.\lib\xml.jar
1.7 +5 -5 jakarta-tomcat/src/shell/tomcat.sh
Index: tomcat.sh
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcat.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- tomcat.sh 2000/01/13 17:01:44 1.6
+++ tomcat.sh 2000/01/26 20:12:31 1.7
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: tomcat.sh,v 1.6 2000/01/13 17:01:44 rubys Exp $
+# $Id: tomcat.sh,v 1.7 2000/01/26 20:12:31 costin Exp $
# Shell script to start and stop the server
@@ -18,11 +18,11 @@
if [ "$TOMCAT_HOME" = "" ] ; then
# try to find tomcat
- if [ -d ${HOME}/opt/tomcat ] ; then
+ if [ -d ${HOME}/opt/tomcat/conf ] ; then
TOMCAT_HOME=${HOME}/opt/tomcat
fi
- if [ -d /opt/tomcat ] ; then
+ if [ -d /opt/tomcat/conf ] ; then
TOMCAT_HOME=/opt/tomcat
fi
@@ -40,7 +40,7 @@
fi
done
- TOMCAT_HOME=`dirname "$PRG"`
+ TOMCAT_HOME=`dirname "$PRG"`/..
fi
@@ -62,7 +62,7 @@
oldCP=$CLASSPATH
-CLASSPATH=${TOMCAT_HOME}/webserver.jar
+CLASSPATH=${TOMCAT_HOME}/lib/webserver.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/servlet.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/jasper.jar
CLASSPATH=${CLASSPATH}:${TOMCAT_HOME}/lib/xml.jar
1.2 +4 -5 jakarta-tomcat/src/shell/tomcatEnv.bat
Index: tomcatEnv.bat
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcatEnv.bat,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tomcatEnv.bat 1999/10/15 19:30:19 1.1
+++ tomcatEnv.bat 2000/01/26 20:12:31 1.2
@@ -2,11 +2,10 @@
if "%1" == "restore" goto restore
set TOM_CLASSPATH=.
-set TOM_CLASSPATH=%TOMCAT_HOME%\webserver.jar;%TOM_CLASSPATH%
-set TOM_CLASSPATH=%TOMCAT_HOME%\servlet.jar;%TOM_CLASSPATH%
-set TOM_CLASSPATH=%TOMCAT_HOME%\jasper.jar;%TOM_CLASSPATH%
-set TOM_CLASSPATH=%TOMCAT_HOME%\xml.jar;%TOM_CLASSPATH%
-set TOM_CLASSPATH=%TOMCAT_HOME%\webpages\WEB-INF\classes\jsp\beans;%TOM_CLASSPATH%
+set TOM_CLASSPATH=%TOMCAT_HOME%\lib\webserver.jar;%TOM_CLASSPATH%
+set TOM_CLASSPATH=%TOMCAT_HOME%\lib\servlet.jar;%TOM_CLASSPATH%
+set TOM_CLASSPATH=%TOMCAT_HOME%\lib\jasper.jar;%TOM_CLASSPATH%
+set TOM_CLASSPATH=%TOMCAT_HOME%\lib\xml.jar;%TOM_CLASSPATH%
set TOM_CLASSPATH=%TOMCAT_HOME%\classes;%TOM_CLASSPATH%
set TOM_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%TOM_CLASSPATH%
1.3 +1 -0 jakarta-tomcat/src/tests/webpages/WEB-INF/classes/calendar/Serialize.java
Index: Serialize.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/classes/calendar/Serialize.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Serialize.java 1999/11/12 03:34:18 1.2
+++ Serialize.java 2000/01/26 20:12:33 1.3
@@ -1,3 +1,4 @@
+package calendar;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;