Package com.cloud.network.nicira

Examples of com.cloud.network.nicira.NiciraNvpApiException


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

        final LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort)any())).thenThrow(new NiciraNvpApiException());

        final CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        final CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer)resource.executeRequest(clspc);
        assertFalse(clspa.getResult());
    }
View Full Code Here


        resource.configure("NiciraNvpResource", parameters);

        final LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
        when(lsp.getUuid()).thenReturn("eeee");
        when(nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort)any())).thenReturn(lsp);
        doThrow(new NiciraNvpApiException()).when(nvpApi).updateLogicalSwitchPortAttachment((String)any(), (String)any(), (Attachment)any());

        final CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
        final CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer)resource.executeRequest(clspc);
        assertFalse(clspa.getResult());
        verify(nvpApi, atLeastOnce()).deleteLogicalSwitchPort((String)any(), (String)any());
View Full Code Here

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

        doThrow(new NiciraNvpApiException()).when(nvpApi).deleteLogicalSwitchPort((String)any(), (String)any());
        final DeleteLogicalSwitchPortAnswer dlspa = (DeleteLogicalSwitchPortAnswer)resource.executeRequest(new DeleteLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertFalse(dlspa.getResult());
    }
View Full Code Here

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

        doThrow(new NiciraNvpApiException()).when(nvpApi).updateLogicalSwitchPortAttachment((String)any(), (String)any(), (Attachment)any());
        final UpdateLogicalSwitchPortAnswer dlspa =
            (UpdateLogicalSwitchPortAnswer)resource.executeRequest(new UpdateLogicalSwitchPortCommand("aaaa", "bbbb", "cccc", "owner", "nicname"));
        assertFalse(dlspa.getResult());
    }
View Full Code Here

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

        when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenThrow(new NiciraNvpApiException());

        final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer)resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
        assertFalse(flspa.getResult());
    }
View Full Code Here

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

        when(nvpApi.createLogicalRouter((LogicalRouter)any())).thenThrow(new NiciraNvpApiException());
        final CreateLogicalRouterCommand clrc = new CreateLogicalRouterCommand("aaaaa", 50, "bbbbb", "lrouter", "publiccidr", "nexthop", "internalcidr", "owner");
        final CreateLogicalRouterAnswer clra = (CreateLogicalRouterAnswer)resource.executeRequest(clrc);

        assertFalse(clra.getResult());
    }
View Full Code Here

        resource.configure("NiciraNvpResource", parameters);

        final LogicalRouter lrc = mock(LogicalRouter.class);
        when(lrc.getUuid()).thenReturn("ccccc");
        when(nvpApi.createLogicalRouter((LogicalRouter)any())).thenReturn(lrc);
        when(nvpApi.createLogicalRouterPort(eq("ccccc"), (LogicalRouterPort)any())).thenThrow(new NiciraNvpApiException());
        final CreateLogicalRouterCommand clrc = new CreateLogicalRouterCommand("aaaaa", 50, "bbbbb", "lrouter", "publiccidr", "nexthop", "internalcidr", "owner");
        final CreateLogicalRouterAnswer clra = (CreateLogicalRouterAnswer)resource.executeRequest(clrc);

        assertFalse(clra.getResult());
        verify(nvpApi, atLeast(1)).deleteLogicalRouter(eq("ccccc"));
View Full Code Here

        when(lrp.getUuid()).thenReturn("ddddd").thenReturn("eeeee");
        when(lsp.getUuid()).thenReturn("fffff");
        when(nvpApi.createLogicalRouter((LogicalRouter)any())).thenReturn(lrc);
        when(nvpApi.createLogicalRouterPort(eq("ccccc"), (LogicalRouterPort)any())).thenReturn(lrp);
        when(nvpApi.createLogicalSwitchPort(eq("bbbbb"), (LogicalSwitchPort)any())).thenReturn(lsp);
        when(nvpApi.createLogicalRouterNatRule((String)any(), (NatRule)any())).thenThrow(new NiciraNvpApiException());
        final CreateLogicalRouterCommand clrc = new CreateLogicalRouterCommand("aaaaa", 50, "bbbbb", "lrouter", "publiccidr", "nexthop", "internalcidr", "owner");
        final CreateLogicalRouterAnswer clra = (CreateLogicalRouterAnswer)resource.executeRequest(clrc);

        assertFalse(clra.getResult());
        verify(nvpApi, atLeast(1)).deleteLogicalRouter(eq("ccccc"));
View Full Code Here

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

        doThrow(new NiciraNvpApiException()).when(nvpApi).deleteLogicalRouter(eq("aaaaa"));
        final DeleteLogicalRouterAnswer dlspa = (DeleteLogicalRouterAnswer)resource.executeRequest(new DeleteLogicalRouterCommand("aaaaa"));
        assertFalse(dlspa.getResult());
    }
View Full Code Here

        final
        NiciraNvpList<LogicalRouterPort> list = mock(NiciraNvpList.class);

        when(cmd.getLogicalRouterUuid()).thenReturn("aaaaa");
        when(cmd.getL3GatewayServiceUuid()).thenReturn("bbbbb");
        doThrow(new NiciraNvpApiException()).when(nvpApi).updateLogicalRouterPort((String)any(), (LogicalRouterPort)any());
        when(nvpApi.findLogicalRouterPortByGatewayServiceUuid("aaaaa", "bbbbb")).thenReturn(list);

        final ConfigurePublicIpsOnLogicalRouterAnswer answer = (ConfigurePublicIpsOnLogicalRouterAnswer)resource.executeRequest(cmd);
        assertFalse(answer.getResult());
View Full Code Here

TOP

Related Classes of com.cloud.network.nicira.NiciraNvpApiException

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.