Package net.windwards.dnsfrontend.util

Examples of net.windwards.dnsfrontend.util.TestingConfiguration


        }
    }

    @Before
    public void setup() throws Exception {
        conf1 = new TestingConfiguration("conf", "example.com.", 1800);
        conf2 = new TestingConfiguration("conf", "example.com.", 1801);
        conf2.setPort(Short.parseShort("5355"));

        frontend1 = new TestingFrontend();
        frontend1.setup(conf1);
        frontend1.start();
View Full Code Here


public class TestUDPServer {
    @Test
    public void receiveAQuery() throws Exception {
        BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();

        ResolveTaskFactory factory = new ResolveTaskFactory(null, null, new TestingConfiguration("foo", "example.com.", 1800));

        UDPServer server = new UDPServer(queue);
        server.port = 5354;
        server.setResolveTaskFactory(factory);
        server.start();
View Full Code Here

    private TestingConfiguration conf;
    private Client client;

    @Before
    public void before() throws Exception {
        conf = new TestingConfiguration("conf", "example.com.", 1800);
        frontend = new DNSFrontend() {
            @Override
            protected void setupLogging() {
                this.debug = true;
                super.setupLogging();
View Full Code Here

    public void before() throws Exception {
        String clusterName = "cluster-" + Long.toString(new Random().nextLong());
        cache = TestUtils.getEhcache();
        backend = new JGroupsBackend();
        backend.setCache(cache);
        backend.setConfiguration(new TestingConfiguration("bar", "example.com.", 1));
        backend.setClusterName(clusterName);
        backend.start();

        channel = new JChannel();
        channel.connect(clusterName);
View Full Code Here

                'f', 'o', 'o', // hostname
                3,
                'b', 'a', 'r' // domain moniker
        };

        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        Protocol protocol = new BinaryBackendProtocol();
        Record result = protocol.decode(ipv4message, conf);
        ARecord rec = (ARecord) result;
        Assert.assertEquals("foo.example.com.", rec.getName().toString());
View Full Code Here

                'f', 'o', 'o', // hostname
                3,
                'b', 'a', 'r'
        };

        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        Protocol protocol = new BinaryBackendProtocol();
        Record result = protocol.decode(ipv6message, conf);
        AAAARecord rec = (AAAARecord) result;
        Assert.assertEquals("foo.example.com.", rec.getName().toString());
View Full Code Here

    public static JsonFactory factory = new JsonFactory();
    public static ObjectMapper mapper = new ObjectMapper(factory);

    @Test
    public void encodeRequest() throws Exception {
        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        Protocol protocol = new JSONBackendProtocol();

        Record rec = Record.newRecord(new Name("foo.example.com."), Type.A, DClass.IN);
        byte[] data = protocol.encode(rec, conf);
View Full Code Here

        Assert.assertEquals(expected, actual);
    }

    @Test
    public void decodeIPv4Update() throws Exception {
        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        String update = "{ " +
                "\"type\": \"Update\", " +
                "\"name\": \"foo\", " +
                "\"address\": \"192.168.0.1\", " +
View Full Code Here

        Assert.assertEquals(12345, rec.getTTL());
    }

    @Test
    public void decodeIPv6Update() throws Exception {
        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        String update = "{" +
                "\"type\": \"Update\", " +
                "\"name\": \"foo\", " +
                "\"address\": \"2002:53fe:52a1:7:224:1dff:fe7d:6bef\", " +
View Full Code Here

    }

    @Ignore("Meaningful only when run alone")
    @Test
    public void firstSerialisationPerformance() throws Exception {
        TestingConfiguration conf = new TestingConfiguration("bar", "example.com.", 12345);

        Protocol protocol = new JSONBackendProtocol();

        Record rec = Record.newRecord(new Name("foo.example.com."), Type.A, DClass.IN);
        long start = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of net.windwards.dnsfrontend.util.TestingConfiguration

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.