use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class IscsiBondValidatorTest method addedLogicalNetworkBelongToAnotherDatacenter2.
@Test
public void addedLogicalNetworkBelongToAnotherDatacenter2() {
Guid dataCenterId = Guid.newGuid();
IscsiBond before = createIscsiBond("Before", dataCenterId);
IscsiBond after = createIscsiBond("After", dataCenterId);
List<Network> networks = new ArrayList<>();
networks.add(createNetwork(dataCenterId));
doReturn(networks).when(networkDao).getAllForDataCenter(dataCenterId);
before.getNetworkIds().add(networks.get(0).getId());
after.getNetworkIds().add(networks.get(0).getId());
after.getNetworkIds().add(Guid.newGuid());
ValidationResult res = validator.validateAddedLogicalNetworks(after, before);
assertThat(res, failsWith(EngineMessage.NETWORKS_DONT_EXIST_IN_DATA_CENTER));
assertEquals(2, res.getVariableReplacements().size());
assertEquals("$networkIds " + after.getNetworkIds().get(1).toString(), res.getVariableReplacements().get(0));
assertEquals("$dataCenterId " + after.getStoragePoolId().toString(), res.getVariableReplacements().get(1));
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class NetworkValidatorTest method getIscsiBondList.
private static List<IscsiBond> getIscsiBondList() {
List<IscsiBond> iscsiBondList = new ArrayList<>();
IscsiBond iscsiBond = new IscsiBond();
iscsiBond.setId(Guid.newGuid());
iscsiBond.setName("IscsiBond name");
iscsiBondList.add(iscsiBond);
return iscsiBondList;
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class BackendIscsiBondNetworkResourceTest method getIscsiBondWithNoMatchingNetworks.
private org.ovirt.engine.core.common.businessentities.IscsiBond getIscsiBondWithNoMatchingNetworks() {
org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = new org.ovirt.engine.core.common.businessentities.IscsiBond();
iscsiBond.setId(ISCSI_BOND_ID);
iscsiBond.getNetworkIds().add(GUIDS[0]);
return iscsiBond;
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class DataCenterIscsiBondListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
model.setTitle(ConstantsManager.getInstance().getConstants().removeIscsiBondTitle());
model.setHelpTag(HelpTag.remove_iscsi_bundle);
// $NON-NLS-1$
model.setHashName("remove_iscsi_bundle");
setWindow(model);
model.getLatch().setEntity(false);
ArrayList<String> items = new ArrayList<>();
for (IscsiBond selected : getSelectedItems()) {
items.add(selected.getName());
}
model.setItems(items);
// $NON-NLS-1$
UICommand removeCommand = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(removeCommand);
model.getCommands().add(createCancelCommand());
}
use of org.ovirt.engine.core.common.businessentities.IscsiBond in project ovirt-engine by oVirt.
the class GetIscsiBondByIdQueryTest method testExecuteQueryWithNotExistingIscsiBond.
@Test
public void testExecuteQueryWithNotExistingIscsiBond() {
when(getQueryParameters().getId()).thenReturn(iscsiBondId);
getQuery().executeQueryCommand();
IscsiBond result = getQuery().getQueryReturnValue().getReturnValue();
assertNull(result);
}
Aggregations