Examples of PingCommand


Examples of com.cloud.agent.api.PingCommand

    @Test
    public void testPingCommandStatusOk() throws ConfigurationException, ExecutionException {
        _resource.setConnection(_connection);
        when(_connection.login()).thenReturn(true);
        PingCommand ping = _resource.getCurrentStatus(1);
        assertTrue(ping != null);
        assertTrue(ping.getHostId() == 1);
        assertTrue(ping.getHostType() == Host.Type.ExternalFirewall);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

    @Test
    public void testPingCommandStatusFail() throws ConfigurationException, ExecutionException {
        _resource.setConnection(_connection);
        when(_connection.login()).thenReturn(false);
        PingCommand ping = _resource.getCurrentStatus(1);
        assertTrue(ping == null);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

    @Override
    public PingCommand getCurrentStatus(final long id) {
        if (!refreshVnmcConnection()) {
            return null;
        }
        return new PingCommand(Host.Type.ExternalFirewall, id);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

   
    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);
    assertTrue(ping.getHostType() == Host.Type.L2Networking);   
  }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

   
    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

Examples of com.cloud.agent.api.PingCommand

   
    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

Examples of com.cloud.agent.api.PingCommand

        return true;
    }

    @Override
    public PingCommand getCurrentStatus(final long id) {
        return new PingCommand(Host.Type.ExternalFirewall, id);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

        return null;
    }

    @Override
    public PingCommand getCurrentStatus(long id) {
        return new PingCommand(Host.Type.ExternalLoadBalancer, id);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

    return _name;
  }
 
  @Override
    public PingCommand getCurrentStatus(final long id) {
    return new PingCommand(Host.Type.TrafficMonitor, id);
    }
View Full Code Here

Examples of com.cloud.agent.api.PingCommand

        public synchronized void run() {
            try {
                ServerResource resource = _resource;

                if (resource != null) {
                    PingCommand cmd = resource.getCurrentStatus(_id);
                    if (cmd == null) {
                        s_logger.warn("Unable to get current status on " + _id);
                        _mgr.disconnectWithInvestigation(DirectAgentAttache.this, Event.AgentDisconnected);
                        return;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.