Author: jfrederic.clere(a)jboss.com
Date: 2008-10-15 11:07:21 -0400 (Wed, 15 Oct 2008)
New Revision: 1957
Modified:
trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java
trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java
Log:
Arrange code to use the new INFO syntax.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java 2008-10-14 11:20:57
UTC (rev 1956)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java 2008-10-15 15:07:21
UTC (rev 1957)
@@ -31,10 +31,8 @@
public class NodeInfo {
String JVMRoute;
- int status;
int lbfactor;
int elected;
- int removed;
/**
* Check that nodes in nodeinfos corresponds to nodes in nodenames
@@ -64,10 +62,8 @@
System.out.println("Name " + nodenames[i] + "found
twice!!!");
return false; // twice.
}
- if (nodeinfos[j].removed == 0) {
- in[i] = true;
- hasit = true;
- }
+ in[i] = true;
+ hasit = true;
}
}
if (!hasit) {
@@ -75,12 +71,7 @@
return false; // not found.
}
}
- int i = 0;
- for (int j=0; j<nodeinfos.length; j++) {
- if (nodeinfos[j].removed == 0)
- i++;
- }
- if (i != nodenames.length) {
+ if (nodeinfos.length != nodenames.length) {
System.out.println("Too many route entries in httpd!!!");
return false; // Too many route entries in httpd.
}
@@ -98,7 +89,7 @@
for (int i=0; i<nodes.size(); i++) {
NodeInfo nodeinfo = (NodeInfo) nodes.get(i);
- System.out.println("Node[" + i + "]: " +
nodeinfo.JVMRoute + " remove: " + nodeinfo.removed);
+ System.out.println("Node[" + i + "]: " +
nodeinfo.JVMRoute);
}
for (int i=0; i<nodenames.length; i++) {
System.out.println("Name[" + i + "]: " + nodenames[i]);
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java 2008-10-14 11:20:57
UTC (rev 1956)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java 2008-10-15 15:07:21
UTC (rev 1957)
@@ -102,25 +102,19 @@
// System.out.println("results[" + j + "]: " +
results[j]);
String [] data = results[j].split(": ");
// System.out.println("data[" + 0 + "]: " +
data[0] + "*");
- if ("node".equals(data[0]) && nodeinfo == null) {
+ if ("Node".equals(data[0]) && nodeinfo == null) {
nodeinfo = new NodeInfo();
continue;
}
- if ("JVMRoute".equals(data[0])) {
+ if ("Name".equals(data[0])) {
nodeinfo.JVMRoute = data[1];
}
- else if ("status".equals(data[0])) {
- nodeinfo.status = Integer.valueOf(data[1]).intValue();
- }
- else if ("lbfactor".equals(data[0])) {
+ else if ("Load".equals(data[0])) {
nodeinfo.lbfactor = Integer.valueOf(data[1]).intValue();
}
- else if ("elected".equals(data[0])) {
+ else if ("Elected".equals(data[0])) {
nodeinfo.elected = Integer.valueOf(data[1]).intValue();
}
- else if ("removed".equals(data[0])) {
- nodeinfo.removed = Integer.valueOf(data[1]).intValue();
- }
}
if (nodeinfo != null) {
// System.out.println("Adding: " + nodeinfo);
Show replies by date