Package com.axemblr.provisionr.api.pool

Examples of com.axemblr.provisionr.api.pool.Pool


    /**
     * Wrap the abstract {@code execute} method with the logic that knows how to create the Amazon client
     */
    @Override
    public void execute(DelegateExecution execution) throws Exception {
        Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL);
        checkNotNull(pool, "Please add the pool description as a process " +
            "variable with the name '%s'.", CoreProcessVariables.POOL);

        execute(providerClientCache.getUnchecked(pool.getProvider()), pool, execution);
    }
View Full Code Here


        final AdminAccess adminAccess = AdminAccess.builder().asCurrentUser().createAdminAccess();

        final Hardware hardware = Hardware.builder().type("offering").createHardware();

        final Pool pool = Pool.builder().network(network).provider(provider).adminAccess(adminAccess)
            .software(software).hardware(hardware).minSize(1).expectedSize(1).createPool();

        String processId = provisionr.startPoolManagementProcess(UUID.randomUUID().toString(), pool);
        waitForProcessEnd(processId);
        // TODO: check that the environment is clean
View Full Code Here

            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();

        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getAdminAccess()).thenReturn(adminAccess);

        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);

        activity.execute(execution);
View Full Code Here

    @Test
    public void testDeleteSecurityGroup() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        final Network network = Network.builder().createNetwork();

        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getNetwork()).thenReturn(network);

        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        SecurityGroups.createSecurityGroup(context.getApi(), SECURITY_GROUP_NAME);
View Full Code Here

    }

    @Test
    public void testCreateSecurityGroup() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getNetwork()).thenReturn(network);

        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        activity.execute(execution);
View Full Code Here

    }

    @Test
    public void testCreateSecurityGroupWithExistingSecurityGroup() throws Exception {
        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);

        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        // create the SecurityGroup with an extra Network Rule, then call the activity
        when(pool.getNetwork()).thenReturn(network.toBuilder().addRules(
            Rule.builder().anySource().tcp().port(80).createRule()).createNetwork());

        activity.execute(execution);
        // call the process again with the old network rules and check the rules
        when(pool.getNetwork()).thenReturn(network);

        activity.execute(execution);

        assertSecurityGroupExistsWithRules(SecurityGroups.getByName(context.getApi(),
            SECURITY_GROUP_NAME), ingressRules);
View Full Code Here

            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();

        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getAdminAccess()).thenReturn(adminAccess);
        when(pool.getProvider()).thenReturn(provider);

        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);

        activity.execute(execution);
View Full Code Here

            Rule.builder().anySource().port(53).udp().createRule()
        );

        final Network network = Network.builder().ingress(ingressRules).createNetwork();

        Pool pool = mock(Pool.class);

        when(pool.getProvider()).thenReturn(provider);
        when(pool.getNetwork()).thenReturn(network);

        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);
        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);

        activity.execute(execution);
View Full Code Here

public class SetupAdminAccessTest {

    @Test
    public void testCreatePuppetScript() throws Exception {
        Pool pool = mock(Pool.class);

        final AdminAccess adminAccess = AdminAccess.builder()
            .privateKey(TestConstants.PRIVATE_KEY)
            .publicKey(TestConstants.PUBLIC_KEY)
            .username(System.getProperty("user.name"))
            .createAdminAccess();

        when(pool.getAdminAccess()).thenReturn(adminAccess);

        PuppetActivity activity = new SetupAdminAccess();
        String content = activity.createPuppetScript(pool, null);

        final String username = adminAccess.getUsername();
View Full Code Here

            .publicKey(getResourceAsString("keys/test.pub"))
            .privateKey(getResourceAsString("keys/test"))
            .createAdminAccess();

        DelegateExecution execution = mock(DelegateExecution.class);
        Pool pool = mock(Pool.class);

        when(pool.getAdminAccess()).thenReturn(adminAccess);
        when(pool.getProvider()).thenReturn(provider);

        when(execution.getProcessBusinessKey()).thenReturn(BUSINESS_KEY);
        when(execution.getVariable(CoreProcessVariables.POOL)).thenReturn(pool);

        activity.execute(execution);
View Full Code Here

TOP

Related Classes of com.axemblr.provisionr.api.pool.Pool

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.