JBoss Native SVN: r2198 - trunk/build/windows.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-22 05:45:50 -0500 (Thu, 22 Jan 2009)
New Revision: 2198
Modified:
trunk/build/windows/build.bat
Log:
Write the environment in bat file so it can be reused for tests.
Modified: trunk/build/windows/build.bat
===================================================================
--- trunk/build/windows/build.bat 2009-01-22 07:46:40 UTC (rev 2197)
+++ trunk/build/windows/build.bat 2009-01-22 10:45:50 UTC (rev 2198)
@@ -46,14 +46,23 @@
echo Params : %*
echo.
+set ENV_BAT=%BUILD_HOME%\env.%1.%2.bat
+echo Writting conf in %ENV_BAT%
+echo REM Generated by %PROGNAME% %DATE% %TIME% > %ENV_BAT%
+echo REM Params : %* >> %ENV_BAT%
+
REM Check for cygwin in the PATH
-@if "%CYGWIN_INSTALL_DIR%" == "" set CYGWIN_INSTALL_DIR=C:\cygwin
+@if "%CYGWIN_INSTALL_DIR%" == "" (
+ set CYGWIN_INSTALL_DIR=C:\cygwin
+ echo set CYGWIN_INSTALL_DIR=C:\cygwin >> %ENV_BAT%
+)
@if exist "%CYGWIN_INSTALL_DIR%\" goto cmdFoundCygwin
echo CYGWIN_INSTALL_DIR points to invalid directory %CYGWIN_INSTALL_DIR%
goto cmdEnd
:cmdFoundCygwin
set PATH=%CYGWIN_INSTALL_DIR%\bin;%PATH%
+echo set PATH=%CYGWIN_INSTALL_DIR%\bin;%PATH% >> %ENV_BAT%
REM Then for an acceptable location.
bash check_path.sh
@@ -66,9 +75,13 @@
@if exist "%LOCAL_DIR%\conf.%COMPUTERNAME%.bat" (
echo "Using %COMPUTERNAME% specific configuration"
call "%LOCAL_DIR%\conf.%COMPUTERNAME%"
+ echo call "%LOCAL_DIR%\conf.%COMPUTERNAME%" >> %ENV_BAT%
) else (
echo "Using default configuration"
- @if "%TOOLS_ROOT%" == "" set TOOLS_ROOT=C:\opt
+ @if "%TOOLS_ROOT%" == "" (
+ set TOOLS_ROOT=C:\opt
+ echo set TOOLS_ROOT=C:\opt >> %ENV_BAT%
+ )
@if exist "%TOOLS_ROOT%\" goto cmdSetTools
echo TOOLS_ROOT points to invalid directory %TOOLS_ROOT%
goto cmdEnd
@@ -76,8 +89,11 @@
:cmdSetTools
@echo Using Tools from %TOOLS_ROOT%
set MSVS8VC=%TOOLS_ROOT%\MSVS8\VC
+ echo set MSVS8VC=%TOOLS_ROOT%\MSVS8\VC >> %ENV_BAT%
set MSVS6VC=%TOOLS_ROOT%\MSVS6
+ echo set MSVS6VC=%TOOLS_ROOT%\MSVS6 >> %ENV_BAT%
set MSWPSDK=%TOOLS_ROOT%\PSDK6
+ echo set MSWPSDK=%TOOLS_ROOT%\PSDK6 >> %ENV_BAT%
)
set BUILD_OS=windows
@@ -87,9 +103,17 @@
set INCLUDE_PRE64PRA=
set INCLUDE_BUFFEROVERFLOWU=
+echo set BUILD_OS=windows >> %ENV_BAT%
+echo set CRT_REDIST= >> %ENV_BAT%
+echo set USE_PLATFORM_SDK= >> %ENV_BAT%
+echo set APR_DECLARE_STATIC= >> %ENV_BAT%
+echo set INCLUDE_PRE64PRA= >> %ENV_BAT%
+echo set INCLUDE_BUFFEROVERFLOWU= >> %ENV_BAT%
+
@if not "%1" == "sdk" goto checkSTATIC
shift
set USE_PLATFORM_SDK=1
+echo set USE_PLATFORM_SDK=1 >> %ENV_BAT%
:checkSTATIC
@if /i "%1" == "static" goto makeSTATIC
@@ -98,9 +122,11 @@
:makeSTATIC
shift
set APR_DECLARE_STATIC=1
+echo set APR_DECLARE_STATIC=1 >> %ENV_BAT%
:checkCPU
set BUILD_CPU=%1
+echo set BUILD_CPU=%1 >> %ENV_BAT%
shift
@if /i "%BUILD_CPU%" == "i686" goto cpuX86
@if /i "%BUILD_CPU%" == "x86" goto cpuX86
@@ -116,46 +142,66 @@
:cpuX86
set BUILD_CPU=x86
+echo set BUILD_CPU=x86 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSVS6VC%\vs6vars"
+ echo call "%MSVS6VC%\vs6vars" >> %ENV_BAT%
) else (
call "%MSVS8VC%\bin\vcvars32"
+ echo call "%MSVS8VC%\bin\vcvars32" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\x86\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\x86\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cpuX64
set BUILD_CPU=x64
+echo set BUILD_CPU=x64 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSWPSDK%\SetEnv" /XP64 /RETAIL
+ echo call "%MSWPSDK%\SetEnv" /XP64 /RETAIL >> %ENV_BAT%
) else (
call "%MSVS8VC%\bin\amd64\vcvarsamd64"
+ echo call "%MSVS8VC%\bin\amd64\vcvarsamd64" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cpuI64
set BUILD_CPU=i64
+echo set BUILD_CPU=i64 >> %ENV_BAT%
@if "%USE_PLATFORM_SDK%" == "1" (
call "%MSWPSDK%\SetEnv" /SRV64 /RETAIL
+ echo call "%MSWPSDK%\SetEnv" /SRV64 /RETAIL >> %ENV_BAT%
) else (
REM Update to correct IA64 paths
call "%MSVS8VC%\bin\amd64\vcvarsamd64"
+ echo call "%MSVS8VC%\bin\amd64\vcvarsamd64" >> %ENV_BAT%
set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT
+ echo set CRT_REDIST=%MSVS8VC%\redist\amd64\Microsoft.VC80.CRT >> %ENV_BAT%
)
goto cmdBuild
:cmdBuild
@for /D %%i IN (%INCLUDE%) DO (
- @if exist "%%i\PRE64PRA.H" set INCLUDE_PRE64PRA=1
+ @if exist "%%i\PRE64PRA.H" (
+ set INCLUDE_PRE64PRA=1
+ echo set INCLUDE_PRE64PRA=1 >> %ENV_BAT%
+ )
)
@for /D %%i IN (%LIB%) DO (
- @if exist "%%i\bufferoverflowu.lib" set INCLUDE_BUFFEROVERFLOWU=1
+ @if exist "%%i\bufferoverflowu.lib" (
+ set INCLUDE_BUFFEROVERFLOWU=1
+ echo set INCLUDE_BUFFEROVERFLOWU=1 >> %ENV_BAT%
+ )
)
set INIT=%LOCAL_DIR%
+echo set INIT=%LOCAL_DIR% >> %ENV_BAT%
pushd %BUILD_HOME%\unix
+PAUSE
bash build.sh %1 %2 %3 %4 %5
@if ERRORLEVEL 1 (
echo build.sh failed
15 years, 7 months
JBoss Native SVN: r2197 - trunk/build/daemon.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-22 02:46:40 -0500 (Thu, 22 Jan 2009)
New Revision: 2197
Modified:
trunk/build/daemon/buildmdc.sh
Log:
Run the tests
Modified: trunk/build/daemon/buildmdc.sh
===================================================================
--- trunk/build/daemon/buildmdc.sh 2009-01-22 07:38:12 UTC (rev 2196)
+++ trunk/build/daemon/buildmdc.sh 2009-01-22 07:46:40 UTC (rev 2197)
@@ -29,6 +29,7 @@
echo ""
build_ssl=true
+do_test=true
while [ "x" != "x$1" ]
do
@@ -41,13 +42,23 @@
-no-ssl)
build_ssl=false
;;
+ -no-test)
+ do_test=false
+ ;;
esac
shift
done
(cd ../unix
- if $build_ssl; then
- ./build.sh mod_cluster -ssl -cache
+ if $do_test; then
+ if $build_ssl; then
+ ./build.sh mod_cluster -ssl -cache -test
+ fi
+ ./build.sh mod_cluster -cache -test
+ else
+ if $build_ssl; then
+ ./build.sh mod_cluster -ssl -cache
+ fi
+ ./build.sh mod_cluster -cache
fi
- ./build.sh mod_cluster -cache
)
15 years, 7 months
JBoss Native SVN: r2196 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-22 02:38:12 -0500 (Thu, 22 Jan 2009)
New Revision: 2196
Added:
trunk/build/unix/buildtest.mod_cluster.sh
Log:
Add the test integration in the build.
Added: trunk/build/unix/buildtest.mod_cluster.sh
===================================================================
--- trunk/build/unix/buildtest.mod_cluster.sh (rev 0)
+++ trunk/build/unix/buildtest.mod_cluster.sh 2009-01-22 07:38:12 UTC (rev 2196)
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Copyright(c) 2009 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
+#
+# Run a test of the httpd.
+#
+# $1 : Base directory for the test.
+# $2 : Directory where the package was built.
+# $3 : Directory where downloaded packages are stored.
+# $4 : Name or IP to use for the tests.
+# $5 : Do the SSL stuff.
+
+base=$1
+root=$2
+build_cache_dir=$3
+IPLOCAL=$4
+loc_has_ssl=$5
+
+echo ""
+echo "Running : `basename $0` $LastChangedDate$"
+echo ""
+
+# the stuff is in /home/jfclere/jbossnative/trunk/build/unix/work/mod_cluster-1.0.0.dev-src/srclib/mod_cluster/src/test/java
+# $root is /home/jfclere/jbossnative/trunk/build/unix/work/mod_cluster-1.0.0.dev-src/output/linux2-x64
+anttestsdir=`cd $root/../../srclib/mod_cluster/test/java; pwd`
+(cd $anttestsdir
+ ant
+) || exit 1
+
+echo ""
+echo "SUCCESS : `basename $0` $LastChangedDate$"
+echo ""
+exit 0
Property changes on: trunk/build/unix/buildtest.mod_cluster.sh
___________________________________________________________________
Name: svn:executable
+ *
15 years, 7 months
JBoss Native SVN: r2195 - in trunk/mod_cluster/src: main/java/org/jboss/modcluster/ha and 5 other directories.
by jbossnative-commits@lists.jboss.org
Author: pferraro
Date: 2009-01-21 23:11:30 -0500 (Wed, 21 Jan 2009)
New Revision: 2195
Removed:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java
trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java
Log:
Replace AddressPort with InetSocketAddress
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.util.List;
import org.apache.catalina.Container;
@@ -40,7 +41,6 @@
import org.jboss.modcluster.config.NodeConfiguration;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPUtils;
@@ -97,7 +97,7 @@
public synchronized void init()
{
- List<AddressPort> initialProxies = MCMPUtils.parseProxies(this.mcmpConfig.getProxyList());
+ List<InetSocketAddress> initialProxies = MCMPUtils.parseProxies(this.mcmpConfig.getProxyList());
this.mcmpHandler.init(initialProxies);
this.loadBalanceFactorProvider = this.loadBalanceFactorProviderFactory.createLoadBalanceFactorProvider();
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerImpl.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -47,7 +48,6 @@
import org.jboss.modcluster.ha.rpc.StringGroupRpcResponse;
import org.jboss.modcluster.ha.rpc.ThrowableGroupRpcResponse;
import org.jboss.modcluster.mcmp.AbstractMCMPHandler;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServer;
@@ -307,7 +307,7 @@
return ((StringGroupRpcResponse) response).getValue();
}
- public void init(List<AddressPort> initialProxies)
+ public void init(List<InetSocketAddress> initialProxies)
{
if (this.singleton.isMasterNode())
{
@@ -315,11 +315,11 @@
}
else
{
- this.localHandler.init(new ArrayList<AddressPort>());
+ this.localHandler.init(new ArrayList<InetSocketAddress>());
if (initialProxies != null)
{
- for (AddressPort proxy : initialProxies)
+ for (InetSocketAddress proxy : initialProxies)
{
this.sendDiscoveryEventToPartition(proxy.getAddress(), proxy.getPort(), true);
}
@@ -426,8 +426,8 @@
private synchronized void sendDiscoveryEventToPartition(InetAddress address, int port, boolean addition)
{
- AddressPort ap = new AddressPort(address, port);
- MCMPServerDiscoveryEvent event = new MCMPServerDiscoveryEvent(this.serviceKeyProvider.getHAPartition().getClusterNode(), ap, addition, this.discoveryEventIndex.incrementAndGet());
+ InetSocketAddress socketAddress = new InetSocketAddress(address, port);
+ MCMPServerDiscoveryEvent event = new MCMPServerDiscoveryEvent(this.serviceKeyProvider.getHAPartition().getClusterNode(), socketAddress, addition, this.discoveryEventIndex.incrementAndGet());
this.pendingDiscoveryEvents.add(event);
GroupRpcResponse response = this.rpcStub.mcmpServerDiscoveryEvent(event);
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/HAModClusterService.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster.ha;
import java.io.Serializable;
+import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -72,7 +73,6 @@
import org.jboss.modcluster.ha.rpc.ThrowableGroupRpcResponse;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServer;
@@ -532,15 +532,15 @@
synchronized (HAModClusterService.this.proxyChangeDigest)
{
- AddressPort ap = event.getMCMPServer();
+ InetSocketAddress socketAddress = event.getMCMPServer();
if (event.isAddition())
{
- this.coord.localHandler.addProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.addProxy(socketAddress.getAddress(), socketAddress.getPort());
}
else
{
- this.coord.localHandler.removeProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.removeProxy(socketAddress.getAddress(), socketAddress.getPort());
}
HAModClusterService.this.proxyChangeDigest.put(event.getSender(), event);
@@ -846,14 +846,14 @@
continue; // already processed it
}
- AddressPort ap = toCheck.getMCMPServer();
+ InetSocketAddress socketAddress = toCheck.getMCMPServer();
if (toCheck.isAddition())
{
- this.coord.localHandler.addProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.addProxy(socketAddress.getAddress(), socketAddress.getPort());
}
else
{
- this.coord.localHandler.removeProxy(ap.getAddress(), ap.getPort());
+ this.coord.localHandler.removeProxy(socketAddress.getAddress(), socketAddress.getPort());
}
resync = true;
}
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ha/rpc/MCMPServerDiscoveryEvent.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,11 +23,12 @@
package org.jboss.modcluster.ha.rpc;
import java.io.Serializable;
+import java.net.InetSocketAddress;
import net.jcip.annotations.Immutable;
import org.jboss.ha.framework.interfaces.ClusterNode;
-import org.jboss.modcluster.mcmp.AddressPort;
+import org.jboss.modcluster.mcmp.MCMPServer;
/**
* Event object indicating the discovery or requested removal of an
@@ -42,11 +43,11 @@
private static final long serialVersionUID = -4615651826967237065L;
private final ClusterNode sender;
- private final AddressPort mcmpServer;
+ private final InetSocketAddress mcmpServer;
private final boolean addition;
private final int eventIndex;
- public MCMPServerDiscoveryEvent(ClusterNode sender, AddressPort mcmpServer, boolean addition, int eventIndex)
+ public MCMPServerDiscoveryEvent(ClusterNode sender, InetSocketAddress mcmpServer, boolean addition, int eventIndex)
{
assert sender != null : "sender is null";
assert mcmpServer != null : "mcmpServer is null";
@@ -75,7 +76,7 @@
return this.sender;
}
- public AddressPort getMCMPServer()
+ public InetSocketAddress getMCMPServer()
{
return this.mcmpServer;
}
@@ -89,6 +90,4 @@
{
return this.eventIndex;
}
-
-
}
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AbstractMCMPHandler.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -22,6 +22,7 @@
package org.jboss.modcluster.mcmp;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
/**
@@ -37,9 +38,9 @@
*/
public void addProxy(String address)
{
- AddressPort ap = MCMPUtils.parseAddressPort(address);
+ InetSocketAddress socketAddress = MCMPUtils.parseSocketAddress(address);
- this.addProxy(ap.getAddress(), ap.getPort());
+ this.addProxy(socketAddress.getAddress(), socketAddress.getPort());
}
/**
Deleted: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/AddressPort.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.modcluster.mcmp;
-
-import java.io.Serializable;
-import java.net.InetAddress;
-
-/**
- * Simple data object encapsulating an InetAddress and a port.
- *
- * @author Brian Stansberry
- */
-public class AddressPort implements Serializable
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 3835532412744565879L;
-
- private final InetAddress address;
- private final int port;
-
- public AddressPort(InetAddress address, int port)
- {
- this.address = address;
- this.port = port;
- }
-
- public InetAddress getAddress()
- {
- return this.address;
- }
-
- public int getPort()
- {
- return this.port;
- }
-
- @Override
- public boolean equals(Object object)
- {
- if (!(object instanceof AddressPort)) return false;
-
- AddressPort ap = (AddressPort) object;
-
- return (this.port == ap.getPort()) && (((this.address != null) && (ap.address != null)) ? this.address.equals(ap.address) : (this.address == ap.address));
- }
-
- @Override
- public int hashCode()
- {
- int result = 17;
- result += 23 * (this.address == null ? 0 : this.address.hashCode());
- result += 23 * this.port;
- return result;
- }
-
- @Override
- public String toString()
- {
- return "AddressPort{" + this.address + ":" + this.port + "}";
- }
-}
\ No newline at end of file
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPHandler.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.List;
import java.util.Set;
@@ -36,7 +37,7 @@
public interface MCMPHandler
{
/** Initialize the handler with the given list of proxies */
- void init(List<AddressPort> initialProxies);
+ void init(List<InetSocketAddress> initialProxies);
/** Perform any shut down work. */
void shutdown();
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/MCMPUtils.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
package org.jboss.modcluster.mcmp;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
@@ -372,11 +373,11 @@
return requests;
}
- public static AddressPort parseAddressPort(String addressPort)
+ public static InetSocketAddress parseSocketAddress(String addressPort)
{
try
{
- return parseAddressPort(addressPort, 0);
+ return parseSocketAddress(addressPort, 0);
}
catch (UnknownHostException e)
{
@@ -384,19 +385,19 @@
}
}
- public static List<AddressPort> parseProxies(String proxyList)
+ public static List<InetSocketAddress> parseProxies(String proxyList)
{
if ((proxyList == null) || (proxyList.length() == 0)) return Collections.emptyList();
String[] tokens = proxyList.split(",");
- List<AddressPort> proxies = new ArrayList<AddressPort>(tokens.length);
+ List<InetSocketAddress> proxies = new ArrayList<InetSocketAddress>(tokens.length);
for (String token: tokens)
{
try
{
- AddressPort addressPort = parseAddressPort(token.trim(), DEFAULT_PORT);
+ InetSocketAddress addressPort = parseSocketAddress(token.trim(), DEFAULT_PORT);
proxies.add(addressPort);
}
@@ -409,7 +410,7 @@
return proxies;
}
- private static AddressPort parseAddressPort(String addressPort, int defaultPort) throws UnknownHostException
+ private static InetSocketAddress parseSocketAddress(String addressPort, int defaultPort) throws UnknownHostException
{
int pos = addressPort.indexOf(':');
boolean colonExists = (pos >= 0);
@@ -419,7 +420,7 @@
InetAddress inetAddress = (address != null) && (address.length() > 0) ? InetAddress.getByName(address) : null;
- return new AddressPort(inetAddress, port);
+ return new InetSocketAddress(inetAddress, port);
}
/**
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -33,6 +33,7 @@
import java.io.Serializable;
import java.io.Writer;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Collections;
@@ -60,7 +61,6 @@
import org.jboss.modcluster.Utils;
import org.jboss.modcluster.config.MCMPHandlerConfiguration;
import org.jboss.modcluster.mcmp.AbstractMCMPHandler;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPServerState;
@@ -120,7 +120,7 @@
// ------------------------------------------------------------ MCMPHandler
- public void init(List<AddressPort> initialProxies)
+ public void init(List<InetSocketAddress> initialProxies)
{
Lock lock = this.proxiesLock.writeLock();
lock.lock();
@@ -129,7 +129,7 @@
{
if (initialProxies != null)
{
- for (AddressPort initialProxy: initialProxies)
+ for (InetSocketAddress initialProxy: initialProxies)
{
this.addProxyInternal(initialProxy.getAddress(), initialProxy.getPort());
}
Modified: trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java
===================================================================
--- trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/test/java/org/jboss/modcluster/DefaultJBossWebEventHandlerTestCase.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -44,7 +45,6 @@
import org.jboss.modcluster.config.NodeConfiguration;
import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.load.LoadBalanceFactorProviderFactory;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPRequestType;
@@ -87,7 +87,7 @@
// Test advertise = false
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress, 8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress, 8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -104,7 +104,7 @@
// Test advertise = true
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress, 8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress, 8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -125,7 +125,7 @@
// Test advertise = null, proxies configured
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress, 8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress, 8000)));
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
@@ -142,7 +142,7 @@
// Test advertise = null, no proxies configured
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(null);
- List<AddressPort> emptyList = Collections.emptyList();
+ List<InetSocketAddress> emptyList = Collections.emptyList();
this.mcmpHandler.init(emptyList);
@@ -186,7 +186,7 @@
EasyMock.expect(this.mcmpConfig.getProxyList()).andReturn(localHostName);
EasyMock.expect(this.lbfProviderFactory.createLoadBalanceFactorProvider()).andReturn(this.lbfProvider);
- this.mcmpHandler.init(Collections.singletonList(new AddressPort(localAddress, 8000)));
+ this.mcmpHandler.init(Collections.singletonList(new InetSocketAddress(localAddress, 8000)));
EasyMock.expect(this.mcmpConfig.getAdvertise()).andReturn(Boolean.TRUE);
Modified: trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java
===================================================================
--- trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java 2009-01-21 17:37:24 UTC (rev 2194)
+++ trunk/mod_cluster/src/test/java/org/jboss/modcluster/ha/ClusteredMCMPHandlerTestCase.java 2009-01-22 04:11:30 UTC (rev 2195)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
@@ -40,7 +41,6 @@
import org.jboss.modcluster.ha.rpc.GroupRpcResponseFilter;
import org.jboss.modcluster.ha.rpc.MCMPServerDiscoveryEvent;
import org.jboss.modcluster.ha.rpc.StringGroupRpcResponse;
-import org.jboss.modcluster.mcmp.AddressPort;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPRequestType;
@@ -90,7 +90,7 @@
int port = 0;
String key = "key";
- List<AddressPort> list = Collections.singletonList(new AddressPort(address, port));
+ List<InetSocketAddress> list = Collections.singletonList(new InetSocketAddress(address, port));
// Test master case
EasyMock.expect(this.singleton.isMasterNode()).andReturn(true);
@@ -105,7 +105,7 @@
EasyMock.reset(this.localHandler, this.singleton, this.keyProvider, this.partition);
// Test non-master case
- Capture<List<AddressPort>> capturedList = new Capture<List<AddressPort>>();
+ Capture<List<InetSocketAddress>> capturedList = new Capture<List<InetSocketAddress>>();
Capture<Object[]> capturedEvents = new Capture<Object[]>();
EasyMock.expect(this.singleton.isMasterNode()).andReturn(false);
15 years, 7 months
JBoss Native SVN: r2194 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 12:37:24 -0500 (Wed, 21 Jan 2009)
New Revision: 2194
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Skip entry when node_storage->read_node() fails.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-21 16:47:05 UTC (rev 2193)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-21 17:37:24 UTC (rev 2194)
@@ -890,7 +890,8 @@
for (n=0; n<sizenode; n++) {
nodeinfo_t *node;
char *ret;
- node_storage->read_node(nodes[n], &node);
+ if (node_storage->read_node(nodes[n], &node) != APR_SUCCESS)
+ continue;
ret = get_balancer_by_node(r, node, conf, NULL);
if (ret != NULL) {
return ret;
@@ -1002,7 +1003,8 @@
nodeinfo_t *node1;
int lbstatus, lbstatus1;
- node_storage->read_node(mycandidate->id, &node1);
+ if (node_storage->read_node(mycandidate->id, &node1) != APR_SUCCESS)
+ continue;
lbstatus1 = ((mycandidate->s->elected - node1->mess.oldelected) * 1000)/mycandidate->s->lbfactor;
lbstatus = ((worker->s->elected - node->mess.oldelected) * 1000)/worker->s->lbfactor;
lbstatus1 = lbstatus1 + mycandidate->s->lbstatus;
@@ -1321,7 +1323,8 @@
size = node_storage->get_ids_used_node(id);
for (i=0; i<size; i++) {
nodeinfo_t *ou;
- node_storage->read_node(id[i], &ou);
+ if (node_storage->read_node(id[i], &ou) != APR_SUCCESS)
+ continue;
if (ou->mess.remove && (now - ou->updatetime) >= apr_time_from_sec(WAITFORREMOVE) &&
(now - ou->mess.lastcleantry) >= apr_time_from_sec(WAITFORREMOVE)) {
/* remove the node from the shared memory */
15 years, 7 months
JBoss Native SVN: r2193 - trunk/mod_cluster/test/java/org/jboss/mod_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 11:47:05 -0500 (Wed, 21 Jan 2009)
New Revision: 2193
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
Log:
Arrange the tests (wait between tests!).
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java 2009-01-21 16:29:10 UTC (rev 2192)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/Maintest.java 2009-01-21 16:47:05 UTC (rev 2193)
@@ -167,4 +167,48 @@
}
return result;
}
+ /* Check that the nodes are returned by the INFO command */
+ static boolean checkProxyInfo(LifecycleListener lifecycle, String [] nodes) {
+ String result = getProxyInfo(lifecycle);
+ if (result == null) {
+ if (nodes == null)
+ return true;
+ else
+ return false;
+ }
+ /* create array to check the nodes */
+ boolean [] n = null;
+ if (nodes != null && nodes.length>0) {
+ n = new boolean[nodes.length];
+ for (int i=0; i<nodes.length; i++) {
+ n[i] = false;
+ }
+ }
+
+ String [] records = result.split("\n");
+ int l = 0;
+ for (int i=0; i<records.length; i++) {
+ String [] results = records[i].split(",");
+ /* result[0] should be Node: [n] */
+ String [] data = results[0].split(": ");
+ if ("Node".equals(data[0])) {
+ if (n == null)
+ return false; /* we shouldn't have a node */
+ /* result[1] should be Name: node_name */
+ data = results[1].split(": ");
+ for (int j=0; j<nodes.length; j++) {
+ if (nodes[j].equals(data[1])) {
+ n[j] = true; /* found it */
+ }
+ }
+ }
+ }
+ if (n == null)
+ return true; /* done */
+ for (int j=0; j<nodes.length; j++) {
+ if (! n[j])
+ return false; /* not found */
+ }
+ return true;
+ }
}
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-01-21 16:29:10 UTC (rev 2192)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestBase.java 2009-01-21 16:47:05 UTC (rev 2193)
@@ -76,10 +76,15 @@
wait.start();
// Wait until httpd as received the nodes information.
- try {
- Thread.sleep(30000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
+ String [] nodes = new String[2];
+ nodes[0] = "node1";
+ nodes[1] = "node2";
+ while (!Maintest.checkProxyInfo(cluster, nodes)) {
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
}
// Start the client and wait for it.
@@ -117,11 +122,13 @@
fail("Client error");
// Wait until httpd as received the stop messages.
+ while (!Maintest.checkProxyInfo(cluster, null)) {
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
System.gc();
- try {
- Thread.sleep(20000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
- }
}
}
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-01-21 16:29:10 UTC (rev 2192)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestStickyForce.java 2009-01-21 16:47:05 UTC (rev 2193)
@@ -56,11 +56,11 @@
try {
// server = (StandardServer) ServerFactory.getServer();
- service = new JBossWeb("node3", "localhost");
+ service = new JBossWeb("sticky3", "localhost");
connector = service.addConnector(8009);
server.addService(service);
- service2 = new JBossWeb("node4", "localhost");
+ service2 = new JBossWeb("sticky4", "localhost");
connector2 = service2.addConnector(8888);
server.addService(service2);
@@ -78,10 +78,15 @@
wait.start();
// Wait until httpd as received the nodes information.
- try {
- Thread.sleep(30000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
+ String [] nodes = new String[2];
+ nodes[0] = "sticky3";
+ nodes[1] = "sticky4";
+ while (!Maintest.checkProxyInfo(cluster, nodes)) {
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
}
// Start the client and wait for it.
@@ -98,11 +103,11 @@
// Stop the connector that has received the request...
String node = client.getnode();
- if ("node4".equals(node)) {
+ if ("sticky4".equals(node)) {
connector = connector2;
- node = "node3";
+ node = "sticky3";
} else {
- node = "node4";
+ node = "sticky4";
}
if (connector != null) {
try {
@@ -149,6 +154,15 @@
} catch (InterruptedException ex) {
ex.printStackTrace();
}
+/* In fact it doesn't stop correctly ... Something needs to be fixed
+ while (!Maintest.checkProxyInfo(cluster, null)) {
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException ex) {
+ ex.printStackTrace();
+ }
+ }
+ */
// Test client result.
if ( !clienterror && client.httpResponseCode != 503 )
15 years, 7 months
JBoss Native SVN: r2192 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 11:29:10 -0500 (Wed, 21 Jan 2009)
New Revision: 2192
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Make sure the REMOVED node is removed by the logic.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-21 15:08:10 UTC (rev 2191)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2009-01-21 16:29:10 UTC (rev 2192)
@@ -755,6 +755,8 @@
if (! is_same_node(node, &nodeinfo)) {
/* Here we can't update it because the old one is still in */
strcpy(node->mess.JVMRoute, "REMOVED");
+ node->mess.remove = 1;
+ insert_update_node(nodestatsmem, node, &id);
*errtype = TYPEMEM;
return MNODERM;
}
15 years, 7 months
JBoss Native SVN: r2191 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 10:08:10 -0500 (Wed, 21 Jan 2009)
New Revision: 2191
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Just tells what gives the number of open connections.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-21 10:08:50 UTC (rev 2190)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-21 15:08:10 UTC (rev 2191)
@@ -504,12 +504,15 @@
#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 3)
if (worker->cp->res)
i = apr_reslist_acquired_count(worker->cp->res);
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
+ "remove_workers_node (reslist) %d %s", i, node->mess.JVMRoute);
#else
helper = worker->opaque;
i = helper->count_active;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
+ "remove_workers_node (helper) %d %s", i, node->mess.JVMRoute);
#endif
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
- "remove_workers_node %d %s", i, node->mess.JVMRoute);
+
if (i == 0) {
/* No connection in use: clean the worker */
proxy_balancer *balancer;
15 years, 7 months
JBoss Native SVN: r2190 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 05:08:50 -0500 (Wed, 21 Jan 2009)
New Revision: 2190
Modified:
trunk/mod_cluster/test/java/installhttpd.sh
Log:
windoze needs the modules load commands.
Modified: trunk/mod_cluster/test/java/installhttpd.sh
===================================================================
--- trunk/mod_cluster/test/java/installhttpd.sh 2009-01-21 09:21:03 UTC (rev 2189)
+++ trunk/mod_cluster/test/java/installhttpd.sh 2009-01-21 10:08:50 UTC (rev 2190)
@@ -77,6 +77,7 @@
BASEHTTPD=opt/jboss/httpd
BASEHTTPDCONF=opt/jboss/httpd/httpd/conf
BASEHTTPDSBIN=opt/jboss/httpd/sbin
+ADDMODULES=false
case $BUILD_TAG in
*hpux-parisc2*)
BASE=mod_cluster-hp-ux-9000_800
@@ -105,6 +106,7 @@
BASEHTTPD=httpd-2.2
BASEHTTPDCONF=httpd-2.2/conf
BASEHTTPDSBIN=httpd-2.2/bin
+ ADDMODULES=true
;;
esac
#PACKAGE=rhel-httpd-2.2.8-1.el5s2
@@ -175,6 +177,23 @@
echo "s/Listen 80.*/Listen @IP@:8000/" > sed.cmd
echo "s/LoadModule proxy_balancer/#LoadModule proxy_balancer/" >> sed.cmd
sed -f sed.cmd "$file" > "$file.new"
+
+if $ADDMODULES
+then
+ #Add loadmodule if needed (on windoze).
+ cat >> "$file.new" <<EOF
+LoadModule proxy_module modules/mod_proxy.so
+LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
+LoadModule proxy_http_module modules/mod_proxy_http.so
+
+LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
+
+LoadModule manager_module modules/mod_manager.so
+LoadModule slotmem_module modules/mod_sharedmem.so
+LoadModule advertise_module modules/mod_advertise.so
+EOF
+fi
+
cat >> "$file.new" <<EOF
<IfModule manager_module>
Listen @IP@:6666
15 years, 7 months
JBoss Native SVN: r2189 - trunk/mod_cluster/test/java.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-01-21 04:21:03 -0500 (Wed, 21 Jan 2009)
New Revision: 2189
Modified:
trunk/mod_cluster/test/java/build.xml
trunk/mod_cluster/test/java/installhttpd.sh
Log:
Arrange windoze tests.
Modified: trunk/mod_cluster/test/java/build.xml
===================================================================
--- trunk/mod_cluster/test/java/build.xml 2009-01-21 08:55:46 UTC (rev 2188)
+++ trunk/mod_cluster/test/java/build.xml 2009-01-21 09:21:03 UTC (rev 2189)
@@ -102,14 +102,25 @@
</exec>
</target>
<target name="httpd" depends="installhttpd">
- <exec executable="${base.path}/opt/jboss/httpd/sbin/apachectl">
+ <copy file="apachectl.bat" tofile="apache.bat" />
+ <replace file="apache.bat" token="@BASELOC@" value="${base.path}"/>
+ <exec executable="${base.path}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX">
<arg value="start"/>
</exec>
+ <exec executable="apache.bat" os="Windows 2003">
+ <arg value="start"/>
+ </exec>
</target>
<target name="stophttpd">
- <exec executable="${base.path}/opt/jboss/httpd/sbin/apachectl">
+ <exec executable="${base.path}/opt/jboss/httpd/sbin/apachectl" os="Linux,SunOS,HP-UX">
<arg value="stop"/>
</exec>
+ <exec executable="${base.path}/httpd-2.2/bin/httpd.exe" os="Windows 2003">
+ <arg value="-k stop"/>
+ </exec>
+ <exec executable="${base.path}/httpd-2.2/bin/httpd.exe" os="Windows 2003">
+ <arg value="-k uninstall"/>
+ </exec>
</target>
<!-- Run the tests -->
Modified: trunk/mod_cluster/test/java/installhttpd.sh
===================================================================
--- trunk/mod_cluster/test/java/installhttpd.sh 2009-01-21 08:55:46 UTC (rev 2188)
+++ trunk/mod_cluster/test/java/installhttpd.sh 2009-01-21 09:21:03 UTC (rev 2189)
@@ -128,18 +128,11 @@
fi
TARBALL=`pwd`/${PACKAGE}-${BUILD_SYS}-${BUILD_CPU}.${EXT}
-# prevent spaces...
-counts=`echo $BASELOC | wc -w`
-if [ $counts != "1" ]
-then
- BASELOC=BASELOC
- mkdir -p ${BASELOC}
-fi
export BASELOC
echo "Base is: $BASELOC !!!"
# Clean previous install
-rm -rf $BASELOC/$BASEHTTPD
+rm -rf "$BASELOC/$BASEHTTPD"
case ${EXT} in
tar.gz)
(cd $BASELOC
@@ -165,11 +158,11 @@
mv $file.new $file
;;
*)
- (cd $BASELOC
+ (cd "$BASELOC"
unzip ${TARBALL}
)
# Arrange the installed files
- (cd $BASELOC/httpd-2.2/bin
+ (cd "$BASELOC/httpd-2.2/bin"
./installconf.bat
)
;;
@@ -177,12 +170,12 @@
#
# Arrange httpd.conf
-file=$BASELOC/${BASEHTTPDCONF}/httpd.conf
-cp -p $file $file.new
+file="$BASELOC/${BASEHTTPDCONF}/httpd.conf"
+cp -p "$file" "$file.new"
echo "s/Listen 80.*/Listen @IP@:8000/" > sed.cmd
echo "s/LoadModule proxy_balancer/#LoadModule proxy_balancer/" >> sed.cmd
-sed -f sed.cmd $file > $file.new
-cat >> $file.new <<EOF
+sed -f sed.cmd "$file" > "$file.new"
+cat >> "$file.new" <<EOF
<IfModule manager_module>
Listen @IP@:6666
ManagerBalancerName mycluster
@@ -204,12 +197,12 @@
echo "s/@IP@/${IP}/" > sed.cmd
echo "s/@ADVIP@/${ADVIP}/" >> sed.cmd
echo "s/@SUBIP@/${SUBIP}/" >> sed.cmd
-sed -f sed.cmd $file.new > $file.new.1
+sed -f sed.cmd "$file.new" > "$file.new.1"
# replace httpd.conf by the new file.
-mv $file $file.`date +%y%m%d.%H%M%S`.1.org
-mv $file.new.1 $file
+mv "$file" "$file.`date +%y%m%d.%H%M%S`.1.org"
+mv "$file.new.1" "$file"
# restore the execute permissions.
-chmod a+x $BASELOC/${BASEHTTPDSBIN}/*
-chmod a+x $BASELOC/${BASEHTTPD}/bin/*
+chmod a+x "$BASELOC/${BASEHTTPDSBIN}"/*
+chmod a+x "$BASELOC/${BASEHTTPD}"/bin/*
15 years, 7 months