use of com.cloud.agent.api.FindLogicalSwitchPortCommand in project cloudstack by apache.
the class NiciraNvpResourceTest method testFindLogicalSwitchPortApiException.
@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());
}
use of com.cloud.agent.api.FindLogicalSwitchPortCommand in project cloudstack by apache.
the class NiciraNvpResourceTest method testFindLogicalSwitchPort.
@Test
public void testFindLogicalSwitchPort() throws ConfigurationException, NiciraNvpApiException {
resource.configure("NiciraNvpResource", parameters);
final List<LogicalSwitchPort> lspl = Arrays.asList(new LogicalSwitchPort());
when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);
final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
assertTrue(flspa.getResult());
}
use of com.cloud.agent.api.FindLogicalSwitchPortCommand in project cloudstack by apache.
the class NiciraNvpResourceTest method testFindLogicalSwitchPortNotFound.
@Test
public void testFindLogicalSwitchPortNotFound() throws ConfigurationException, NiciraNvpApiException {
resource.configure("NiciraNvpResource", parameters);
@SuppressWarnings("unchecked") final List<LogicalSwitchPort> lspl = Collections.EMPTY_LIST;
when(nvpApi.findLogicalSwitchPortsByUuid("aaaa", "bbbb")).thenReturn(lspl);
final FindLogicalSwitchPortAnswer flspa = (FindLogicalSwitchPortAnswer) resource.executeRequest(new FindLogicalSwitchPortCommand("aaaa", "bbbb"));
assertFalse(flspa.getResult());
}
Aggregations