JBoss Native SVN: r2367 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-17 05:27:29 -0400 (Tue, 17 Mar 2009)
New Revision: 2367
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Fix for MODCLUSTER-63.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-17 08:35:10 UTC (rev 2366)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-17 09:27:29 UTC (rev 2367)
@@ -1484,7 +1484,14 @@
if (*(worker->s->route) && strcmp(worker->s->route, route) == 0) {
/* that is the worker corresponding to the route */
if (worker && PROXY_WORKER_IS_USABLE(worker)) {
- return worker;
+ /* The context may not be available */
+ nodeinfo_t *node;
+ if (node_storage->read_node(worker->id, &node) != APR_SUCCESS)
+ return NULL; /* can't read node */
+ if (iscontext_host_ok(r, balancer, node))
+ return worker;
+ else
+ return NULL; /* application has been removed from the node */
} else {
/*
* If the worker is in error state run
15 years, 12 months
JBoss Native SVN: r2366 - trunk/mod_cluster/test/java/org/jboss/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-17 04:35:10 -0400 (Tue, 17 Mar 2009)
New Revision: 2366
Added:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailAppover.java
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java
Log:
Test for MODCLUSTER-63.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java 2009-03-17 01:42:10 UTC (rev 2365)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/JBossWeb.java 2009-03-17 08:35:10 UTC (rev 2366)
@@ -154,6 +154,17 @@
addEngine( baseEngine );
baseEngine.setService(this);
}
+ void AddContext(String path, String docBase) {
+ Context context = createContext(path, docBase);
+ Engine engine = (Engine) getContainer();
+ Container[] containers = engine.findChildren();
+ for (int j = 0; j < containers.length; j++) {
+ if (containers[j] instanceof Host) {
+ Host host = (Host) containers[j];
+ host.addChild(context);
+ }
+ }
+ }
public JBossWeb(String route, String host) throws IOException {
this(route, host, false);
@@ -191,6 +202,17 @@
return connector;
}
+ public void removeContext(String path) {
+ Engine engine = (Engine) getContainer();
+ Container[] containers = engine.findChildren();
+ for (int j = 0; j < containers.length; j++) {
+ if (containers[j] instanceof StandardHost) {
+ StandardHost host = (StandardHost) containers[j];
+ Context context = host.map(path);
+ containers[j].removeChild(context);
+ }
+ }
+ }
/* Test */
Added: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailAppover.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailAppover.java (rev 0)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailAppover.java 2009-03-17 08:35:10 UTC (rev 2366)
@@ -0,0 +1,151 @@
+/*
+ * 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;
+
+public class TestFailAppover extends TestCase {
+
+ StandardServer server = null;
+
+ /* Test failAppover */
+ public void testFailAppover() {
+
+ boolean clienterror = false;
+ server = Maintest.getServer();
+ JBossWeb service = null;
+ JBossWeb service2 = null;
+ Connector connector = null;
+ Connector connector2 = null;
+ LifecycleListener cluster = null;
+ System.out.println("TestFailAppover Started");
+ try {
+ // server = (StandardServer) ServerFactory.getServer();
+
+ service = new JBossWeb("node3", "localhost");
+ connector = service.addConnector(8011);
+ service.AddContext("/test", "/test");
+ server.addService(service);
+
+ service2 = new JBossWeb("node4", "localhost");
+ connector2 = service2.addConnector(8010);
+ service2.AddContext("/test", "/test");
+ server.addService(service2);
+
+ cluster = Maintest.createClusterListener("232.0.0.2", 23364, false, "dom1");
+ server.addLifecycleListener(cluster);
+ // Maintest.listServices();
+
+ } catch(IOException ex) {
+ ex.printStackTrace();
+ fail("can't start service");
+ }
+
+ // start the server thread.
+ ServerThread wait = new ServerThread(3000, server);
+ wait.start();
+
+ // Wait until httpd as received the nodes information.
+ try {
+ Thread.sleep(30000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+
+ // Start the client and wait for it.
+ Client client = new Client();
+
+ // Wait for it.
+ try {
+ if (client.runit("/ROOT/MyCount", 10, false, true) != 0)
+ clienterror = true;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ clienterror = true;
+ }
+ if (clienterror)
+ fail("Client error");
+
+ // Stop the connector that has received the request...
+ String node = client.getnode();
+ if ("node4".equals(node)) {
+ service2.removeContext("/");
+ node = "node3";
+ } else {
+ service.removeContext("/");
+ node = "node4";
+ }
+
+ // Run a test on it. (it waits until httpd as received the nodes information).
+ client.setnode(node);
+ try {
+ client.setdelay(30000);
+ client.start();
+ client.join();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ if (client.getresultok())
+ System.out.println("Test DONE");
+ else {
+ System.out.println("Test FAILED");
+ clienterror = true;
+ }
+
+ // Stop the server or services.
+ try {
+ wait.stopit();
+ wait.join();
+ server.removeService(service);
+ server.removeLifecycleListener(cluster);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+
+ // Wait until httpd as received the stop messages.
+ Maintest.TestForNodes(cluster, null);
+
+ // Test client result.
+ if (clienterror)
+ fail("Client test failed");
+
+ Maintest.testPort(8011);
+ Maintest.testPort(8010);
+ System.out.println("TestFailAppover Done");
+ }
+}
15 years, 12 months
JBoss Native SVN: r2365 - trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2009-03-16 21:42:10 -0400 (Mon, 16 Mar 2009)
New Revision: 2365
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
Log:
Use MemoryMXBean, not Runtime methods.
Modified: trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
===================================================================
--- trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-03-17 01:41:39 UTC (rev 2364)
+++ trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-03-17 01:42:10 UTC (rev 2365)
@@ -22,6 +22,10 @@
package org.jboss.modcluster.demo.servlet;
import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryUsage;
+import java.util.ArrayList;
+import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -46,22 +50,27 @@
System.gc();
- long free = Runtime.getRuntime().freeMemory() / 2;
+ MemoryUsage usage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
- @SuppressWarnings("unused")
- Object array = null;
+ long max = usage.getMax();
+ long total = (max >= 0) ? max : usage.getCommitted();
+ long free = total - usage.getUsed();
+ // Reserve half the available free memory
+ long reserve = free / 2;
+
+ List<Object> list = new ArrayList<Object>(2);
+
if (free > Integer.MAX_VALUE)
{
- array = new byte[Integer.MAX_VALUE][(int) free / Integer.MAX_VALUE];
+ list.add(new byte[(int) (reserve / Integer.MAX_VALUE)][Integer.MAX_VALUE]);
}
- else
- {
- array = new byte[(int) free];
- }
+ list.add(new byte[(int) (reserve % Integer.MAX_VALUE)]);
+
try
{
+
Thread.sleep(duration);
}
catch (InterruptedException e)
@@ -69,7 +78,7 @@
Thread.currentThread().interrupt();
}
- array = null;
+ list.clear();
System.gc();
15 years, 12 months
JBoss Native SVN: r2364 - in trunk/mod_cluster/src: test/java/org/jboss/modcluster/load/metric and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2009-03-16 21:41:39 -0400 (Mon, 16 Mar 2009)
New Revision: 2364
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/HeapMemoryUsageLoadMetric.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/HeapMemoryUsageLoadMetricTestCase.java
Log:
[MODCLUSTER-62] HeapMemoryUsageLoadMetric fails if max heap is undefined
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/HeapMemoryUsageLoadMetric.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/HeapMemoryUsageLoadMetric.java 2009-03-16 16:52:19 UTC (rev 2363)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/load/metric/impl/HeapMemoryUsageLoadMetric.java 2009-03-17 01:41:39 UTC (rev 2364)
@@ -54,7 +54,12 @@
public double getLoad(LoadContext context)
{
MemoryUsage usage = this.bean.getHeapMemoryUsage();
-
- return ((double) usage.getUsed()) / usage.getMax();
+
+ long max = usage.getMax();
+
+ // Max may be undefined, so fall back to committed
+ double total = (max >= 0) ? max : usage.getCommitted();
+
+ return usage.getUsed() / total;
}
}
Modified: trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/HeapMemoryUsageLoadMetricTestCase.java
===================================================================
--- trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/HeapMemoryUsageLoadMetricTestCase.java 2009-03-16 16:52:19 UTC (rev 2363)
+++ trunk/mod_cluster/src/test/java/org/jboss/modcluster/load/metric/HeapMemoryUsageLoadMetricTestCase.java 2009-03-17 01:41:39 UTC (rev 2364)
@@ -57,6 +57,26 @@
EasyMock.reset(this.bean);
}
+
+ @Test
+ public void getLoadNoMax() throws Exception
+ {
+ LoadContext context = EasyMock.createMock(LoadContext.class);
+
+ MemoryUsage usage = new MemoryUsage(0, 1000, 2000, -1);
+
+ EasyMock.expect(this.bean.getHeapMemoryUsage()).andReturn(usage);
+
+ EasyMock.replay(this.bean);
+
+ double load = this.metric.getLoad(context);
+
+ EasyMock.verify(this.bean);
+
+ Assert.assertEquals(0.5, load, 0.0);
+
+ EasyMock.reset(this.bean);
+ }
@Test
public void createContext()
15 years, 12 months
JBoss Native SVN: r2363 - trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet.
by jbossnative-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2009-03-16 12:52:19 -0400 (Mon, 16 Mar 2009)
New Revision: 2363
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
Log:
[MODCLUSTER-59] Convert duration param to ms
Modified: trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java
===================================================================
--- trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-03-16 16:19:42 UTC (rev 2362)
+++ trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/HeapMemoryLoadServlet.java 2009-03-16 16:52:19 UTC (rev 2363)
@@ -42,7 +42,7 @@
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException
{
- int duration = Integer.parseInt(this.getParameter(request, DURATION, DEFAULT_DURATION));
+ int duration = Integer.parseInt(this.getParameter(request, DURATION, DEFAULT_DURATION)) * 1000;
System.gc();
15 years, 12 months
JBoss Native SVN: r2362 - in trunk/mod_cluster/src/test: resources/test-configs/mod-cluster-jbossas/deploy and 3 other directories.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2009-03-16 12:19:42 -0400 (Mon, 16 Mar 2009)
New Revision: 2362
Added:
trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/
trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/WEB-INF/
trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/WEB-INF/web.xml
Modified:
trunk/mod_cluster/src/test/java/org/jboss/modcluster/test/mcmp/MCMPTestCase.java
trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/jbossweb.sar/server.xml
Log:
Use new webapp for testing, since ROOT is now excluded by default.
Modified: trunk/mod_cluster/src/test/java/org/jboss/modcluster/test/mcmp/MCMPTestCase.java
===================================================================
--- trunk/mod_cluster/src/test/java/org/jboss/modcluster/test/mcmp/MCMPTestCase.java 2009-03-16 12:48:17 UTC (rev 2361)
+++ trunk/mod_cluster/src/test/java/org/jboss/modcluster/test/mcmp/MCMPTestCase.java 2009-03-16 16:19:42 UTC (rev 2362)
@@ -51,9 +51,11 @@
public class MCMPTestCase
{
private static final String MOD_CLUSTER_SERVICE = "jboss.web:service=ModCluster";
- private static final String ROOT_CONTEXT = "jboss.web.deployment:war=/ROOT";
+ private static final String TEST_CONTEXT = "jboss.web.deployment:war=/test";
private static final String WEB_SERVER = "jboss.web:service=WebServer";
- private static final List<String> expectedContexts = Arrays.asList("/", "/invoker", "/juddi", "/jbossws", "/jmx-console", "/web-console");
+ private static final List<String> expectedContexts = Arrays.asList("/test");
+ private static final String expectedJvmRoute = "node1";
+ private static final String expectedAliases = "localhost";
private MockProxy proxy = new MockProxy();
private MBeanServerConnection server;
@@ -65,7 +67,7 @@
public void init() throws Exception
{
this.server = new MBeanServerConnector(0).getServer();
- this.rootContext = ObjectName.getInstance(ROOT_CONTEXT);
+ this.rootContext = ObjectName.getInstance(TEST_CONTEXT);
this.webServer = ObjectName.getInstance(WEB_SERVER);
this.modClusterService = ObjectName.getInstance(MOD_CLUSTER_SERVICE);
@@ -86,7 +88,7 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.CONFIG, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Assert.assertFalse(request.getParameters().isEmpty());
Set<String> contexts = new HashSet<String>(expectedContexts);
@@ -103,10 +105,10 @@
Assert.assertSame(MCMPRequestType.ENABLE_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Map<String, String> parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
String context = parameters.get("Context");
Assert.assertTrue(context, contexts.remove(context));
}
@@ -117,7 +119,7 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.STATUS, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Map<String, String> parameters = request.getParameters();
Assert.assertEquals(1, parameters.size());
String load = parameters.get("Load");
@@ -130,7 +132,7 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.STATUS, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
parameters = request.getParameters();
Assert.assertEquals(1, parameters.size());
load = parameters.get("Load");
@@ -157,20 +159,20 @@
Assert.assertSame(MCMPRequestType.STOP_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Map<String, String> parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
Assert.assertEquals("/", parameters.get("Context"));
request = requests.poll();
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.REMOVE_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
Assert.assertEquals("/", parameters.get("Context"));
// Test deploy of webapp
@@ -186,10 +188,10 @@
Assert.assertSame(MCMPRequestType.ENABLE_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
Assert.assertEquals("/", parameters.get("Context"));
}
@@ -215,7 +217,7 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.DISABLE_APP, request.getRequestType());
Assert.assertTrue(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Assert.assertTrue(request.getParameters().toString(), request.getParameters().isEmpty());
// Test ModClusterService.enable()
@@ -233,7 +235,7 @@
Assert.assertSame(MCMPRequestType.ENABLE_APP, request.getRequestType());
Assert.assertTrue(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Assert.assertTrue(request.getParameters().toString(), request.getParameters().isEmpty());
}
@@ -264,10 +266,10 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.STOP_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Map<String, String> parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
String context = parameters.get("Context");
Assert.assertTrue(context, stopContexts.remove(context));
@@ -277,10 +279,10 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.REMOVE_APP, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
parameters = request.getParameters();
Assert.assertEquals(2, parameters.size());
- Assert.assertEquals("localhost", parameters.get("Alias"));
+ Assert.assertEquals(expectedAliases, parameters.get("Alias"));
context = parameters.get("Context");
Assert.assertTrue(context, removeContexts.remove(context));
@@ -291,7 +293,7 @@
Assert.assertNotNull(request);
Assert.assertSame(MCMPRequestType.REMOVE_APP, request.getRequestType());
Assert.assertTrue(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Assert.assertTrue(request.getParameters().toString(), request.getParameters().isEmpty());
// Test web server start
@@ -307,7 +309,7 @@
Assert.assertSame(MCMPRequestType.CONFIG, request.getRequestType());
Assert.assertFalse(request.isWildcard());
- Assert.assertEquals("localhost", request.getJvmRoute());
+ Assert.assertEquals(expectedJvmRoute, request.getJvmRoute());
Assert.assertFalse(request.getParameters().isEmpty());
request = requests.poll(20, TimeUnit.SECONDS);
Modified: trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/jbossweb.sar/server.xml
===================================================================
--- trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/jbossweb.sar/server.xml 2009-03-16 12:48:17 UTC (rev 2361)
+++ trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/jbossweb.sar/server.xml 2009-03-16 16:19:42 UTC (rev 2362)
@@ -33,7 +33,7 @@
keystorePass="rmi+ssl" sslProtocol = "TLS" />
-->
- <Engine name="jboss.web" defaultHost="localhost" jvmRoute="localhost">
+ <Engine name="jboss.web" defaultHost="localhost" jvmRoute="${jboss.jvmRoute}">
<!-- The JAAS based authentication and authorization realm implementation
that is compatible with the jboss 3.2.x realm implementation.
Added: trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/WEB-INF/web.xml
===================================================================
--- trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/WEB-INF/web.xml (rev 0)
+++ trunk/mod_cluster/src/test/resources/test-configs/mod-cluster-jbossas/deploy/test.war/WEB-INF/web.xml 2009-03-16 16:19:42 UTC (rev 2362)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+ <distributable/>
+
+</web-app>
15 years, 12 months
JBoss Native SVN: r2361 - trunk/mod_cluster/test/java/org/jboss/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-16 08:48:17 -0400 (Mon, 16 Mar 2009)
New Revision: 2361
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailover.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyRemove.java
Log:
Don't use 8009 to prevent collision with other tests.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java 2009-03-16 09:49:43 UTC (rev 2360)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java 2009-03-16 12:48:17 UTC (rev 2361)
@@ -60,7 +60,7 @@
String name = "node" + i;
nodenames[i] = name;
service[i] = new JBossWeb(name, "localhost");
- service[i].addConnector(8009 + i);
+ service[i].addConnector(8010 + i);
server.addService(service[i]);
} catch(IOException ex) {
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-03-16 09:49:43 UTC (rev 2360)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-03-16 12:48:17 UTC (rev 2361)
@@ -55,7 +55,7 @@
// server = (StandardServer) ServerFactory.getServer();
service = new JBossWeb("node1", "localhost");
- service.addConnector(8009);
+ service.addConnector(8011);
server.addService(service);
service2 = new JBossWeb("node2", "localhost");
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailover.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailover.java 2009-03-16 09:49:43 UTC (rev 2360)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestFailover.java 2009-03-16 12:48:17 UTC (rev 2361)
@@ -58,7 +58,7 @@
// server = (StandardServer) ServerFactory.getServer();
service = new JBossWeb("node3", "localhost");
- connector = service.addConnector(8009);
+ connector = service.addConnector(8011);
server.addService(service);
service2 = new JBossWeb("node4", "localhost");
@@ -149,7 +149,7 @@
if (clienterror)
fail("Client test failed");
- Maintest.testPort(8009);
+ Maintest.testPort(8011);
Maintest.testPort(8010);
System.out.println("TestFailover Done");
}
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyRemove.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyRemove.java 2009-03-16 09:49:43 UTC (rev 2360)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyRemove.java 2009-03-16 12:48:17 UTC (rev 2361)
@@ -58,7 +58,7 @@
// server = (StandardServer) ServerFactory.getServer();
service = new JBossWeb("node3", "localhost");
- connector = service.addConnector(8009);
+ connector = service.addConnector(8010);
server.addService(service);
service2 = new JBossWeb("node4", "localhost");
15 years, 12 months
JBoss Native SVN: r2360 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-16 05:49:43 -0400 (Mon, 16 Mar 2009)
New Revision: 2360
Modified:
trunk/mod_cluster/test/java/load.sh
Log:
Add the waiting time parameter.
Modified: trunk/mod_cluster/test/java/load.sh
===================================================================
--- trunk/mod_cluster/test/java/load.sh 2009-03-16 09:43:46 UTC (rev 2359)
+++ trunk/mod_cluster/test/java/load.sh 2009-03-16 09:49:43 UTC (rev 2360)
@@ -1,2 +1 @@
-java -classpath $HOME/java/commons-codec-1.3.jar:$HOME/java//commons-logging-1.0.4/commons-logging.jar:$HOME/java//commons-httpclient-3.1/commons-httpclient-3.1.jar:output/classes/ org.jboss.mod_cluster.Client http://dev12:9999/myapp/MyCount
-
+java -classpath $HOME/java/commons-codec-1.3.jar:$HOME/java//commons-logging-1.0.4/commons-logging.jar:$HOME/java//commons-httpclient-3.1/commons-httpclient-3.1.jar:output/classes/ org.jboss.mod_cluster.Client http://localhost:8000/myapp/MyCount $1
15 years, 12 months
JBoss Native SVN: r2359 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-16 05:43:46 -0400 (Mon, 16 Mar 2009)
New Revision: 2359
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
* or /* may be confusing other modes. So use /NODE_COMMAND instead.
In fact the tests failed on windoze with:
[error] [client 127.0.0.1] (20025)The given path contained wildcard characters: access to /* failed
due to that problem.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-12 18:01:27 UTC (rev 2358)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-03-16 09:43:46 UTC (rev 2359)
@@ -86,6 +86,9 @@
/* Protocol version supported */
#define VERSION_PROTOCOL "0.0.0"
+/* Internal substitution for node commands */
+#define NODE_COMMAND "/NODE_COMMAND"
+
/* shared memory */
mem_t *contextstatsmem = NULL;
mem_t *nodestatsmem = NULL;
@@ -1095,8 +1098,7 @@
}
/* Process the * APP commands */
- i = strlen(r->uri);
- if (strcmp(r->uri, "*") == 0 || (i>=2 && r->uri[i-1] == '*' && r->uri[i-2] == '/')) {
+ if (strcmp(r->filename, NODE_COMMAND) == 0) {
return (process_node_cmd(r, status, errtype, node));
}
@@ -1364,11 +1366,17 @@
else if (strcasecmp(r->method, "INFO") == 0)
ours = 1;
if (ours) {
+ int i;
/* The method one of ours */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"manager_trans %s (%s)", r->method, r->uri);
r->handler = "mod-cluster";
- r->filename = apr_pstrdup(r->pool, r->uri);
+ i = strlen(r->uri);
+ if (strcmp(r->uri, "*") == 0 || (i>=2 && r->uri[i-1] == '*' && r->uri[i-2] == '/')) {
+ r->filename = apr_pstrdup(r->pool, NODE_COMMAND);
+ } else {
+ r->filename = apr_pstrdup(r->pool, r->uri);
+ }
return OK;
}
@@ -1618,7 +1626,7 @@
/* XXX: Size limit it? */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "manager_handler %s (%s) processing: \"%s\"", r->method, r->uri, buff);
+ "manager_handler %s (%s) processing: \"%s\"", r->method, r->filename, buff);
decodeenc(buff);
if (strcasecmp(r->method, "CONFIG") == 0)
errstring = process_config(r, buff, &errtype);
15 years, 12 months
JBoss Native SVN: r2358 - trunk/mod_cluster/test/java/org/jboss/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-03-12 14:01:27 -0400 (Thu, 12 Mar 2009)
New Revision: 2358
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
Log:
Add a timeout so that connection will really (stop just stop the listener socket
so the already open sockets are still available and usable).
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-03-12 16:54:45 UTC (rev 2357)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-03-12 18:01:27 UTC (rev 2358)
@@ -59,10 +59,12 @@
service = new JBossWeb("sticky3", "localhost");
connector = service.addConnector(8012);
+ connector.setProperty("connectionTimeout", "3000");
server.addService(service);
service2 = new JBossWeb("sticky4", "localhost");
connector2 = service2.addConnector(8011);
+ connector2.setProperty("connectionTimeout", "3000");
server.addService(service2);
cluster = Maintest.createClusterListener("232.0.0.2", 23364, false);
16 years