use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.
the class IterativeDNSSECTest method getClient.
private static DNSSECClient getClient(CacheConfig cacheConfig) {
DNSSECClient client = IntegrationTestTools.getClient(cacheConfig);
client.setMode(Mode.iterativeOnly);
return client;
}
use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.
the class IterativeDNSSECTest method shouldRequireLessQueries.
@IntegrationTest
public static void shouldRequireLessQueries() throws IOException {
DNSSECClient normalCacheClient = getClient(CacheConfig.normal);
DNSSECMessage normalCacheResult = normalCacheClient.queryDnssec(DNSSEC_DOMAIN, RR_TYPE);
assertTrue(normalCacheResult.authenticData);
NetworkDataSourceWithAccounting normalCacheNdswa = NetworkDataSourceWithAccounting.from(normalCacheClient);
DNSSECClient extendedCacheClient = getClient(CacheConfig.extended);
DNSSECMessage extendedCacheResult = extendedCacheClient.queryDnssec(DNSSEC_DOMAIN, RR_TYPE);
assertTrue(extendedCacheResult.authenticData);
NetworkDataSourceWithAccounting extendedCacheNdswa = NetworkDataSourceWithAccounting.from(extendedCacheClient);
assertTrue(normalCacheNdswa.getStats().successfulQueries > extendedCacheNdswa.getStats().successfulQueries);
}
use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.
the class DNSSECStats method iterativeDnsssecTest.
public static void iterativeDnsssecTest() throws SecurityException, IllegalArgumentException, IOException {
MiniDnsJul.enableMiniDnsTrace();
DNSSECClient client = new DNSSECClient(new ExtendedLRUCache());
client.setMode(Mode.iterativeOnly);
DNSSECMessage secRes = client.queryDnssec("verteiltesysteme.net", TYPE.A);
// CHECKSTYLE:OFF
System.out.println(secRes);
// CHECKSTYLE:ON
}
use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.
the class DNSSECStats method iterativeDnssecLookup.
private static void iterativeDnssecLookup(CacheConfig cacheConfig) throws IOException {
DNSSECClient client = MiniDNSStats.getClient(cacheConfig);
client.setMode(Mode.iterativeOnly);
DNSSECMessage secRes = client.queryDnssec(DOMAIN, RR_TYPE);
StringBuilder stats = MiniDNSStats.getStats(client);
stats.append('\n');
stats.append(secRes);
stats.append('\n');
for (UnverifiedReason r : secRes.getUnverifiedReasons()) {
stats.append(r);
}
stats.append("\n\n");
// CHECKSTYLE:OFF
System.out.println(stats);
// CHECKSTYLE:ON
}
use of org.minidns.dnssec.DNSSECClient in project minidns by MiniDNS.
the class MiniDNSStats method showDnssecStats.
public static void showDnssecStats(String name, TYPE type) throws IOException {
DNSSECClient client;
client = getClient(CacheConfig.without);
// CHECKSTYLE:OFF
out.println(gatherStatsFor(client, "Without Cache", name, type));
// CHECKSTYLE:ON
client = getClient(CacheConfig.normal);
// CHECKSTYLE:OFF
out.println(gatherStatsFor(client, "With Cache", name, type));
// CHECKSTYLE:ON
client = getClient(CacheConfig.extended);
// CHECKSTYLE:OFF
out.println(gatherStatsFor(client, "With Extended Cache", name, type));
// CHECKSTYLE:ON
client = getClient(CacheConfig.full);
// CHECKSTYLE:OFF
out.println(gatherStatsFor(client, "With Full Cache", name, type));
// CHECKSTYLE:ON
}
Aggregations