JBoss Native SVN: r1737 - in trunk/mod_cluster/test/java: org and 2 other directories.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-03 06:26:27 -0400 (Thu, 03 Jul 2008)
New Revision: 1737
Added:
trunk/mod_cluster/test/java/build.xml
trunk/mod_cluster/test/java/org/
trunk/mod_cluster/test/java/org/jboss/
trunk/mod_cluster/test/java/org/jboss/mod_cluster/
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
Log:
Testsuite for mod_cluster.
Added: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml (rev 0)
+++ trunk/mod_cluster/test/java/build.xml 2008-07-03 10:26:27 UTC (rev 1737)
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<!--
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+-->
+<project name="mod_cluster" default="all" basedir=".">
+
+ <!-- See "build.properties.sample" in the top level directory for all -->
+ <!-- property values you must customize for successful building!!! -->
+ <property file="${user.home}/build.properties"/>
+ <property file="build.properties"/>
+
+ <property file="build.properties.default"/>
+
+ <property name="test.classes" value="${basedir}/output/classes"/>
+
+ <property name="compile.source" value="1.5"/>
+
+ <property name="junit.jar" value="${junit.home}/junit.jar"/>
+ <property name="test.runner" value="junit.textui.TestRunner"/>
+
+ <path id="tomcat.test.classpath">
+ <pathelement location="${test.classes}"/>
+ <pathelement location="${junit.jar}"/>
+ <pathelement location="${commons-httpclient.jar}"/>
+ <pathelement location="${commons-logging.jar}"/>
+ <pathelement location="${commons-codec.jar}"/>
+ <pathelement location="${bootstrap.jar}"/>
+ <pathelement location="${annotations-api.jar}"/>
+
+ <fileset dir="${jbosswebjar}/">
+ <include name="jbossweb.jar"/>
+ <include name="servlet-api.jar"/>
+ </fileset>
+
+<!--
+ <fileset dir="${jbossweb.build}/bin/">
+ <include name="tomcat-juli.jar"/>
+ </fileset>
+ -->
+ </path>
+
+ <target name="compile">
+
+ <mkdir dir="${test.classes}"/>
+ <mkdir dir="${test.classes}/conf"/>
+
+ <!-- Compile -->
+ <javac srcdir="." destdir="${test.classes}"
+ debug="${compile.debug}"
+ deprecation="${compile.deprecation}"
+ source="${compile.source}"
+ optimize="${compile.optimize}">
+ <classpath refid="tomcat.test.classpath" />
+ <include name="org/jboss/mod_cluster/**" />
+ </javac>
+
+ </target>
+
+ <target name="all" depends="compile">
+ <copy file="conf/web.xml" todir="${test.classes}/conf"/>
+ <java dir="${test.classes}" classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
+ <arg value="org.jboss.mod_cluster.Maintest"/>
+ <classpath refid="tomcat.test.classpath"/>
+ </java>
+
+ </target>
+</project>
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Client.java 2008-07-03 10:26:27 UTC (rev 1737)
@@ -0,0 +1,154 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+package org.jboss.mod_cluster;
+
+import org.apache.commons.httpclient.*;
+import org.apache.commons.httpclient.methods.*;
+
+public class Client extends Thread {
+
+ private String jsessionid = null;
+ private String URL = null;
+ private String command = null;
+ private int nbtest = 10;
+ private boolean checkcookie = true;
+ private boolean success = false;
+ /*
+ *
+ * Usage:
+ * java Client http://mywebserver:80/ test
+ *
+ * @param args command line arguments
+ * Argument 0 is a URL to a web server
+ * Argument 1 is the command to execute.
+ *
+ */
+ public static void main(String[] args) throws Exception
+ {
+ if (args.length != 2)
+ {
+ System.err.println("missing command line arguments");
+ System.exit(1);
+ }
+ Client client = new Client();
+ client.runit(args[0], args[1], 10, true);
+ client.start();
+ try {
+ client.join();
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public int runit(String URL, String command, int nbtest, boolean checkcookie) throws Exception
+ {
+ this.URL = URL;
+ this.command = command;
+ this.checkcookie = checkcookie;
+ this.nbtest = nbtest;
+
+ return runit();
+ }
+
+ public int runit() throws Exception
+ {
+
+ HttpClient httpClient = new HttpClient();
+ GetMethod pm = new GetMethod(URL);
+
+ System.out.println("Connecting to " + URL);
+
+ Integer connectionTimeout = 40000;
+ pm.getParams().setParameter("http.socket.timeout", connectionTimeout);
+ pm.getParams().setParameter("http.connection.timeout", connectionTimeout);
+ httpClient.getParams().setParameter("http.socket.timeout", connectionTimeout);
+ httpClient.getParams().setParameter("http.connection.timeout", connectionTimeout);
+ if (jsessionid != null) {
+ System.out.println("jsessionid: " + jsessionid);
+ pm.setRequestHeader("Cookie", "JSESSIONID=" + jsessionid);
+ }
+
+ int httpResponseCode = 0;
+ try {
+ httpResponseCode = httpClient.executeMethod(pm);
+ System.out.println("response: " + httpResponseCode);
+ System.out.println("response: " + pm.getStatusLine());
+ if (httpResponseCode == 200) {
+ Cookie[] cookies = httpClient.getState().getCookies();
+ System.out.println( "Cookies: " + cookies);
+ if (cookies != null && cookies.length!=0) {
+ for (int i = 0; i < cookies.length; i++) {
+ Cookie cookie = cookies[i];
+ System.out.println( "Cookie: " + cookie.getName() + ", Value: " + cookie.getValue());
+ if (cookie.getName().equals("JSESSIONID")) {
+ if (jsessionid == null) {
+ jsessionid = cookie.getValue();
+ System.out.println("cookie first time: " + jsessionid);
+ return 0; // first time ok.
+ } else {
+ System.out.println("cookie second time: " + jsessionid);
+ if (jsessionid.compareTo(cookie.getValue()) == 0) {
+ System.out.println("cookie ok");
+ return 0;
+ }
+ }
+ }
+ }
+ } else {
+ // Look in the response to make sure that there is a cookie.
+ int len = (int) pm.getResponseContentLength();
+ if (pm.getResponseBodyAsString(len).indexOf(jsessionid) != -1)
+ return 0;
+ System.out.println("No cookies");
+ }
+ } else {
+ System.out.println("Not 200");
+ }
+ // System.out.println("response:\n" + pm.getResponseBodyAsString(len));
+ } catch(HttpException e) {
+ e.printStackTrace();
+ }
+ System.out.println("DONE: " + httpResponseCode);
+ return httpResponseCode;
+ }
+ public void run() {
+ for (int i = 0; i < nbtest; i++) {
+ try {
+ if (runit() != 0) return;
+ sleep((int)(Math.random() * 1000));
+ } catch (InterruptedException e) {
+ } catch (Exception e) {}
+ }
+ System.out.println("DONE!");
+ success = true;
+ }
+ public boolean getresultok() {
+ return success;
+ }
+
+}
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java 2008-07-03 10:26:27 UTC (rev 1737)
@@ -0,0 +1,206 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+package org.jboss.mod_cluster;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+
+import java.net.InetAddress;
+import java.net.*;
+
+import org.apache.catalina.startup.Embedded;
+import org.apache.catalina.Realm;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.Context;
+import org.apache.catalina.*;
+import org.apache.catalina.connector.Connector;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.catalina.realm.MemoryRealm;
+import org.apache.catalina.core.*;
+
+import org.jboss.web.cluster.ClusterListener;
+
+public class JBossWeb extends Embedded {
+
+ private void copyFile(File in, File out) throws IOException {
+ FileInputStream fis = new FileInputStream(in);
+ FileOutputStream fos = new FileOutputStream(out);
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while((i=fis.read(buf))!=-1) {
+ fos.write(buf, 0, i);
+ }
+ fis.close();
+ fos.close();
+ }
+
+
+ public JBossWeb(String route, String host) throws IOException {
+
+ setCatalinaBase(route);
+ setCatalinaHome(route);
+
+ //Create an Engine
+ Engine baseEngine = createEngine();
+
+ baseEngine.setName(host + "Engine" + route);
+ baseEngine.setDefaultHost(host);
+ baseEngine.setJvmRoute(route);
+ baseEngine.setRealm(null);
+
+ // Create node1/webapps/ROOT and index.html
+ File fd = new File ( route + "/webapps/ROOT");
+ fd.mkdirs();
+ String docBase = fd.getAbsolutePath();
+ String appBase = fd.getParent();
+ fd = new File (route + "/webapps/ROOT" , "index.html");
+ FileWriter out = new FileWriter(fd);
+ out.write(route + ":This is a test\n");
+ out.close();
+
+ // Copy a small servlet for testing.
+ fd = new File ( route + "/webapps/ROOT/WEB-INF/classes");
+ fd.mkdirs();
+ fd = new File (route + "/webapps/ROOT/WEB-INF/classes" , "MyCount.class");
+ File fdin = new File ("MyCount.class");
+ copyFile(fdin, fd);
+
+
+ //Create Host
+ Host baseHost = createHost( host, appBase);
+ baseEngine.addChild( baseHost );
+
+ //Create default context
+ Context rootContext = createContext("/",docBase);
+ rootContext.setIgnoreAnnotations(true);
+ baseHost.addChild( rootContext );
+ addEngine( baseEngine );
+ baseEngine.setService(this);
+ }
+ public void addConnector(int port) throws IOException {
+
+
+ Connector connector = createConnector( (java.net.InetAddress) null,
+ port, "http");
+ // port, "ajp");
+
+ // Look in StandardService to see why it works ;-)
+ addConnector( connector );
+ }
+
+
+ /* Test */
+ public static void main(String[] args) {
+
+ StandardServer server = null;
+ JBossWeb service = null;
+ JBossWeb service2 = null;
+ try {
+ server = (StandardServer) ServerFactory.getServer();
+
+ service = new JBossWeb("node1", "localhost");
+ service.addConnector(8009);
+ server.addService(service);
+
+ service2 = new JBossWeb("node2", "localhost");
+ service2.addConnector(8000);
+ server.addService(service2);
+
+ ClusterListener cluster = new ClusterListener();
+ cluster.setAdvertiseGroupAddress("232.0.0.2");
+ cluster.setAdvertisePort(23364);
+ cluster.setSsl(false);
+ // SSL ?
+ server.addLifecycleListener((LifecycleListener) cluster);
+
+ Service[] services = server.findServices();
+ for (int i = 0; i < services.length; i++) {
+ System.out.println("service[" + i + "]: " + services[i]);
+ Engine engine = (Engine) services[i].getContainer();
+ System.out.println("engine: " + engine);
+ // System.out.println("service: " + engine.getService());
+ // System.out.println("connectors: " + engine.getService().findConnectors());
+ System.out.println("JFC connectors: " + services[i].findConnectors());
+ Connector [] connectors = services[i].findConnectors();
+ for (int j = 0; j < connectors.length; j++) {
+ System.out.println("JFC connector: " + connectors[j]);
+ }
+ }
+
+ server.start();
+
+ } catch(IOException ex) {
+ ex.printStackTrace();
+ } catch (LifecycleException ex) {
+ ex.printStackTrace();
+ }
+
+ // Wait until httpd as received the nodes information.
+ try {
+ Thread.sleep(15000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+
+ // Start the client and wait for it.
+ Client client = new Client();
+
+ // Wait for it.
+ try {
+ client.runit("http://localhost:7779/ROOT/MyCount", "cmd", 10, true);
+ client.start();
+ client.join();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ if (client.getresultok())
+ System.out.println("Test DONE");
+ else
+ System.out.println("Test FAILED");
+
+ // Stop the server or services.
+ try {
+ server.stop();
+ // service.stop();
+ // service2.stop();
+ } catch (LifecycleException ex) {
+ ex.printStackTrace();
+ }
+
+ // Wait until httpd as received the stop messages.
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
+}
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java 2008-07-03 10:26:27 UTC (rev 1737)
@@ -0,0 +1,47 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+package org.jboss.mod_cluster;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import java.lang.Exception;
+
+
+public class Maintest extends TestCase {
+ public static void main( String args[] ) {
+ TestRunner.run(suite());
+ }
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTest(new TestSuite(TestBase.class));
+ return suite;
+ }
+}
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2008-07-03 10:26:27 UTC (rev 1737)
@@ -0,0 +1,131 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+
+package org.jboss.mod_cluster;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.catalina.Engine;
+import org.apache.catalina.ServerFactory;
+import org.apache.catalina.Service;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardServer;
+
+import org.jboss.web.cluster.ClusterListener;
+
+public class TestBase extends TestCase {
+
+ /* Test */
+ public void testBase() {
+
+ StandardServer server = null;
+ JBossWeb service = null;
+ JBossWeb service2 = null;
+ try {
+ server = (StandardServer) ServerFactory.getServer();
+
+ service = new JBossWeb("node1", "localhost");
+ service.addConnector(8009);
+ server.addService(service);
+
+ service2 = new JBossWeb("node2", "localhost");
+ service2.addConnector(8000);
+ server.addService(service2);
+
+ ClusterListener cluster = new ClusterListener();
+ cluster.setAdvertiseGroupAddress("232.0.0.2");
+ cluster.setAdvertisePort(23364);
+ cluster.setSsl(false);
+ // SSL ?
+ server.addLifecycleListener((LifecycleListener) cluster);
+
+ Service[] services = server.findServices();
+ for (int i = 0; i < services.length; i++) {
+ System.out.println("service[" + i + "]: " + services[i]);
+ Engine engine = (Engine) services[i].getContainer();
+ System.out.println("engine: " + engine);
+ // System.out.println("service: " + engine.getService());
+ // System.out.println("connectors: " + engine.getService().findConnectors());
+ System.out.println("JFC connectors: " + services[i].findConnectors());
+ Connector [] connectors = services[i].findConnectors();
+ for (int j = 0; j < connectors.length; j++) {
+ System.out.println("JFC connector: " + connectors[j]);
+ }
+ }
+
+ server.start();
+
+ } catch(IOException ex) {
+ ex.printStackTrace();
+ } catch (LifecycleException ex) {
+ ex.printStackTrace();
+ }
+
+ // Wait until httpd as received the nodes information.
+ try {
+ Thread.sleep(15000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+
+ // Start the client and wait for it.
+ Client client = new Client();
+
+ // Wait for it.
+ try {
+ client.runit("http://localhost:7779/ROOT/MyCount", "cmd", 10, true);
+ client.start();
+ client.join();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ if (client.getresultok())
+ System.out.println("Test DONE");
+ else
+ System.out.println("Test FAILED");
+
+ // Stop the server or services.
+ try {
+ server.stop();
+ // service.stop();
+ // service2.stop();
+ } catch (LifecycleException ex) {
+ ex.printStackTrace();
+ }
+
+ // Wait until httpd as received the stop messages.
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
+}
16 years, 6 months
JBoss Native SVN: r1736 - in trunk/mod_cluster/test/java: conf and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-03 06:08:43 -0400 (Thu, 03 Jul 2008)
New Revision: 1736
Added:
trunk/mod_cluster/test/java/conf/
trunk/mod_cluster/test/java/conf/web.xml
Log:
The web.xml for the jbossweb test applications.
Added: trunk/mod_cluster/test/java/conf/web.xml
===================================================================
--- trunk/mod_cluster/test/java/conf/web.xml (rev 0)
+++ trunk/mod_cluster/test/java/conf/web.xml 2008-07-03 10:08:43 UTC (rev 1736)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <servlet>
+ <servlet-name>invoker</servlet-name>
+ <servlet-class>
+ org.apache.catalina.servlets.InvokerServlet
+ </servlet-class>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>0</param-value>
+ </init-param>
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>invoker</servlet-name>
+ <url-pattern>/ROOT/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
16 years, 6 months
JBoss Native SVN: r1735 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-03 03:51:31 -0400 (Thu, 03 Jul 2008)
New Revision: 1735
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Do'nt change shared information if it is already initialized.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-02 12:30:49 UTC (rev 1734)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-03 07:51:31 UTC (rev 1735)
@@ -157,9 +157,9 @@
(*worker)->s->route[PROXY_WORKER_MAX_ROUTE_SIZ] = '\0';
/* XXX: We need that information from TC */
(*worker)->s->redirect[0] = '\0';
+ (*worker)->s->lbstatus = 0;
+ (*worker)->s->lbfactor = -1; /* prevent using the node using status message */
}
- (*worker)->s->lbstatus = 0;
- (*worker)->s->lbfactor = -1; /* prevent using the node using status message */
if (!reuse) {
/*
16 years, 6 months
JBoss Native SVN: r1734 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-02 08:30:49 -0400 (Wed, 02 Jul 2008)
New Revision: 1734
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Oops iscontext_host_ok() also test mapping.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-02 09:31:16 UTC (rev 1733)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-02 12:30:49 UTC (rev 1734)
@@ -582,7 +582,7 @@
/* check for /context[/] in the URL */
len = strlen(context->context);
if (strncmp(r->uri, context->context, len) == 0) {
- if (r->uri[len] == '\0' || r->uri[len] == '/') {
+ if (r->uri[len] == '\0' || r->uri[len-1] == '/') {
/* Check status */
switch (context->status)
{
@@ -761,8 +761,8 @@
while (!mycandidate && !checked_standby) {
worker = (proxy_worker *)balancer->workers->elts;
for (i = 0; i < balancer->workers->nelts; i++, worker++) {
- if (worker->id == 0)
- continue; /* marked removed */
+ if (worker->id == 0)
+ continue; /* marked removed */
/* standby logic
* lbfactor: -1 broken node.
16 years, 6 months
JBoss Native SVN: r1733 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-07-02 05:31:16 -0400 (Wed, 02 Jul 2008)
New Revision: 1733
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange mapping.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-26 15:24:05 UTC (rev 1732)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-07-02 09:31:16 UTC (rev 1733)
@@ -675,7 +675,7 @@
vhosts = apr_palloc(r->pool, sizeof(int)*sizevhost);
sizevhost = host_storage->get_ids_used_host(vhosts);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "get_context_host_balancer testing node %s", node->mess.JVMRoute);
+ "get_context_host_balancer testing node %s for %s", node->mess.JVMRoute, r->uri);
for (i=0; i<sizevhost; i++) {
hostinfo_t *vhost;
host_storage->read_host(vhosts[i], &vhost);
@@ -701,16 +701,20 @@
/* check for /context[/] in the URL */
len = strlen(context->context);
if (strncmp(r->uri, context->context, len) == 0) {
- if (r->uri[len] == '\0' || r->uri[len] == '/') {
+ if (r->uri[len] == '\0' || r->uri[len-1] == '/') {
/* Check status */
switch (context->status)
{
case ENABLED:
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "get_context_host_balancer found context %s", context->context);
return node->mess.balancer;
break;
case DISABLED:
/* Only the request with sessionid ok for it */
if (hassession_byname(r, node->mess.balancer, conf))
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "get_context_host_balancer found (DISABLED) context %s", context->context);
return node->mess.balancer;
break;
}
@@ -721,6 +725,8 @@
}
}
}
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "get_context_host_balancer NOT found");
return NULL;
}
16 years, 6 months