use of com.netflix.simianarmy.chaos.ChaosMonkey in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testMandatoryTerminationNotDefined.
@Test
public void testMandatoryTerminationNotDefined() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("mandatoryTerminationNotDefined.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
Assert.assertEquals(ctx.selectedOn().size(), 1);
Assert.assertEquals(ctx.terminated().size(), 0);
}
use of com.netflix.simianarmy.chaos.ChaosMonkey in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testMaxTerminationCountPerDayAsNegative.
@Test
public void testMaxTerminationCountPerDayAsNegative() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("terminationPerDayAsNegative.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
Assert.assertEquals(ctx.selectedOn().size(), 0);
Assert.assertEquals(ctx.terminated().size(), 0);
}
use of com.netflix.simianarmy.chaos.ChaosMonkey in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testEnabledB.
@Test
public void testEnabledB() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("enabledB.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
List<InstanceGroup> selectedOn = ctx.selectedOn();
List<String> terminated = ctx.terminated();
Assert.assertEquals(selectedOn.size(), 2);
Assert.assertEquals(selectedOn.get(0).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B);
Assert.assertEquals(selectedOn.get(0).name(), "name2");
Assert.assertEquals(selectedOn.get(1).type(), TestChaosMonkeyContext.CrawlerTypes.TYPE_B);
Assert.assertEquals(selectedOn.get(1).name(), "name3");
Assert.assertEquals(terminated.size(), 0, "nothing terminated");
}
use of com.netflix.simianarmy.chaos.ChaosMonkey in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testNotificationEnabled.
@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);
}
use of com.netflix.simianarmy.chaos.ChaosMonkey in project SimianArmy by Netflix.
the class TestBasicChaosMonkey method testDisabled.
@Test
public void testDisabled() {
TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("disabled.properties");
ChaosMonkey chaos = new BasicChaosMonkey(ctx);
chaos.start();
chaos.stop();
List<InstanceGroup> selectedOn = ctx.selectedOn();
List<String> terminated = ctx.terminated();
Assert.assertEquals(selectedOn.size(), 0, "no groups selected on");
Assert.assertEquals(terminated.size(), 0, "nothing terminated");
}
Aggregations