assert "${jboss.bind.address.management:127.0.0.71}".equals(interfElem) : "InterfElem was " + interfElem;
}
public void testXpath711() throws Exception {
URL url = getClass().getClassLoader().getResource("standalone711.xml");
HostConfiguration hostConfig = new HostConfiguration(new File(url.getPath()));
String realm = hostConfig.obtainXmlPropertyViaXPath("//management/management-interfaces/http-interface/@security-realm");
assert "ManagementRealm".equals(realm) : "Realm was " + realm;
String sbindingRef = hostConfig.obtainXmlPropertyViaXPath(
("//management/management-interfaces/http-interface/socket-binding/@http"));
assert "management-http".equals(sbindingRef): "Socketbinding was " + sbindingRef;
String pathExpr = "/server/socket-binding-group/socket-binding[@name='" + sbindingRef + "']/@port";
String port = hostConfig.obtainXmlPropertyViaXPath(pathExpr);
assert "${jboss.management.http.port:9990}".equals(port) : "Port was [" + port + "]";
pathExpr = "/server/socket-binding-group/socket-binding[@name='" + sbindingRef + "']/@interface";
String interfName = hostConfig.obtainXmlPropertyViaXPath(pathExpr);
assert "management".equals(interfName) : "Interface was " + interfName;
pathExpr = "/server/interfaces/interface[@name='" + interfName + "']/inet-address/@value";
String interfElem = hostConfig.obtainXmlPropertyViaXPath(pathExpr);
assert "${jboss.bind.address.management:127.0.0.71}".equals(interfElem) : "InterfElem was " + interfElem;
String socketBindingGroupName = "standard-sockets";
pathExpr = "/server/socket-binding-group[@name='" + socketBindingGroupName + "']/@port-offset";
String offsetAttr = hostConfig.obtainXmlPropertyViaXPath(pathExpr);
assert "${jboss.socket.binding.port-offset:123}".equals(offsetAttr) : "Port-Offset was " + offsetAttr;
}