Search in sources :

Example 36 with VirtualRouter

use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.

the class NetworkHelperImplTest method testSendCommandsToRouterWrongRouterVersion.

@Test(expected = ResourceUnavailableException.class)
public void testSendCommandsToRouterWrongRouterVersion() throws AgentUnavailableException, OperationTimedoutException, ResourceUnavailableException {
    // Prepare
    final NetworkHelperImpl nwHelperUT = spy(this.nwHelper);
    final VirtualRouter vr = mock(VirtualRouter.class);
    doReturn(false).when(nwHelperUT).checkRouterVersion(vr);
    // Execute
    nwHelperUT.sendCommandsToRouter(vr, null);
    // Assert
    verify(this.agentManager, times(0)).send((Long) Matchers.anyObject(), (Command) Matchers.anyObject());
}
Also used : VirtualRouter(com.cloud.legacymodel.network.VirtualRouter) Test(org.junit.Test)

Aggregations

VirtualRouter (com.cloud.legacymodel.network.VirtualRouter)36 Commands (com.cloud.agent.manager.Commands)21 UpdateVmOverviewCommand (com.cloud.legacymodel.communication.command.UpdateVmOverviewCommand)8 VMOverviewTO (com.cloud.legacymodel.to.VMOverviewTO)8 NicVO (com.cloud.vm.NicVO)8 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)8 UpdateNetworkOverviewCommand (com.cloud.legacymodel.communication.command.UpdateNetworkOverviewCommand)7 NetworkOverviewTO (com.cloud.legacymodel.to.NetworkOverviewTO)7 DomainRouterVO (com.cloud.vm.DomainRouterVO)7 ServerApiException (com.cloud.api.ServerApiException)5 DomainRouterResponse (com.cloud.api.response.DomainRouterResponse)5 Zone (com.cloud.db.model.Zone)5 ResourceUnavailableException (com.cloud.legacymodel.exceptions.ResourceUnavailableException)5 Ip (com.cloud.legacymodel.network.Ip)5 UserVmVO (com.cloud.vm.UserVmVO)5 ArrayList (java.util.ArrayList)5 InvalidParameterValueException (com.cloud.legacymodel.exceptions.InvalidParameterValueException)4 Network (com.cloud.legacymodel.network.Network)4 Config (com.cloud.configuration.Config)3 ZoneRepository (com.cloud.db.repository.ZoneRepository)3