Added: 
tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/package.html
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/package.html?rev=332794&view=auto
==============================================================================
--- 
tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/package.html 
(added)
+++ 
tomcat/connectors/trunk/jk/jkstatus/src/share/org/apache/jk/status/package.html 
Sat Nov 12 08:04:53 2005
@@ -0,0 +1,44 @@
+<body>

+

+<p>This package contains a set of <code>Task</code> implementations for

+<em>Ant (version 1.6.x or later)</em> that can be used to interact with the

+Apaache mod_jk status page to show, update, disable and stop mod_jk worker.

+For more information, see

+<a 
href="http://jakarta.apache.org/tomcat/connectors-doc/index.html";><strong>JK 
Documenation</strong></a>.</p>

+

+<p>The attributes of each task element correspond

+exactly to the request parameters that are included with an HTTP request

+sent directly to jk status page.  They are summarized as follows:

+</p>

+

+<table>

+  <tr>

+    <th align="center" width="15%">Attribute</th>

+    <th align="center" width="85%">Description</th>

+  </tr>

+  <tr>

+    <td align="center">url</td>

+    <td>

+      The URL of the jk status page you will use to

+      perform the requested operations.  If not specified, defaults to

+      <code>http://localhost:80/jkstatus</code> (which corresponds

+      to a standard installation of Apache mod_jk).

+    </td>

+  </tr>

+  <tr>

+    <td align="center">username</td>

+    <td>

+      The username of a mod_jk status user that has been configured with the

+      <code>Allow user</code> Apache Location constraint.  This attribute is 
optional.

+    </td>

+  </tr>

+  <tr>

+    <td align="center">password</td>

+    <td>

+      The password of a mod_jk status user that has been configured with the

+      <code>Allow user</code> Apache Location constraint.  This attribute is 
optional.

+    </td>

+  </tr>

+</table>

+

+</body>


Added: tomcat/connectors/trunk/jk/jkstatus/test/build.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/jkstatus/test/build.xml?rev=332794&view=auto
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/test/build.xml (added)
+++ tomcat/connectors/trunk/jk/jkstatus/test/build.xml Sat Nov 12 08:04:53 2005
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!-- @author Peter Rossbach -->
+<project name="JkStatusTestcases" basedir="." default="test">
+       <property file="../../../../build/build.properties" />
+       <property file="../../../../build/build.properties.default" />
+       <property name="test.report.logs" value="logs/reports" />
+       <property name="test.results" value="logs/test-results" />
+
+       <property name="compile.optimize" value="true" />
+       <property name="compile.debug" value="true" />
+       <property name="compile.source" value="1.4" />
+       <property name="compile.deprecation" value="true" />
+       <property name="compile.nowarn" value="off" />
+       <property name="compile.encoding" value="ISO-8859-1" />
+       <property name="build.dir" value="build/test" />
+       <property name="src.dir" value="src/share" />
+       <property name="catalina.home" value="../../../../build/build" />
+
+       <!-- Build the classpath -->
+       <path id="project.classpath">
+               <pathelement location="../build/classes" />
+               <pathelement location="${jmx.jar}" />
+               <pathelement location="${commons-logging.jar}" />
+               <pathelement location="${log4j.jar}" />
+               <fileset dir="${catalina.home}/common/endorsed">
+                       <include name="*.jar" />
+               </fileset>
+               <fileset dir="${catalina.home}/common/lib">
+                       <include name="*.jar" />
+               </fileset>
+               <fileset dir="${catalina.home}/server/lib">
+                       <include name="*.jar" />
+               </fileset>
+       </path>
+
+       <target name="build-prepare">
+               <mkdir dir="${build.dir}" />
+       </target>
+
+       <target name="info" description="Shows a information about this ant 
script">
+               <echo>
+                       This ant script implements some testcases to verify the 
key functions of tomcat apache mod_jk jkstatus module.
+                       You find this script at: ${ant.file}
+               </echo>
+       </target>
+
+       <!-- This target compiles all sources out of the 
+                       projects source tree -->
+       <target name="compile" depends="build-prepare" description="This target 
compiles all sources out of the projects source tree">
+
+               <!-- Copies the static resources out of the src tree
+                               to the build/classes dir -->
+               <copy todir="${build.dir}/classes">
+                       <fileset dir="${src.dir}">
+                               <include name="**" />
+                               <exclude name="**/*.java" />
+                       </fileset>
+               </copy>
+
+               <!-- Compiles all sources -->
+               <javac destdir="${build.dir}/classes" srcdir="${src.dir}" 
includes="**/*.java" excludes="**/.svn/**" deprecation="${compile.deprecation}" 
debug="${compile.debug}" source="${compile.source}" 
optimize="${compile.optimize}" nowarn="${compile.nowarn}" 
encoding="${compile.encoding}">
+                       <classpath>
+                               <path refid="project.classpath" />
+                       </classpath>
+               </javac>
+       </target>
+
+       <target name="test" depends="compile" description="Run unit tests">
+               <delete dir="${test.results}" />
+               <mkdir dir="${test.results}" />
+               <junit fork="yes" failureProperty="test.failure">
+                       <jvmarg value="-Dcatalina.base=${basedir}" />
+                       <jvmarg value="-Dcatalina.home=${catalina.home}" />
+                       <jvmarg 
value="-Dlog4j.configuration=file:conf/log4j.xml" />
+                       <classpath>
+                               <pathelement location="${build.dir}/classes" />
+                               <path refid="project.classpath" />
+                       </classpath>
+                       <formatter type="plain" usefile="false" />
+                       <formatter type="xml" />
+                       <batchtest todir="${test.results}">
+                               <fileset dir="${build.dir}/classes" 
includes="**/*Test.class" />
+                       </batchtest>
+               </junit>
+               <mkdir dir="${test.report.logs}" />
+               <junitreport todir="${test.report.logs}">
+                       <fileset dir="${test.results}" />
+                       <report format="frames" todir="${test.report.logs}" />
+               </junitreport>
+               <antcall target="checktest" />
+       </target>
+
+       <target name="checktest" if="test.failure">
+               <fail message="some test failed" />
+       </target>
+
+       <target name="clean">
+               <delete dir="${build}/dir" />
+               <delete dir="build" />
+               <delete dir="${test.report.logs}" />
+               <delete dir="${test.results}" />
+               <delete dir="logs" />
+       </target>
+</project>

