Package com.netflix.priam

Examples of com.netflix.priam.TestModule


    @Test
    public void testSchedule() throws Exception
    {
        latch = new CountDownLatch(1);
        Injector inject = Guice.createInjector(new TestModule());
        PriamScheduler scheduler = inject.getInstance(PriamScheduler.class);
        scheduler.start();
        scheduler.addTask("test", TestTask.class, new SimpleTimer("testtask", 10));
        // verify the task has run or fail in 1s
        latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here


    @Test
    @Ignore("not sure what this test really does, except test countdown latch and thread context switching")
    public void testSingleInstanceSchedule() throws Exception
    {
        latch = new CountDownLatch(3);
        Injector inject = Guice.createInjector(new TestModule());
        PriamScheduler scheduler = inject.getInstance(PriamScheduler.class);
        scheduler.start();
        scheduler.addTask("test2", SingleTestTask.class, SingleTestTask.getTimer());
        // verify 3 tasks run or fail in 1s
        latch.await(2000, TimeUnit.MILLISECONDS);
View Full Code Here

TOP

Related Classes of com.netflix.priam.TestModule

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.