Package org.apache.cloudstack.api.command.user.vm

Examples of org.apache.cloudstack.api.command.user.vm.RemoveIpFromVmNicCmd


    @Before
    public void setUp() {
        addIpToVmNicCmd = new AddIpToVmNicCmd() {
        };
        removeIpFromVmNicCmd = new RemoveIpFromVmNicCmd();
    }
View Full Code Here


    @Test
    public void testRemoveIpFromVmNicSuccess() throws ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {

        NetworkService networkService = Mockito.mock(NetworkService.class);
        RemoveIpFromVmNicCmd removeIpFromNic = Mockito.mock(RemoveIpFromVmNicCmd.class);

        Mockito.when(
                networkService.releaseSecondaryIpFromNic(Mockito.anyInt())).thenReturn(true);

        removeIpFromNic._networkService = networkService;
        successResponseGenerator = Mockito.mock(SuccessResponse.class);

        removeIpFromNic.execute();
    }
View Full Code Here

    }

    @Test
    public void testRemoveIpFromVmNicFailure() throws InsufficientAddressCapacityException {
        NetworkService networkService = Mockito.mock(NetworkService.class);
        RemoveIpFromVmNicCmd removeIpFromNic = Mockito.mock(RemoveIpFromVmNicCmd.class);

        Mockito.when(
                networkService.releaseSecondaryIpFromNic(Mockito.anyInt())).thenReturn(false);

        removeIpFromNic._networkService = networkService;
        successResponseGenerator = Mockito.mock(SuccessResponse.class);

        try {
            removeIpFromNic.execute();
        } catch (InvalidParameterValueException exception) {
            Assert.assertEquals("Failed to remove secondary  ip address for the nic",
                    exception.getLocalizedMessage());
        }
    }
View Full Code Here

    @Override
    @Before
    public void setUp() {
        addIpToVmNicCmd = new AddIpToVmNicCmd() {
        };
        removeIpFromVmNicCmd = new RemoveIpFromVmNicCmd();
    }
View Full Code Here

    @Test
    public void testRemoveIpFromVmNicSuccess() throws ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException,
        InsufficientCapacityException {

        NetworkService networkService = Mockito.mock(NetworkService.class);
        RemoveIpFromVmNicCmd removeIpFromNic = Mockito.mock(RemoveIpFromVmNicCmd.class);

        Mockito.when(networkService.releaseSecondaryIpFromNic(Matchers.anyInt())).thenReturn(true);

        removeIpFromNic._networkService = networkService;
        successResponseGenerator = Mockito.mock(SuccessResponse.class);

        removeIpFromNic.execute();
    }
View Full Code Here

    }

    @Test
    public void testRemoveIpFromVmNicFailure() throws InsufficientAddressCapacityException {
        NetworkService networkService = Mockito.mock(NetworkService.class);
        RemoveIpFromVmNicCmd removeIpFromNic = Mockito.mock(RemoveIpFromVmNicCmd.class);

        Mockito.when(networkService.releaseSecondaryIpFromNic(Matchers.anyInt())).thenReturn(false);

        removeIpFromNic._networkService = networkService;
        successResponseGenerator = Mockito.mock(SuccessResponse.class);

        try {
            removeIpFromNic.execute();
        } catch (InvalidParameterValueException exception) {
            Assert.assertEquals("Failed to remove secondary  ip address for the nic", exception.getLocalizedMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.api.command.user.vm.RemoveIpFromVmNicCmd

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.