Package org.apache.falcon.rerun.policy

Examples of org.apache.falcon.rerun.policy.PeriodicPolicy


        Assert.assertEquals(delay, 900000);
    }

    @Test
    public void testPeriodicPolicy() throws FalconException, InterruptedException {
        AbstractRerunPolicy periodic = new PeriodicPolicy();
        long delay = periodic.getDelay(new Frequency("minutes(2)"), 2);
        Assert.assertEquals(delay, 120000);
        delay = periodic.getDelay(new Frequency("minutes(2)"), 5);
        Assert.assertEquals(delay, 120000);

        long currentTime = System.currentTimeMillis();
        //Thread.sleep(1000);
        delay = periodic.getDelay(new Frequency("minutes(3)"),
                new Date(currentTime),
                new Date(currentTime + 1 * 60 * 60 * 1000));
        Assert.assertEquals(delay, 180000);
    }
View Full Code Here

TOP

Related Classes of org.apache.falcon.rerun.policy.PeriodicPolicy

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.