Package com.cloud.network.nicira

Examples of com.cloud.network.nicira.ControlClusterStatus


    @Test
    public void testPingCommandStatusFail() throws ConfigurationException, NiciraNvpApiException {
        _resource.configure("NiciraNvpResource", _parameters);

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getClusterStatus()).thenReturn("unstable");
        when(_nvpApi.getControlClusterStatus()).thenReturn(ccs);

        PingCommand ping = _resource.getCurrentStatus(42);
        assertTrue(ping == null);
    }
View Full Code Here


    @Test
    public void testPingCommandStatusApiException() throws ConfigurationException, NiciraNvpApiException {
        _resource.configure("NiciraNvpResource", _parameters);

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getClusterStatus()).thenReturn("unstable");
        when(_nvpApi.getControlClusterStatus()).thenThrow(new NiciraNvpApiException());

        PingCommand ping = _resource.getCurrentStatus(42);
        assertTrue(ping == null);
    }
View Full Code Here

    }

    @Override
    public PingCommand getCurrentStatus(long id) {
        try {
            ControlClusterStatus ccs = _niciraNvpApi.getControlClusterStatus();
            if (!"stable".equals(ccs.getClusterStatus())) {
                s_logger.error("ControlCluster state is not stable: "
                        + ccs.getClusterStatus());
                return null;
            }
        } catch (NiciraNvpApiException e) {
            s_logger.error("getControlClusterStatus failed", e);
            return null;
View Full Code Here

TOP

Related Classes of com.cloud.network.nicira.ControlClusterStatus

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.