use of org.ovirt.engine.core.common.action.gluster.RemoveGlusterServerParameters in project ovirt-engine by oVirt.
the class ClusterGeneralModel method onDetachNewGlusterHosts.
public void onDetachNewGlusterHosts() {
if (getWindow() == null) {
return;
}
final DetachGlusterHostsModel hostsModel = (DetachGlusterHostsModel) getWindow();
if (!hostsModel.validate()) {
return;
}
boolean force = hostsModel.getForce().getEntity();
ArrayList<ActionParametersBase> parametersList = new ArrayList<>();
for (Object model : hostsModel.getHosts().getSelectedItems()) {
String host = (String) ((EntityModel) model).getEntity();
parametersList.add(new RemoveGlusterServerParameters(getEntity().getId(), host, force));
}
Frontend.getInstance().runMultipleAction(ActionType.RemoveGlusterServer, parametersList);
cancel();
}
use of org.ovirt.engine.core.common.action.gluster.RemoveGlusterServerParameters in project ovirt-engine by oVirt.
the class RemoveGlusterServerCommandTest method validateSucceeds.
@Test
public void validateSucceeds() {
cmd = spy(new RemoveGlusterServerCommand(new RemoveGlusterServerParameters(CLUSTER_ID, SERVER_NAME, false), null));
prepareMocks(cmd);
assertTrue(cmd.validate());
}
use of org.ovirt.engine.core.common.action.gluster.RemoveGlusterServerParameters in project ovirt-engine by oVirt.
the class RemoveGlusterServerCommandTest method validateFailsOnNull.
@Test
public void validateFailsOnNull() {
cmd = spy(new RemoveGlusterServerCommand(new RemoveGlusterServerParameters(CLUSTER_ID, null, false), null));
prepareMocks(cmd);
assertFalse(cmd.validate());
}
Aggregations