// for (int i = 0; i < data.length; i++)
// {
// assertEquals("the encoded message is not what is expected at index " + i, expected[i], data[i]);
// }
DatagramPacket packet = new DatagramPacket(data, 0, data.length);
DNSIncoming in = new DNSIncoming(packet);
assertTrue("Wrong packet type.", in.isResponse());
assertEquals("Wrong number of questions.", 1, in.getNumberOfQuestions());
assertEquals("Wrong number of answers.", 1, in.getNumberOfAnswers());
assertEquals("Wrong number of authorities.", 1, in.getNumberOfAuthorities());
for (DNSQuestion question : in.getQuestions()) {
assertEquals("Wrong question name.", serviceName, question.getName());
}
}