Package com.cloud.network.nicira

Examples of com.cloud.network.nicira.ControlClusterStatus


    }

  @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


 
  @Test
  public void testPingCommandStatusOk() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    ControlClusterStatus ccs = mock(ControlClusterStatus.class);
    when(ccs.getClusterStatus()).thenReturn("stable");
    when(_nvpApi.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, 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(final 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

    @Test
    public void testPingCommandStatusOk() throws ConfigurationException, NiciraNvpApiException {
        resource.configure("NiciraNvpResource", parameters);

        final ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getClusterStatus()).thenReturn("stable");
        when(nvpApi.getControlClusterStatus()).thenReturn(ccs);

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

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

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

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

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

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

        final 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

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

        ControlClusterStatus ccs = mock(ControlClusterStatus.class);
        when(ccs.getClusterStatus()).thenReturn("stable");
        when(_nvpApi.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.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.