Package com.netflix.simianarmy.basic.chaos

Examples of com.netflix.simianarmy.basic.chaos.BasicChaosMonkey


        String input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupType\":\"TYPE_C\",\"groupName\":\"name4\"}";

        Assert.assertEquals(ctx.selectedOn().size(), 0);
        Assert.assertEquals(ctx.terminated().size(), 0);

        ChaosMonkeyResource resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.OK);
        Assert.assertEquals(ctx.selectedOn().size(), 1);
        Assert.assertEquals(ctx.terminated().size(), 1);

        validateAddEventResult(resource, input, Response.Status.OK);
View Full Code Here


        String input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupType\":\"TYPE_C\",\"groupName\":\"name4\"}";

        Assert.assertEquals(ctx.selectedOn().size(), 0);
        Assert.assertEquals(ctx.terminated().size(), 0);

        ChaosMonkeyResource resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.FORBIDDEN);
        Assert.assertEquals(ctx.selectedOn().size(), 0);
        Assert.assertEquals(ctx.terminated().size(), 0);
    }
View Full Code Here

    @Test
    void testTerminateNowBadInput() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("ondemandTermination.properties");
        String input = "{\"groupType\":\"TYPE_C\",\"groupName\":\"name4\"}";

        ChaosMonkeyResource resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.BAD_REQUEST);

        input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupName\":\"name4\"}";
        resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.BAD_REQUEST);

        input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupType\":\"TYPE_C\"}";
        resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.BAD_REQUEST);
    }
View Full Code Here

    @Test
    void testTerminateNowBadGroupNotExist() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("ondemandTermination.properties");

        String input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupType\":\"INVALID\",\"groupName\":\"name4\"}";
        ChaosMonkeyResource resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.NOT_FOUND);

        input = "{\"eventType\":\"CHAOS_TERMINATION\",\"groupType\":\"TYPE_C\",\"groupName\":\"INVALID\"}";
        resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.NOT_FOUND);
    }
View Full Code Here

    @Test
    void testTerminateNowBadEventType() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("ondemandTermination.properties");

        String input = "{\"eventType\":\"INVALID\",\"groupType\":\"TYPE_C\",\"groupName\":\"name4\"}";
        ChaosMonkeyResource resource = new ChaosMonkeyResource(new BasicChaosMonkey(ctx));
        validateAddEventResult(resource, input, Response.Status.BAD_REQUEST);
    }
View Full Code Here

        properties.setProperty("simianarmy.chaos.ssh.key", sshKey.getAbsolutePath());

        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext(properties);

        ChaosMonkey chaos = new BasicChaosMonkey(ctx);
        chaos.start();
        chaos.stop();
        return ctx;
    }
View Full Code Here

TOP

Related Classes of com.netflix.simianarmy.basic.chaos.BasicChaosMonkey

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.