From 9401f816dd0d9d550fe98a8507224bde51c4b847 Mon Sep 17 00:00:00 2001 From: hongbotian Date: Mon, 30 Nov 2015 02:41:33 -0500 Subject: upload tomcat JIRA: BOTTLENECK-7 Change-Id: I875d474869efd76ca203c30b60ebc0c3ee606d0e Signed-off-by: hongbotian --- .../jkstatus/test/build.xml | 120 +++++++++++++++++++++ .../jkstatus/test/conf/jkstatus.xml | 31 ++++++ .../jkstatus/test/conf/log4j.xml | 76 +++++++++++++ .../org/apache/jk/status/JkStatusParserTest.java | 63 +++++++++++ 4 files changed, 290 insertions(+) create mode 100644 rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/build.xml create mode 100644 rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/jkstatus.xml create mode 100644 rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/log4j.xml create mode 100644 rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java (limited to 'rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test') diff --git a/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/build.xml b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/build.xml new file mode 100644 index 00000000..8725ba19 --- /dev/null +++ b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/build.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/jkstatus.xml b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/jkstatus.xml new file mode 100644 index 00000000..e658b76d --- /dev/null +++ b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/jkstatus.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + diff --git a/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/log4j.xml b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/log4j.xml new file mode 100644 index 00000000..c31ba8ee --- /dev/null +++ b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/conf/log4j.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java new file mode 100644 index 00000000..3f7fc081 --- /dev/null +++ b/rubbos/app/tomcat-connectors-1.2.32-src/jkstatus/test/src/share/org/apache/jk/status/JkStatusParserTest.java @@ -0,0 +1,63 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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 = "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" ; + + 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()); + } + +} -- cgit 1.2.3-korg