Allon Mureinik has uploaded a new change for review. Change subject: core: VmCommand's ConcreteCreateTask ......................................................................
core: VmCommand's ConcreteCreateTask Removed ConcreteCreateTask from VmCommand, and used the new getTaskType() mechanism introduced to CommandBase. Note that since VmCommand is abstract, the testing was done on RemoveVmCommand which extends it and does NOT override these methods itself. Change-Id: I8fb7c90caa1e327263c0b238ae0aff48ce6b2429 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java 2 files changed, 4 insertions(+), 11 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/7801/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java index 2703f19..ecd652c 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java @@ -12,11 +12,7 @@ import org.ovirt.engine.core.common.action.VdcActionParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.action.VmOperationParameterBase; -import org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo; -import org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters; import org.ovirt.engine.core.common.asynctasks.AsyncTaskType; -import org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum; -import org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum; import org.ovirt.engine.core.common.businessentities.Disk; import org.ovirt.engine.core.common.businessentities.DiskImage; import org.ovirt.engine.core.common.businessentities.DiskInterface; @@ -27,7 +23,6 @@ import org.ovirt.engine.core.common.businessentities.VmPayload; import org.ovirt.engine.core.common.businessentities.VmStatic; import org.ovirt.engine.core.common.businessentities.VmTemplate; -import org.ovirt.engine.core.common.businessentities.async_tasks; import org.ovirt.engine.core.common.businessentities.tags; import org.ovirt.engine.core.common.businessentities.tags_vm_map; import org.ovirt.engine.core.common.config.Config; @@ -355,12 +350,8 @@ } @Override - protected SPMAsyncTask ConcreteCreateTask(AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand) { - AsyncTaskParameters p = new AsyncTaskParameters(asyncTaskCreationInfo, new async_tasks(parentCommand, - AsyncTaskResultEnum.success, AsyncTaskStatusEnum.running, asyncTaskCreationInfo.getTaskID(), - getParameters(), asyncTaskCreationInfo.getStepId(), getCommandId())); - p.setEntityId(getParameters().getEntityId()); - return AsyncTaskManager.getInstance().CreateTask(AsyncTaskType.deleteImage, p); + protected AsyncTaskType getTaskType() { + return AsyncTaskType.deleteImage; } @Override diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java index 35089f3..1fc5e63 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java @@ -22,6 +22,7 @@ import org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters; import org.ovirt.engine.core.common.action.PermissionsOperationsParametes; import org.ovirt.engine.core.common.action.RemoveImageParameters; +import org.ovirt.engine.core.common.action.RemoveVmParameters; import org.ovirt.engine.core.common.action.RestoreFromSnapshotParameters; import org.ovirt.engine.core.common.action.VdcActionParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; @@ -66,6 +67,7 @@ new AddImageFromScratchCommand(new AddImageFromScratchParameters()), new CreateImageTemplateCommand(new CreateImageTemplateParameters()), new CreateCloneOfTemplateCommand(new CreateCloneOfTemplateParameters()), + new RemoveVmCommand(new RemoveVmParameters()), new MoveOrCopyImageGroupCommand(new MoveOrCopyImageGroupParameters()) { @Override protected void initContainerDetails(ImagesContainterParametersBase parameters) { -- To view, visit http://gerrit.ovirt.org/7801 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fb7c90caa1e327263c0b238ae0aff48ce6b2429 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