Added: tomcat/connectors/trunk/jk/jkstatus/test/conf/jkstatus.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/jkstatus/test/conf/jkstatus.xml?rev=332794&view=auto
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/test/conf/jkstatus.xml (added)
+++ tomcat/connectors/trunk/jk/jkstatus/test/conf/jkstatus.xml Sat Nov 12 
08:04:53 2005
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jk:status xmlns:jk="http://jakarta.apache.org";>
+  <jk:server name="localhost" port="80" software="Apache/2.0.54 (Win32) 
mod_ssl/2.0.54 OpenSSL/0.9.7g mod_jk/1.2.15" version="1.2.15" />
+  <jk:balancers>
+  <jk:balancer id="0" name="lb" type="lb" sticky="True" stickyforce="False" 
retries="3" recover="60" >
+      <jk:member id="0" name="node1" type="ajp13" host="localhost" port="9012" 
address="127.0.0.1:9012" status="OK" lbfactor="1" lbvalue="1" elected="0" 
readed="0" transferred="0" errors="0" busy="0" />
+      <jk:member id="1" name="node2" type="ajp13" host="localhost" port="9022" 
address="127.0.0.1:9022" status="OK" lbfactor="1" lbvalue="1" elected="0" 
readed="0" transferred="0" errors="0" busy="0" />
+    <jk:map type="Wildchar" uri="/ClusterTest/*" context="/ClusterTest/*" />
+    <jk:map type="Exact" uri="/ClusterTest" context="/ClusterTest" />
+    <jk:map type="Wildchar" uri="/myapps/*" context="/myapps/*" />
+    <jk:map type="Exact" uri="/myapps" context="/myapps" />
+  </jk:balancer>
+  </jk:balancers>
+</jk:status>
+

Added: tomcat/connectors/trunk/jk/jkstatus/test/conf/log4j.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/jkstatus/test/conf/log4j.xml?rev=332794&view=auto
==============================================================================
--- tomcat/connectors/trunk/jk/jkstatus/test/conf/log4j.xml (added)
+++ tomcat/connectors/trunk/jk/jkstatus/test/conf/log4j.xml Sat Nov 12 08:04:53 
2005
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>

+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

+<!-- ===================================================================== -->

+<!-- -->

+<!-- Log4j Configuration -->

+<!-- -->

+<!-- ===================================================================== -->

+<!-- $Id:$ -->

+<!--

+| For more configuration infromation and examples see the Jakarta Log4j

+| owebsite: http://jakarta.apache.org/log4j

+-->

+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"; 
debug="false">

+

+<!-- ============================== -->

+<!-- Append messages to the console -->

+<!-- ==============================-->

+

+<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

+<param name="Target" value="System.out"/>

+<layout class="org.apache.log4j.PatternLayout">

+<!--The default pattern: Date Priority [Category] Message\n-->

+<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>

+</layout>

+</appender>

+

+

+<category name="org.apache.jk.status" 

+           additivity="false"> 

