Package org.nimbustools.api.repr

Examples of org.nimbustools.api.repr.CreateResult


        final int numNodes = 5;
        final CreateRequest creq =
                this.populator().getCreateRequest("suite:failure:complicatedFail",
                                                  durationSecs, memory, numNodes);
        final Caller caller = this.populator().getCaller();
        final CreateResult result = rm.create(creq, caller);

        final VM[] vms = result.getVMs();
        assertEquals(5, vms.length);
        for (int i = 0; i < vms.length; i++) {
            assertNotNull(vms[i]);
            logger.info("Leased vm '" + vms[i].getID() + '\'');
            assertTrue(rm.exists(vms[i].getID(), Manager.INSTANCE));
        }

        Thread.sleep(2000L);
        assertEquals(0, MockShutdownTrash.getFailCount());

        // Fail at killing the instances:
        MockShutdownTrash.setFail(true);
        logger.warn("Set to fail.");

        rm.trash(vms[0].getID(), Manager.INSTANCE, caller);
        rm.trash(vms[1].getID(), Manager.INSTANCE, caller);
        Thread.sleep(4000L);

        int lastFailCount = MockShutdownTrash.getFailCount();
        assertFalse(0 == lastFailCount);
        assertTrue(rm.exists(vms[0].getID(), Manager.INSTANCE));
        assertTrue(rm.exists(vms[1].getID(), Manager.INSTANCE));
        allvms = rm.getGlobalAll();
        assertEquals(5, allvms.length);

        Thread.sleep(4000L);
        assertTrue(rm.exists(vms[0].getID(), Manager.INSTANCE));
        assertTrue(rm.exists(vms[1].getID(), Manager.INSTANCE));
        allvms = rm.getGlobalAll();
        assertEquals(5, allvms.length);

        // Start succeeding to kill the instances:
        MockShutdownTrash.setFail(false);
        logger.warn("Set to succeed.");

        Thread.sleep(15000L);

        // Should now be gone:
        assertFalse(rm.exists(vms[0].getID(), Manager.INSTANCE));
        assertFalse(rm.exists(vms[1].getID(), Manager.INSTANCE));
        allvms = rm.getGlobalAll();
        assertEquals(3, allvms.length);

        // Start counting from scratch
        MockShutdownTrash.resetFailCount();

        // Add two in a new group, with very short duration
        final int durationSecs2 = 5;
        final int memory2 = 64;
        final int numNodes2 = 2;
        final CreateRequest creq2 =
                this.populator().getCreateRequest("suite:failure:complicatedFail2",
                                                  durationSecs2, memory2, numNodes2);
        final CreateResult result2 = rm.create(creq2, caller);

        VM[] vms2 = result2.getVMs();
        assertEquals(2, vms2.length);
        for (int i = 0; i < vms2.length; i++) {
            assertNotNull(vms2[i]);
            logger.info("Leased vm '" + vms2[i].getID() + '\'');
            assertTrue(rm.exists(vms2[i].getID(), Manager.INSTANCE));
View Full Code Here


        final int numNodes = 1;
        final CreateRequest creq =
                this.populator().getCreateRequest("suite:failure:unpropOneFail",
                                                  durationSecs, memory, numNodes);
        final Caller caller = this.populator().getCaller();
        final CreateResult result = rm.create(creq, caller);

        final VM[] vms = result.getVMs();
        assertEquals(1, vms.length);
        assertNotNull(vms[0]);
        logger.info("Leased vm '" + vms[0].getID() + '\'');
        assertTrue(rm.exists(vms[0].getID(), Manager.INSTANCE));
View Full Code Here

        AddCustomizations.addAll(cReq, this.repr, this.mdServer);

        // --------------
        // *** create ***
        // --------------
        final CreateResult result = this.manager.create(cReq, caller);

        // ---------------------------------------------------
        // WS response based on creation and ctxBroker results
        // ---------------------------------------------------
        final WorkspaceCreateResponse_Type response =
View Full Code Here

            throw new RemoteException("RunInstancesType request is missing");
        }

        final Caller caller = this.container.getCaller();

        final CreateResult result;
        try {
            CreateRequest creq =
                    this.run.translateRunInstances(req, caller);
            AddCustomizations.addAll((_CreateRequest)creq,
                                     this.repr, this.mdServer);
View Full Code Here

        assertEquals(0, allvms.length);
       
        MockShutdownTrash.resetFailCount();

        final Caller caller = this.populator().getCaller();
        final CreateResult result =
                rm.create(this.populator().getCreateRequest("suite:backoff:nobackoff"),
                          caller);

        final VM[] vms = result.getVMs();
        assertEquals(1, vms.length);
        assertNotNull(vms[0]);
        logger.info("Leased vm '" + vms[0].getID() + '\'');

        assertTrue(rm.exists(vms[0].getID(), Manager.INSTANCE));
View Full Code Here

        assertEquals(0, allvms.length);

        MockShutdownTrash.resetFailCount();

        final Caller caller = this.populator().getCaller();
        final CreateResult result =
                rm.create(this.populator().getCreateRequest("suite:backoff:yesbackoff"),
                          caller);

        final VM[] vms = result.getVMs();
        assertEquals(1, vms.length);
        assertNotNull(vms[0]);
        logger.info("Leased vm '" + vms[0].getID() + '\'');

        assertTrue(rm.exists(vms[0].getID(), Manager.INSTANCE));
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.CreateResult

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.