Package org.cipango.dns.record

Examples of org.cipango.dns.record.NaptrRecord


  }
 
  @Test
  public void testNaptr() throws Exception
  {
    List<Record> records = _dnsService.lookup(new NaptrRecord("cipango.org"));
    assertNotNull(records);
    assertEquals(2, records.size());
    //System.out.println(records);
    for (Record record : records)
    {
      NaptrRecord naptrRecord = (NaptrRecord) record;
      if (naptrRecord.getOrder() == 100)
      {
        assertEquals(50, naptrRecord.getPreference());
        assertEquals("S", naptrRecord.getFlags());
        assertEquals("SIP+D2U", naptrRecord.getService());
        assertEquals("", naptrRecord.getRegexp());
        assertEquals("_sip._udp.cipango.org", naptrRecord.getReplacement().toString());
      }
      else if (naptrRecord.getOrder() == 90)
      {
        assertEquals(50, naptrRecord.getPreference());
        assertEquals("S", naptrRecord.getFlags());
        assertEquals("SIP+D2T", naptrRecord.getService());
        assertEquals("", naptrRecord.getRegexp());
        assertEquals("_sip._tcp.cipango.org", naptrRecord.getReplacement().toString());
      }
    }
  }
View Full Code Here


    DnsMessage message = getMessage("/responseNaptr.dat");
    assertEquals(ResponseCode.NO_ERROR, message.getHeaderSection().getResponseCode());
    //System.out.println(message);
    assertEquals(2, message.getAnswerSection().size());
   
    NaptrRecord naptrRecord = (NaptrRecord) message.getAnswerSection().get(0);
    assertEquals(90, naptrRecord.getOrder());
    assertEquals(50, naptrRecord.getPreference());
    assertEquals("S", naptrRecord.getFlags());
    assertEquals("SIP+D2T", naptrRecord.getService());
    assertEquals("", naptrRecord.getRegexp());
    assertEquals("_sip._tcp.cipango.org", naptrRecord.getReplacement().toString());
   

    naptrRecord = (NaptrRecord) message.getAnswerSection().get(1);
    assertEquals(100, naptrRecord.getOrder());
    assertEquals(50, naptrRecord.getPreference());
    assertEquals("S", naptrRecord.getFlags());
    assertEquals("SIP+D2U", naptrRecord.getService());
    assertEquals("", naptrRecord.getRegexp());
    assertEquals("_sip._udp.cipango.org", naptrRecord.getReplacement().toString());
   
   
  }
View Full Code Here

TOP

Related Classes of org.cipango.dns.record.NaptrRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.