use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class GetIscsiBondByIdQueryTest method mockIscsiBond.
private IscsiBond mockIscsiBond() {
IscsiBond iscsiBond = new IscsiBond();
iscsiBond.setId(iscsiBondId);
return iscsiBond;
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class GetIscsiBondsByStoragePoolIdQueryTest method testExecuteQueryCommand.
@Test
public void testExecuteQueryCommand() {
Guid storagePoolId = Guid.newGuid();
Guid networkId = Guid.newGuid();
String connectionId = Guid.newGuid().toString();
IscsiBond iscsiBond = new IscsiBond();
iscsiBond.setId(Guid.newGuid());
when(getQueryParameters().getId()).thenReturn(storagePoolId);
when(iscsiBondDao.getAllByStoragePoolId(storagePoolId)).thenReturn(Collections.singletonList(iscsiBond));
when(iscsiBondDao.getNetworkIdsByIscsiBondId(iscsiBond.getId())).thenReturn(Collections.singletonList(networkId));
when(iscsiBondDao.getStorageConnectionIdsByIscsiBondId(iscsiBond.getId())).thenReturn(Collections.singletonList(connectionId));
getQuery().executeQueryCommand();
List<IscsiBond> result = getQuery().getQueryReturnValue().getReturnValue();
assertNotNull(result);
assertEquals(1, result.size());
assertEquals(iscsiBond, result.get(0));
assertNotNull(iscsiBond.getNetworkIds());
assertEquals(1, iscsiBond.getNetworkIds().size());
assertEquals(iscsiBond.getNetworkIds().get(0), networkId);
assertNotNull(iscsiBond.getStorageConnectionIds());
assertEquals(1, iscsiBond.getStorageConnectionIds().size());
assertEquals(iscsiBond.getStorageConnectionIds().get(0), connectionId);
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class IscsiBondDaoTest method generateNewEntity.
@Override
protected IscsiBond generateNewEntity() {
IscsiBond newIscsiBond = new IscsiBond();
newIscsiBond.setId(Guid.newGuid());
newIscsiBond.setName("Multipath");
newIscsiBond.setDescription("New iscsi bond for multipathing");
newIscsiBond.setStoragePoolId(FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER);
return newIscsiBond;
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondNetworkResource method remove.
@Override
public Response remove() {
get();
IscsiBond iscsiBond = parent.getIscsiBond();
iscsiBond.getNetworkIds().remove(guid);
return performAction(ActionType.EditIscsiBond, new EditIscsiBondParameters(iscsiBond));
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondNetworkResource method get.
@Override
public Network get() {
IscsiBond iscsiBond = parent.getIscsiBond();
if (!iscsiBond.getNetworkIds().contains(guid)) {
return notFound();
}
org.ovirt.engine.core.common.businessentities.network.Network entity = getNetwork();
if (entity == null) {
return notFound();
}
return addLinks(map(entity));
}
Aggregations