Package com.cloud.network.nicira

Examples of com.cloud.network.nicira.NiciraNvpApiException


  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


  public void testRetries() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    LogicalSwitch ls = mock(LogicalSwitch.class);
    when(ls.getUuid()).thenReturn("cccc").thenReturn("cccc");
    when(_nvpApi.createLogicalSwitch((LogicalSwitch) any())).thenThrow(new NiciraNvpApiException()).thenThrow(new NiciraNvpApiException()).thenReturn(ls);
   
    CreateLogicalSwitchCommand clsc = new CreateLogicalSwitchCommand((String)_parameters.get("guid"), "stt", "loigicalswitch","owner");
    CreateLogicalSwitchAnswer clsa = (CreateLogicalSwitchAnswer) _resource.executeRequest(clsc);
    assertTrue(clsa.getResult());
  }
View Full Code Here

  public void testCreateLogicalSwitchApiException() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    LogicalSwitch ls = mock(LogicalSwitch.class);
    when(ls.getUuid()).thenReturn("cccc").thenReturn("cccc");
    when(_nvpApi.createLogicalSwitch((LogicalSwitch) any())).thenThrow(new NiciraNvpApiException());
   
    CreateLogicalSwitchCommand clsc = new CreateLogicalSwitchCommand((String)_parameters.get("guid"), "stt", "loigicalswitch","owner");
    CreateLogicalSwitchAnswer clsa = (CreateLogicalSwitchAnswer) _resource.executeRequest(clsc);
    assertFalse(clsa.getResult());
  }
View Full Code Here

  @Test
  public void testDeleteLogicalSwitchApiException() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    doThrow(new NiciraNvpApiException()).when(_nvpApi).deleteLogicalSwitch((String)any());
   
    DeleteLogicalSwitchCommand dlsc = new DeleteLogicalSwitchCommand("cccc");
    DeleteLogicalSwitchAnswer dlsa = (DeleteLogicalSwitchAnswer) _resource.executeRequest(dlsc);
    assertFalse(dlsa.getResult());
  }
View Full Code Here

  public void testCreateLogicalSwitchPortApiExceptionInCreate() throws ConfigurationException, NiciraNvpApiException {
    _resource.configure("NiciraNvpResource", _parameters);
   
    LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
    when(lsp.getUuid()).thenReturn("eeee");
    when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenThrow(new NiciraNvpApiException());
   
    CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
    CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
    assertFalse(clspa.getResult());   
  }
View Full Code Here

    _resource.configure("NiciraNvpResource", _parameters);
   
    LogicalSwitchPort lsp = mock(LogicalSwitchPort.class);
    when(lsp.getUuid()).thenReturn("eeee");
    when(_nvpApi.createLogicalSwitchPort(eq("cccc"), (LogicalSwitchPort) any())).thenReturn(lsp);
    doThrow(new NiciraNvpApiException()).when(_nvpApi).modifyLogicalSwitchPortAttachment((String)any(), (String)any(), (Attachment)any());
   
   
    CreateLogicalSwitchPortCommand clspc = new CreateLogicalSwitchPortCommand("cccc", "dddd", "owner", "nicname");
    CreateLogicalSwitchPortAnswer clspa = (CreateLogicalSwitchPortAnswer) _resource.executeRequest(clspc);
    assertFalse(clspa.getResult());   
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());
    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).modifyLogicalSwitchPortAttachment((String) any(), (String) any(), (Attachment) any());
    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());
   
    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((LogicalRouterConfig)any())).thenThrow(new NiciraNvpApiException());
    CreateLogicalRouterCommand clrc = new CreateLogicalRouterCommand("aaaaa", 50, "bbbbb", "lrouter", "publiccidr", "nexthop", "internalcidr", "owner");
    CreateLogicalRouterAnswer clra = (CreateLogicalRouterAnswer) _resource.executeRequest(clrc);
   
    assertFalse(clra.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.