Package net.windwards.dnsfrontend.util

Examples of net.windwards.dnsfrontend.util.TestingBackend


        task.setCache(cache);
        final LinkedList<Record> notified = new LinkedList<Record>();
        task.setBackendStore(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend(notified);
            }
            @Override public void stop() {}
        });

        Assert.assertEquals(0, replies.size());
View Full Code Here


        task.setStagingZone(zone);
        final List<Record> pushed = new LinkedList<Record>();
        task.setBackendStore(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend(pushed);
            }
            @Override public void stop() {}
        });

        Assert.assertEquals(0, replies.size() + pushed.size() + parked.size());
View Full Code Here

        task.setCache(cache);
        task.setStagingZone(zone);
        task.setBackendStore(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend(new LinkedList<Record>()) {
                    @Override
                    public void notify(Record query) throws NoSuchDomainException {
                        throw new NoSuchDomainException("BOOM");
                    }
                };
View Full Code Here

        task.setCache(cache);
        task.setStagingZone(zone);
        task.setBackendStore(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend(new LinkedList<Record>());
            }
            @Override public void stop() {}
        });

        task.run();
View Full Code Here

        final List<Message> replies = new LinkedList<Message>();
        final Ehcache cache = TestUtils.getEhcache();
        Query query = TestUtils.getQuery(replies);

        final List<Record> pushed = new LinkedList<Record>();
        Backend backend = new TestingBackend(pushed);

        AbstractTaskKeeper zone = new AbstractTaskKeeper() {
            @Override public void start() { }
            @Override public void stop() { }
            @Override public void keep(ResolveTask task) { }
            @Override public void replyArrived(Ehcache cache, Element lmnt) { }
            @Override public void discard(ResolveTask task) { }
        };

        ResolveTask task = new ResolveTask(query);
        task.setCache(cache);
        task.setStagingZone(zone);
        task.setBackendStore(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend(new LinkedList<Record>());
            }
            @Override public void stop() {}
        });

        task.run();
View Full Code Here

        TaskKeeperImplWrapped keeper = new TaskKeeperImplWrapped(cache);
        keeper.setExpireTime(10);
        keeper.setBackendRepository(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend();
            }
            @Override public void stop() { }
        });
        keeper.start();
        // Don't explode, plz
View Full Code Here

        TaskKeeperImplWrapped keeper = new TaskKeeperImplWrapped(cache);
        keeper.setExpireTime(10);
        keeper.setBackendRepository(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend();
            }
            @Override public void stop() { }
        });
        keeper.start();
View Full Code Here

        TaskKeeperImplWrapped keeper = new TaskKeeperImplWrapped(cache);
        keeper.setExpireTime(10);
        keeper.setBackendRepository(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend();
            }
            @Override public void stop() {}
        });
        keeper.start();
View Full Code Here

        TaskKeeperImplWrapped keeper = new TaskKeeperImplWrapped(cache);
        keeper.setExpireTime(10);
        keeper.setBackendRepository(new BackendRepository() {
            @Override
            public Backend lookup(int type) {
                return new TestingBackend();
            }
            @Override public void stop() {};
        });
        keeper.start();
View Full Code Here

TOP

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

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.