コード例 #1
0
 @Test
 public void testIsNumericHost() {
   assertFalse(LocatorUtils.isNumeric("example.org"));
 }
コード例 #2
0
 @Test
 public void testIsNumericIPv6Unspecified() {
   assertTrue(LocatorUtils.isNumeric("[::]"));
 }
コード例 #3
0
 @Test
 public void testIsNumericIPv6IPv4Mapping() {
   assertTrue(LocatorUtils.isNumeric("[::ffff:192.0.2.128]"));
 }
コード例 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void defaultTransportForInvalidSchemeThrowsException() {
   LocatorUtils.getDefaultTransportForScheme("foo");
 }
コード例 #5
0
 @Test
 public void testIsNumericIPv6Loopback() {
   assertTrue(LocatorUtils.isNumeric("[::1]"));
 }
コード例 #6
0
 @Test
 public void defaultPortForTlsSctpIs5061() {
   assertEquals(5061, LocatorUtils.getDefaultPortForTransport("TLS-SCTP"));
 }
コード例 #7
0
 @Test
 public void shouldUpgradeSctpToSctpTls() {
   assertEquals("TLS-SCTP", LocatorUtils.upgradeTransport("SCTP"));
 }
コード例 #8
0
 @Test
 public void testGetServiceIdentifierForSctpTls() throws IOException {
   assertEquals(
       new Name("_sips._sctp.example.org."),
       LocatorUtils.getServiceIdentifier("TLS-SCTP", new Name("example.org.")));
 }
コード例 #9
0
 @Test
 public void testIsNumericIPv6() {
   assertTrue(LocatorUtils.isNumeric("[2001:0db8:85a3:0000:0000:8a2e:0370:7334]"));
 }
コード例 #10
0
 @Test(expected = IllegalArgumentException.class)
 public void testGetServiceIdentifierForInvalidTransport() throws IOException {
   LocatorUtils.getServiceIdentifier("FOO", new Name("example.org."));
 }
コード例 #11
0
 @Test
 public void testGetServiceIdentifierForTcp() throws IOException {
   assertEquals(
       new Name("_sip._tcp.example.org."),
       LocatorUtils.getServiceIdentifier("TCP", new Name("example.org.")));
 }
コード例 #12
0
 @Test
 public void defaultTransportForSipsIsTls() {
   assertEquals("TLS", LocatorUtils.getDefaultTransportForScheme("sips"));
 }
コード例 #13
0
 @Test
 public void defaultTransportForSipIsUdp() {
   assertEquals("UDP", LocatorUtils.getDefaultTransportForScheme("sip"));
 }
コード例 #14
0
 @Test
 public void testIsNumericIPv4() {
   assertTrue(LocatorUtils.isNumeric("192.168.0.1"));
 }
コード例 #15
0
 @Test(expected = IllegalArgumentException.class)
 public void defaultPortForInvalidTransportThrowsException() {
   LocatorUtils.getDefaultPortForTransport("FOO");
 }
コード例 #16
0
 @Test
 public void testIsNumericIPv6NonReference() {
   // This test distinguishes between an IPv6 address and IPv6 reference.
   assertFalse(LocatorUtils.isNumeric("2001:0db8:85a3:0000:0000:8a2e:0370:7334"));
 }
コード例 #17
0
 @Test
 public void defaultPortForSctpIs5060() {
   assertEquals(5060, LocatorUtils.getDefaultPortForTransport("SCTP"));
 }
コード例 #18
0
 @Test
 public void testIsNumericIPv6NoLeadingZeroes() {
   assertTrue(LocatorUtils.isNumeric("[2001:db8:85a3:0:0:8a2e:370:7334]"));
 }
コード例 #19
0
 @Test
 public void shouldUpgradeTcpToTls() {
   assertEquals("TLS", LocatorUtils.upgradeTransport("TCP"));
 }
コード例 #20
0
 @Test
 public void testIsNumericIPv6GroupedZeroes() {
   assertTrue(LocatorUtils.isNumeric("[2001:db8:85a3::8a2e:370:7334]"));
 }
コード例 #21
0
 @Test(expected = IllegalArgumentException.class)
 public void shouldFailToUpgradeUnknownTransport() {
   LocatorUtils.upgradeTransport("FOO");
 }
コード例 #22
0
 @Test(expected = IllegalArgumentException.class)
 public void shouldFailToUpgradeSctpTls() {
   LocatorUtils.upgradeTransport("TLS-SCTP");
 }