use of com.sun.enterprise.util.HostAndPort in project Payara by payara.
the class MiniXmlParserTest method findTwoAdminPorts.
/*
* Exercise the parsing of asadmin virtual server, network-listener and port numbers
* this one tests for TWO listeners
*/
@Test
public void findTwoAdminPorts() {
try {
MiniXmlParser instance = new MiniXmlParser(adminport2, "server");
List<HostAndPort> addrs = instance.getAdminAddresses();
assertEquals(2, addrs.size());
boolean saw3333 = false, saw4444 = false, sawSecure = false;
for (HostAndPort addr : addrs) {
if (addr.getPort() == 3333)
saw3333 = true;
if (addr.getPort() == 4444) {
saw4444 = true;
if (addr.isSecure())
sawSecure = true;
}
}
assertTrue("Saw port 3333", saw3333);
assertTrue("Saw port 4444", saw4444);
assertTrue("Saw port 4444 security-enabled", sawSecure);
} catch (MiniXmlParserException ex) {
Logger.getLogger(MiniXmlParserTest.class.getName()).log(Level.SEVERE, null, ex);
}
}
Aggregations