Package com.netflix.simianarmy.aws.janitor.rule

Examples of com.netflix.simianarmy.aws.janitor.rule.TestMonkeyCalendar


        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n);
        Assert.assertEquals(janitor.markedResourceIds.size(), 0);
View Full Code Here


        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                10);
        Assert.assertEquals(resourceTracker.getResources(
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        new TestJanitorResourceTracker(new HashMap<String, Resource>()),
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n);
        janitor.markResources();
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n);
        Assert.assertEquals(resourceTracker.getResources(
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(resourceTracker.getResources(
                TestResourceType.TEST_RESOURCE_TYPE, CleanupState.MARKED, TEST_REGION).size(),
                n);
        janitor.cleanupResources();
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(resourceTracker.getResources(
                TestResourceType.TEST_RESOURCE_TYPE, CleanupState.MARKED, TEST_REGION).size(),
                n);
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(true);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n);
        janitor.markResources();
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new ImmediateCleanupRule(now)),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n);
        Assert.assertEquals(janitor.markedResourceIds.size(), 0);
View Full Code Here

        TestAbstractJanitor janitor = new TestAbstractJanitor(
                new TestJanitorContext(TEST_REGION,
                        new BasicJanitorRuleEngine().addRule(new IsEvenRule()),
                        crawler,
                        resourceTracker,
                        new TestMonkeyCalendar()), TestResourceType.TEST_RESOURCE_TYPE);
        janitor.setLeashed(false);
        Assert.assertEquals(
                crawler.resources(TestResourceType.TEST_RESOURCE_TYPE).size(),
                n - n / 3);
        Assert.assertEquals(resourceTracker.getResources(
View Full Code Here

public class TestSuspendedASGRule {
    @Test
    public void testEmptyASGSuspendedMoreThanThreshold() {
        Resource resource = new AWSResource().withId("asg1").withResourceType(AWSResourceType.ASG);
        resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_MAX_SIZE, "0");
        MonkeyCalendar calendar = new TestMonkeyCalendar();
        DateTime now = new DateTime(calendar.now().getTimeInMillis());
        int suspensionAgeThreshold = 2;
        DateTime suspensionTime = now.minusDays(suspensionAgeThreshold + 1);
        resource.setAdditionalField(ASGJanitorCrawler.ASG_FIELD_SUSPENSION_TIME,
                ASGJanitorCrawler.SUSPENSION_TIME_FORMATTER.print(suspensionTime));
        int retentionDays = 3;
View Full Code Here

TOP

Related Classes of com.netflix.simianarmy.aws.janitor.rule.TestMonkeyCalendar

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.