Package com.netflix.simianarmy.chaos

Examples of com.netflix.simianarmy.chaos.ChaosMonkey


    }

    @Test
    public void testMandatoryTerminationNoOptInTime() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationNoOptInTime.properties");
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 0);
    }
View Full Code Here


    }

    @Test
    public void testMandatoryTerminationInsideWindow() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationInsideWindow.properties");
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        // The last opt-in time is within the window, so no mandatory termination is triggered
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 0);
    }
View Full Code Here

    }

    @Test
    public void testMandatoryTerminationOutsideWindow() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationOutsideWindow.properties");
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        // There was no termination in the last window, so one mandatory termination is triggered
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 1);
    }
View Full Code Here

    public void testMandatoryTerminationOutsideWindowWithPreviousTermination() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationOutsideWindow.properties");
        terminateOnDemand(ctx, "TYPE_C", "name4");
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 1);
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        // There was termination in the last window, so no mandatory termination is triggered
        Assert.assertEquals(ctx.selectedOn().size(), 2);
        Assert.assertEquals(ctx.terminated().size(), 1);
    }
View Full Code Here

    public void testMandatoryTerminationInsideWindowWithPreviousTermination() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationInsideWindow.properties");
        terminateOnDemand(ctx, "TYPE_C", "name4");
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 1);
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        // There was termination in the last window, so no mandatory termination is triggered
        Assert.assertEquals(ctx.selectedOn().size(), 2);
        Assert.assertEquals(ctx.terminated().size(), 1);
    }
View Full Code Here

    }

    @Test
    public void testNotificationEnabled() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("notificationEnabled.properties");
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        Assert.assertEquals(ctx.selectedOn().size(), 4);
        Assert.assertEquals(ctx.terminated().size(), 4);
        // Notification is enabled only for 2 terminations.
        Assert.assertEquals(ctx.getNotified(), 2);
    }
View Full Code Here

    }

    @Test
    public void testGlobalNotificationEnabled() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("globalNotificationEnabled.properties");
        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        Assert.assertEquals(ctx.selectedOn().size(), 4);
        Assert.assertEquals(ctx.terminated().size(), 4);
        Assert.assertEquals(ctx.getNotified(), 1);
        Assert.assertEquals(ctx.getGloballyNotified(), 4);
    }
View Full Code Here

TOP

Related Classes of com.netflix.simianarmy.chaos.ChaosMonkey

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.