}
public void testBasic() {
assertEquals("Wrong node id", "heron", glob.getId());
String cmd = null;
CommandWrapper w = null;
try {
cmd = "/node/heron/client/joe/?sessionList";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", "joe/?sessionList", w.getTail());
cmd = "/node/heron/client/joe/";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", "joe/", w.getTail());
cmd = "/node/heron/client/joe";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", "joe", w.getTail());
cmd = "/node/heron/client/";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());
cmd = "/node/heron/client";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "/node/heron/client", w.getCommand());
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());
cmd = "client/joe/?sessionList";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", "joe/?sessionList", w.getTail());
cmd = "client";
w = new CommandWrapper(glob, cmd);
assertEquals("Command '" + cmd + "' wrong parsed", "/node/heron/client", w.getCommand());
assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());
}
catch(XmlBlasterException e) {
fail("Failed: " + e.toString());
}
}