[jboss-cvs] JBoss Messaging SVN: r3916 - in projects/network-benchmark: src/network and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Mar 22 08:04:25 EDT 2008
Author: trustin
Date: 2008-03-22 08:04:25 -0400 (Sat, 22 Mar 2008)
New Revision: 3916
Modified:
projects/network-benchmark/build.xml
projects/network-benchmark/src/network/AllInOneServer.java
Log:
* Updated ant build script
* Fixed AllInOneServer not to exit immediately when it's run in the build script
Modified: projects/network-benchmark/build.xml
===================================================================
--- projects/network-benchmark/build.xml 2008-03-22 11:53:25 UTC (rev 3915)
+++ projects/network-benchmark/build.xml 2008-03-22 12:04:25 UTC (rev 3916)
@@ -8,9 +8,11 @@
<path id="classpath">
<pathelement path="etc/ "/>
- <pathelement path="build/ "/>
+ <pathelement path="bin/ "/>
<pathelement location="lib/junit.jar"/>
- <pathelement location="lib/mina-core-2.0.0-M2-20080317.150334-8.jar"/>
+ <pathelement location="lib/mina-core-2.0.0-M2-SNAPSHOT.jar"/>
+ <pathelement location="lib/mina-transport-apr-2.0.0-M2-SNAPSHOT.jar"/>
+ <pathelement location="lib/tomcat-apr-5.5.15.jar"/>
<pathelement location="lib/slf4j-api-1.4.3.jar"/>
<pathelement location="lib/slf4j-log4j12.jar"/>
<pathelement location="lib/log4j.jar"/>
@@ -18,39 +20,26 @@
<target name="help" description="-> Display help">
<echo>
-- To start the servers, run "bio-server", "nio-server" & "mina-server"
- targets in 3 different terminals on the server machine
-- To run the client tests, run the "test" target on the client machine
-- To configure the tests, change the properties in NetworkClientTest.java
- (on both the client & server machines)</echo>
+- To start the servers, run "server" target in the on the server machine.
+- To run the client tests, run the "test" target on the client machine.
+- To configure the tests, change the properties in ClientSetting.java (on the
+ client machine) and CommonSetting.java (on both the client & server
+ machines)</echo>
</target>
<target name="compile">
- <mkdir dir="build"/>
- <javac srcdir="src" destdir="build"
+ <mkdir dir="bin"/>
+ <javac srcdir="src" destdir="bin"
classpathref="classpath"
debug="true"
/>
</target>
- <target name="bio-server" depends="compile" description="-> Start a Blocking IO Server">
+ <target name="server" depends="compile" description="-> Start servers">
<java classpathref="classpath"
- classname="network.BIOServer"
+ classname="network.AllInOneServer"
/>
</target>
- <target name="nio-server" depends="compile" description="-> Start a NIO Server">
- <java classpathref="classpath"
- classname="network.NIOServer"
- />
- </target>
-
- <target name="mina-server" depends="compile" description="-> Start a MINA Server">
- <java classpathref="classpath"
- classname="network.MINAServer"
- fork="yes"
- />
- </target>
-
<target name="test" depends="compile" description="-> Run the tests">
<junit showoutput="true">
<classpath>
@@ -63,7 +52,7 @@
</target>
<target name="clean">
- <delete dir="build/" />
+ <delete dir="bin/" />
</target>
</project>
Modified: projects/network-benchmark/src/network/AllInOneServer.java
===================================================================
--- projects/network-benchmark/src/network/AllInOneServer.java 2008-03-22 11:53:25 UTC (rev 3915)
+++ projects/network-benchmark/src/network/AllInOneServer.java 2008-03-22 12:04:25 UTC (rev 3916)
@@ -1,11 +1,16 @@
package network;
+import java.util.ArrayList;
+import java.util.List;
+
public class AllInOneServer {
public static void main(String[] args) throws Exception {
CommonSetting.print();
System.out.println();
- new Thread() {
+ List<Thread> threads = new ArrayList<Thread>();
+
+ threads.add(new Thread() {
@Override
public void run() {
try {
@@ -14,8 +19,9 @@
e.printStackTrace();
}
}
- }.start();
- new Thread() {
+ });
+
+ threads.add(new Thread() {
@Override
public void run() {
try {
@@ -24,8 +30,18 @@
e.printStackTrace();
}
}
- }.start();
- new Thread(new MINANIOServer()).start();
- new Thread(new MINAAPRServer()).start();
+ });
+
+ threads.add(new Thread(new MINANIOServer()));
+ threads.add(new Thread(new MINAAPRServer()));
+
+ for (Thread t: threads) {
+ t.start();
+ }
+
+ for (Thread t: threads) {
+ t.join();
+ }
+
}
}
More information about the jboss-cvs-commits
mailing list