Author: jfrederic.clere(a)jboss.com
Date: 2008-09-15 07:59:22 -0400 (Mon, 15 Sep 2008)
New Revision: 1831
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 TestAddDel and print error message when errors.
Modified: trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java
===================================================================
--- trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java 2008-09-15 10:06:47
UTC (rev 1830)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/NodeInfo.java 2008-09-15 11:59:22
UTC (rev 1831)
@@ -43,8 +43,10 @@
{
boolean [] in = new boolean[nodenames.length];
- if (nodes == null || nodenames == null)
+ if (nodes == null || nodenames == null) {
+ System.out.println("No nodes or no names");
return false;
+ }
NodeInfo [] nodeinfos = new NodeInfo[nodes.size()];
for (int i=0; i<nodeinfos.length; i++) {
@@ -58,24 +60,48 @@
boolean hasit = false;
for (int j=0; j<nodeinfos.length; j++) {
if (nodeinfos[j].JVMRoute.equals(nodenames[i])) {
- if (in[i])
+ if (in[i]) {
+ System.out.println("Name " + nodenames[i] + "found
twice!!!");
return false; // twice.
+ }
if (nodeinfos[j].removed == 0) {
in[i] = true;
hasit = true;
}
}
}
- if (!hasit)
+ if (!hasit) {
+ System.out.println("Name " + nodenames[i] + "not
found!!!");
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 (i != nodenames.length) {
+ System.out.println("Too many route entries in httpd!!!");
return false; // Too many route entries in httpd.
+ }
return true;
}
+ static public void print(ArrayList nodes, String [] nodenames) {
+ if (nodes == null || nodes.size() == 0) {
+ System.out.println("No nodes");
+ return;
+ }
+ if (nodenames == null || nodenames.length == 0) {
+ System.out.println("No names???");
+ return;
+ }
+
+ for (int i=0; i<nodes.size(); i++) {
+ NodeInfo nodeinfo = (NodeInfo) nodes.get(i);
+ System.out.println("Node[" + i + "]: " +
nodeinfo.JVMRoute + " remove: " + nodeinfo.removed);
+ }
+ 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-09-15 10:06:47
UTC (rev 1830)
+++ trunk/mod_cluster/test/java/org/jboss/mod_cluster/TestAddDel.java 2008-09-15 11:59:22
UTC (rev 1831)
@@ -138,9 +138,11 @@
// Check the nodes.
if (!clienterror) {
- if (!NodeInfo.check(nodes, nodenames))
+ if (!NodeInfo.check(nodes, nodenames)) {
System.out.println("getProxyInfo nodes incorrect");
+ NodeInfo.print(nodes, nodenames);
clienterror = true;
+ }
}
// Stop the jboss and remove the services.
Show replies by date