rwaldhoff 01/07/27 15:54:08 Modified: httpclient build.properties.sample build.xml README.txt Log: converted to log4j for logging Revision Changes Path 1.3 +6 -6 jakarta-commons/httpclient/build.properties.sample Index: build.properties.sample =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/build.properties.sample,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- build.properties.sample 2001/05/17 23:58:50 1.2 +++ build.properties.sample 2001/07/27 22:54:08 1.3 @@ -1,10 +1,10 @@ -# junit.jar - JUnit 3.2+ Classpath +# junit.jar - JUnit 3.2+ Classpath (see http://junit.org) junit.jar=/java/junit/junit.jar # jsse.jar - JSSE classes (see http://java.sun.com/products/jsse) -# XXX if we were using the classpath=${foo}:${bar} form, -# rather than path elements to set the classpath, we could -# put this as one property: -# jsse.jar=/java/jsse/lib/jsse.jar:/java/jsse/lib/jcert.jar:/java/jsse/lib/jnet.jar jsse.jar=/java/jsse/lib/jsse.jar +# jsse.jar - JSSE classes (see http://java.sun.com/products/jsse) jcert.jar=/java/jsse/lib/jcert.jar -jnet.jar=/java/jsse/lib/jnet.jar \ No newline at end of file +# jsse.jar - JSSE classes (see http://java.sun.com/products/jsse) +jnet.jar=/java/jsse/lib/jnet.jar +# log4j.jar - log4j classes (see http://jakarta.apache.org/log4j) +log4j.jar=/java/log4j/log4j.jar \ No newline at end of file 1.5 +41 -1 jakarta-commons/httpclient/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- build.xml 2001/06/20 04:26:07 1.4 +++ build.xml 2001/07/27 22:54:08 1.5 @@ -3,7 +3,7 @@ <!-- "HTTP Client" component of the Jakarta Commons Subproject - $Id: build.xml,v 1.4 2001/06/20 04:26:07 remm Exp $ + $Id: build.xml,v 1.5 2001/07/27 22:54:08 rwaldhoff Exp $ --> @@ -74,6 +74,7 @@ <pathelement location="${junit.jar}"/> <pathelement location="${jsse.jar}"/> <pathelement location="${jnet.jar}"/> + <pathelement location="${log4j.jar}"/> </path> @@ -88,6 +89,8 @@ <pathelement location="${jsse.jar}"/> <pathelement location="${jcert.jar}"/> <pathelement location="${jnet.jar}"/> + <pathelement location="${log4j.jar}"/> + <pathelement location="${conf.home}"/> </path> <!-- Should all tests fail if one does? --> @@ -96,6 +99,8 @@ <!-- The test runner to execute --> <property name="test.runner" value="junit.textui.TestRunner"/> <property name="test.entry" value="org.apache.commons.httpclient.TestAll"/> + <property name="test-local.entry" value="org.apache.commons.httpclient.TestAllLocal"/> + <property name="test-external.entry" value="org.apache.commons.httpclient.TestAllExternal"/> <!-- HTTPS protocol handler, needed for HTTPS unit tests --> <property name="java.protocol.handler.pkgs" value="-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol"/> @@ -229,5 +234,40 @@ </java> </target> + <target name="test-local" depends="compile.tests" if="test-local.entry" + description="Run all local unit test cases"> + <!-- + <junit printsummary="yes" fork="on" haltonfailure="yes"> + <formatter type="plain" usefile="false"/> + <test name="${test-local.entry}"/> + <classpath refid="test.classpath"/> + </junit> + --> + + <java classname="${test.runner}" fork="yes" + failonerror="${test.failonerror}"> + <jvmarg value="${java.protocol.handler.pkgs}"/> + <arg value="${test-local.entry}"/> + <classpath refid="test.classpath"/> + </java> + </target> + + <target name="test-external" depends="compile.tests" if="test-external.entry" + description="Run all external unit test cases"> + <!-- + <junit printsummary="yes" fork="on" haltonfailure="yes"> + <formatter type="plain" usefile="false"/> + <test name="${test-external.entry}"/> + <classpath refid="test.classpath"/> + </junit> + --> + + <java classname="${test.runner}" fork="yes" + failonerror="${test.failonerror}"> + <jvmarg value="${java.protocol.handler.pkgs}"/> + <arg value="${test-external.entry}"/> + <classpath refid="test.classpath"/> + </java> + </target> </project> 1.3 +88 -32 jakarta-commons/httpclient/README.txt Index: README.txt =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/README.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- README.txt 2001/05/18 00:05:14 1.2 +++ README.txt 2001/07/27 22:54:08 1.3 @@ -4,42 +4,51 @@ Welcome to the httpclient component of the Jakarta Commons project. +BUILDING +-------- + To compile the source, you'll want the excellent Ant utility. It can be found here : http://jakarta.apache.org/ant/ -You'll also need an implementation of the -Java Secure Socket Extension, a standard Java -extension available from : +You'll also need: + * an implementation of the Java Secure Socket Extension, + a standard Java extension available from: + http://java.sun.com/products/jsse + + * the log4j logging component, available from: + http://jakarta.apache.org/log4j + +To help the build and test targets find these classes, +you must make a copy of the build.properties.sample file, +rename to build.properties, and modify it to reflect the +location of jsse.jar, jnet.jar, jcert.jar and log4j.jar +on your computer. + +Once you have Ant, JSSE and log4j properly installed, and +your build.properties file properly configured, you are ready +to build the component: - http://java.sun.com/products/jsse +To build a jar : -To let the build and test process use JSSE, you may make a -copy of the build.properties.sample file, rename to -build.properties, and modify it to reflect the location of -the jsse.jar, jnet.jar and jcert.jar on your computer. +$ ant dist -You'll also need to configure your JRE to use JSSE as a -security provider. To do this, edit the java.security file -(typically in [JAVA-HOME]/jre/lib/security) and add the line: +To build the API documentation : -security.provider.<n>=com.sun.net.ssl.internal.ssl.Provider +$ ant javadoc -where <n> is one greater than the existing security.provider.* -properties. +To build the jar and API doc at once : -NOTE: On Windows, the standard JDK install will create two -JRE installations, one in %JAVA_HOME% and the other in -your Program Files folder. Typically the one in Program Files -is the one that matters. +$ ant dist + +Run ant -projecthelp to see a list of all available targets. -(Note that JSSE is only needed at runtime if you are going -to be using HTTPS URLs. You will need it to build from source, -however.) +TESTING +------- -For testing the project, you will also need JUnit : +For testing the project, you will need JUnit: http://www.junit.org/ @@ -52,22 +61,69 @@ the unit tests. It is not needed to build the "regular" classes, nor is it needed at runtime.) -Once you have Ant properly installed, and the -build.properties file correctly reflects the location -of JUnit and JSSE, you are ready to build and test. - To compile and test the component : $ ant test -To build a jar : -$ ant dist +LOGGING +------- -To build the API documentation : +HTTPClient uses log4j for logging. You'll need a copy of +log4j.jar (available from http://jakarta.apache.org/log4j) +in order to compile and run httpclient. -$ ant javadoc +To configure logging, add a file named "log4j.properties" +to your classpath. (The first one found will be used.) +There is an example log4j.properties file in the +/src/conf directory. -To build the jar and API doc at once : -$ ant dist +HTTPS SUPPORT +------------- + +To support the HTTPS protocol, httpclient uses an +implementation of the Java Secure Socket Extension. + +Note that JSSE is only needed at runtime if you want +to use the HTTPS protocol. You will need it to +build from source, however. + +You'll need to set up the JSSE within your Java +security configuration. You can do this by configuring +your JRE installation, or you may do this in code. + +To configure JSSE within your JRE, edit the java.security file +(typically in [JAVA-HOME]/jre/lib/security) and add the line: + + security.provider.<n>=com.sun.net.ssl.internal.ssl.Provider + +where <n> is one greater than the existing security.provider.* +properties. + +NOTE: You may have multiple copies of the JRE installation. +If you're having trouble, you may not have modified the +right file. Search for "java.security" to find additional copies. + +You will also need to set the Java system property: + + java.protocol.handler.pkgs + +to include your JSSE provider. For Sun's implementation of +JSSE, this is: + + com.sun.net.ssl.internal.www.protocol + +For example: + + -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol + + +Alternatively, you may configure the JSSE support in your code, by +invoking the following lines: + + // add the provider + Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + // set the property + System.setProperty("java.protocol.handler.pkgs", + "com.sun.net.ssl.internal.www.protocol");