Fix a test failure in DnsQueryTest
This commit is contained in:
parent
9d505fd24e
commit
410aa427be
@ -32,22 +32,22 @@ public class DnsQueryTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writeQueryTest() throws Exception {
|
public void writeQueryTest() throws Exception {
|
||||||
InetSocketAddress addr = new InetSocketAddress(0);
|
InetSocketAddress addr = new InetSocketAddress("8.8.8.8", 53);
|
||||||
EmbeddedChannel embedder = new EmbeddedChannel(new DatagramDnsQueryEncoder());
|
EmbeddedChannel embedder = new EmbeddedChannel(new DatagramDnsQueryEncoder());
|
||||||
List<DnsQuery> queries = new ArrayList<DnsQuery>(5);
|
List<DnsQuery> queries = new ArrayList<DnsQuery>(5);
|
||||||
queries.add(new DatagramDnsQuery(addr, null, 1).setRecord(
|
queries.add(new DatagramDnsQuery(null, addr, 1).setRecord(
|
||||||
DnsSection.QUESTION,
|
DnsSection.QUESTION,
|
||||||
new DefaultDnsQuestion("1.0.0.127.in-addr.arpa", DnsRecordType.PTR)));
|
new DefaultDnsQuestion("1.0.0.127.in-addr.arpa", DnsRecordType.PTR)));
|
||||||
queries.add(new DatagramDnsQuery(addr, null, 1).setRecord(
|
queries.add(new DatagramDnsQuery(null, addr, 1).setRecord(
|
||||||
DnsSection.QUESTION,
|
DnsSection.QUESTION,
|
||||||
new DefaultDnsQuestion("www.example.com", DnsRecordType.A)));
|
new DefaultDnsQuestion("www.example.com", DnsRecordType.A)));
|
||||||
queries.add(new DatagramDnsQuery(addr, null, 1).setRecord(
|
queries.add(new DatagramDnsQuery(null, addr, 1).setRecord(
|
||||||
DnsSection.QUESTION,
|
DnsSection.QUESTION,
|
||||||
new DefaultDnsQuestion("example.com", DnsRecordType.AAAA)));
|
new DefaultDnsQuestion("example.com", DnsRecordType.AAAA)));
|
||||||
queries.add(new DatagramDnsQuery(addr, null, 1).setRecord(
|
queries.add(new DatagramDnsQuery(null, addr, 1).setRecord(
|
||||||
DnsSection.QUESTION,
|
DnsSection.QUESTION,
|
||||||
new DefaultDnsQuestion("example.com", DnsRecordType.MX)));
|
new DefaultDnsQuestion("example.com", DnsRecordType.MX)));
|
||||||
queries.add(new DatagramDnsQuery(addr, null, 1).setRecord(
|
queries.add(new DatagramDnsQuery(null, addr, 1).setRecord(
|
||||||
DnsSection.QUESTION,
|
DnsSection.QUESTION,
|
||||||
new DefaultDnsQuestion("example.com", DnsRecordType.CNAME)));
|
new DefaultDnsQuestion("example.com", DnsRecordType.CNAME)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user