Package com.cloud.network.bigswitch

Examples of com.cloud.network.bigswitch.ControlClusterStatus


    @Test
    public void testPingCommandStatusOk() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(true);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenReturn(ccs);

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


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

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(false);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenReturn(ccs);

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

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

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(false);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenThrow(new BigSwitchVnsApiException());

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

    }

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

    @Test
    public void testPingCommandStatusOk() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(true);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenReturn(ccs);

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

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

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(false);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenReturn(ccs);

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

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

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(false);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenThrow(new BigSwitchVnsApiException());

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

    }

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

    }

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

    @Test
    public void testPingCommandStatusOk() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getStatus()).thenReturn(true);
        when(_bigswitchVnsApi.getControlClusterStatus()).thenReturn(ccs);

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

TOP

Related Classes of com.cloud.network.bigswitch.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.