Author: jfrederic.clere(a)jboss.com
Date: 2008-10-01 10:24:40 -0400 (Wed, 01 Oct 2008)
New Revision: 1923
Modified:
trunk/mod_cluster/test/java/TestHttpClient.java
Log:
Allow to test values for STATUS.
Modified: trunk/mod_cluster/test/java/TestHttpClient.java
===================================================================
--- trunk/mod_cluster/test/java/TestHttpClient.java 2008-10-01 12:39:27 UTC (rev 1922)
+++ trunk/mod_cluster/test/java/TestHttpClient.java 2008-10-01 14:24:40 UTC (rev 1923)
@@ -6,6 +6,7 @@
public static String JVMRoute = System.getProperty("JVMRoute",
"node1");
public static String Host = System.getProperty("Host",
"localhost");
+ public static String Factor = "50";
/**
*
* Usage:
@@ -18,12 +19,16 @@
*/
public static void main(String[] args) throws Exception
{
- if (args.length != 2)
- {
- System.err.println("missing command line arguments");
- System.exit(1);
+ if (args.length == 2)
+ runit(args[0], args[1]);
+ else if (args.length == 3) {
+ Factor = args[2];
+ System.out.println("Using factor: " + Factor);
+ runit(args[0], args[1]);
+ } else {
+ System.err.println("missing command line arguments");
+ System.exit(1);
}
- runit(args[0], args[1]);
}
public static int runit(String URL, String command) throws Exception
{
@@ -65,9 +70,10 @@
pm = (PostMethod) new DumpMethod(URL);
}
else if (command.compareToIgnoreCase("STATUS")==0) {
+ System.out.println("STATUS factor: " + Factor);
pm = (PostMethod) new StatusMethod(URL);
pm.addParameter("JVMRoute", JVMRoute);
- pm.addParameter("Load", "50");
+ pm.addParameter("Load", Factor);
}
else if (command.compareToIgnoreCase("ERROR")==0) {
pm = (PostMethod) new CauseErrorMethod(URL);
Show replies by date