use of org.xbill.DNS.Name in project dim by 1and1.
the class NameTest method test_toString_special_char.
public void test_toString_special_char() throws TextParseException, WireParseException {
byte[] raw = new byte[] { 1, '"', 1, '(', 1, ')', 1, '.', 1, ';', 1, '\\', 1, '@', 1, '$', 0 };
String exp = "\\\".\\(.\\).\\..\\;.\\\\.\\@.\\$.";
Name n = new Name(new DNSInput(raw));
assertEquals(exp, n.toString());
}
use of org.xbill.DNS.Name in project dim by 1and1.
the class NameTest method test_wild.
public void test_wild() throws TextParseException {
Name sub = Name.fromString("a.b.c.");
Name exp = Name.fromString("*.b.c.");
Name n = sub.wild(1);
assertEquals(exp, n);
}
use of org.xbill.DNS.Name in project dim by 1and1.
the class NameTest method test_relativize_root.
public void test_relativize_root() throws TextParseException {
Name sub = Name.fromString("a.b.c.");
Name dom = Name.fromString(".");
Name exp = Name.fromString("a.b.c");
Name n = sub.relativize(dom);
assertEquals(exp, n);
}
use of org.xbill.DNS.Name in project dim by 1and1.
the class NameTest method test_fromDNAME.
public void test_fromDNAME() throws NameTooLongException, TextParseException {
Name own = new Name("the.owner.");
Name alias = new Name("the.alias.");
DNAMERecord dnr = new DNAMERecord(own, DClass.IN, 0xABCD, alias);
Name sub = new Name("sub.the.owner.");
Name exp = new Name("sub.the.alias.");
Name n = sub.fromDNAME(dnr);
assertEquals(exp, n);
}
use of org.xbill.DNS.Name in project dim by 1and1.
the class NameTest method test_wild_toobig.
public void test_wild_toobig() throws TextParseException {
Name sub = Name.fromString("a.b.c.");
try {
sub.wild(4);
fail("IllegalArgumentException not thrown");
} catch (IllegalArgumentException e) {
}
}
Aggregations