DnsSrvConnectionStrategy extends AbstractConnectionStrategy { protected String[] parseDnsUrl(final String url) { if (!url.contains("?")) { return new String[] {url, null}; } return url.split("\\?"); } DnsSrvConnectionStrategy();  DnsSrvConnectionStrategy(final Duration ttl);  DnsSrvConnectionStrategy(final DNSContextFactory factory);  DnsSrvConnectionStrategy(final DNSContextFactory factory, final Duration ttl);  DnsSrvConnectionStrategy(final DNSContextFactory factory, final Duration ttl, final boolean ssl); @Override void populate(final String urls, final LdapURLSet urlSet); @Override synchronized Iterator<LdapURL> iterator();  }
@Test public void parseDnsUrl() { final DnsSrvConnectionStrategy strategy = new DnsSrvConnectionStrategy(); Assert.assertEquals(strategy.parseDnsUrl("dns:"), new String[] {"dns:", null}); Assert.assertEquals( strategy.parseDnsUrl("dns:?_ldap._tcp.ldaptive.org"), new String[] {"dns:", "_ldap._tcp.ldaptive.org"}); Assert.assertEquals(strategy.parseDnsUrl("dns: Assert.assertEquals( strategy.parseDnsUrl("dns: new String[] {"dns: Assert.assertEquals( strategy.parseDnsUrl("dns: new String[] {"dns: Assert.assertEquals( strategy.parseDnsUrl("dns: new String[] {"dns: }