+   <priority value="info" />

+   <appender-ref ref="CONSOLE" />

+</category>

+

+<category name="org.apache.catalina" 

+           additivity="false"> 

+   <priority value="info" />

+   <appender-ref ref="CONSOLE" />

+</category>

+<category name="org.apache.tomcat" 

+           additivity="false"> 

+   <priority value="error" />

+   <appender-ref ref="CONSOLE" />

+</category>

+<category name="org.apache.naming" 

+           additivity="false"> 

+   <priority value="info" />

+   <appender-ref ref="CONSOLE" />

+</category>

+<category name="org.apache.commons" 

+           additivity="false"> 

+   <priority value="info" />

+   <appender-ref ref="CONSOLE" />

+</category>

+

+<!-- Setup the Root c  -->

+<root>

+<appender-ref ref="CONSOLE"/>

+</root>

+</log4j:configuration> 

+


Added: 
tomcat/connectors/trunk/jk/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java?rev=332794&view=auto
==============================================================================
--- 
tomcat/connectors/trunk/jk/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java
 (added)
+++ 
tomcat/connectors/trunk/jk/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java
 Sat Nov 12 08:04:53 2005
@@ -0,0 +1,46 @@
+package org.apache.jk.status;

+

+import java.io.IOException;

+import java.io.StringReader;

+

+import junit.framework.TestCase;

+

+import org.apache.tomcat.util.digester.Digester;

+import org.xml.sax.SAXException;

+

+/**

+ * @author Peter Rossbach

+ *  

+ */

+public class JkStatusParserTest extends TestCase {

+

+       public void testDigester() throws IOException, SAXException {

+               Digester digester = JkStatusParser.createDigester();

+        String example = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"

+                       +  "<jk:status xmlns:jk=\"http://jakarta.apache.org\";>"

+                       +  "<jk:server name=\"localhost\" port=\"80\" 
software=\"Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g 
mod_jk/1.2.13-dev\" version=\"1.2.12\" />"

+                       +  "<jk:balancers>"

+                       +  "<jk:balancer id=\"0\" name=\"lb\" type=\"lb\" 
sticky=\"True\" stickyforce=\"False\" retries=\"3\" recover=\"60\" >"

+                       +  "<jk:member id=\"0\" name=\"node1\" type=\"ajp13\" 
host=\"localhost\" port=\"9012\" address=\"127.0.0.1:9012\" status=\"OK\" 
lbfactor=\"1\" lbvalue=\"1\" elected=\"0\" readed=\"0\" transferred=\"0\" 
errors=\"0\" busy=\"0\" />"

+                       +  "<jk:member id=\"1\" name=\"node2\" type=\"ajp13\" 
host=\"localhost\" port=\"9022\" address=\"127.0.0.1:9022\" status=\"OK\" 
lbfactor=\"1\" lbvalue=\"1\" elected=\"0\" readed=\"0\" transferred=\"0\" 
errors=\"0\" busy=\"0\" />"

+                       +  "<jk:map type=\"Wildchar\" uri=\"/ClusterTest/*\" 
context=\"/ClusterTest/*\" />"

+                       +  "<jk:map type=\"Exact\" uri=\"/ClusterTest\" 
context=\"/ClusterTest\" />"

+                       +  "<jk:map type=\"Wildchar\" uri=\"/myapps/*\" 
context=\"/myapps/*\" />"

+                       +  "<jk:map type=\"Exact\" uri=\"/myapps\" 
context=\"/myapps\" />"

+                       +  "</jk:balancer>"

+                       +  "</jk:balancers>"

+                       +  "</jk:status>" ;

+               StringReader reader = new StringReader(example);

+               JkStatus status = (JkStatus) digester

+                               .parse(reader);

+               assertNotNull(status);

+        assertNotNull(status.getServer());

+        assertEquals(1,status.getBalancers().size());

+        JkBalancer balancer = (JkBalancer)status.getBalancers().get(0);

+        assertEquals(2,balancer.getBalancerMembers().size());

+        
assertEquals("node1",((JkBalancerMember)balancer.getBalancerMembers().get(0)).getName());

+        
assertEquals("node2",((JkBalancerMember)balancer.getBalancerMembers().get(1)).getName());

+        assertEquals(4,balancer.getBalancerMappings().size());

+       }

+

+}
\ No newline at end of file

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=332794&r1=332793&r2=332794&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Sat Nov 12 08:04:53 2005
@@ -99,6 +99,9 @@
       <fix>
         Http11Protocol now register RequestProcessor at JMX and show current 
usage inside manager app. (pero)
       </fix>
+      <add>
+        JkStatus Ant tasks for mod_jk 1.2.15. (pero)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Jasper">



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to