Allon Mureinik has uploaded a new change for review.

Change subject: core: Remove ActionVersionMap ctor used in tests
......................................................................

core: Remove ActionVersionMap ctor used in tests

Removed the ctor that isn't used anywhere in production code.

Change-Id: Idf70140e80240e7bf9950e7c48da3aef604ca2bc
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetCommandsCompatibilityVersionsQueryTest.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ActionGroupDAOTest.java
3 files changed, 13 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/18128/1

diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetCommandsCompatibilityVersionsQueryTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetCommandsCompatibilityVersionsQueryTest.java
index 52c1757..aa0f36d 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetCommandsCompatibilityVersionsQueryTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetCommandsCompatibilityVersionsQueryTest.java
@@ -37,11 +37,15 @@
     @Test
     public void testExecuteQueryCommand() {
         GetCommandsCompatibilityVersionsQuery<VdcQueryParametersBase> 
queryToRun = getQuery();
-        List<ActionVersionMap> entriesFromDb =
-                Arrays.asList(new ActionVersionMap(VdcActionType.RunVm, 
RUN_VM_VERSION, RUN_VM_VERSION),
-                        new ActionVersionMap(VdcActionType.AddVmFromSnapshot,
-                                ADD_VM_FROM_SNAPSHOT_VERSION,
-                                ADD_VM_FROM_SNAPSHOT_VERSION));
+        ActionVersionMap runVm = new ActionVersionMap();
+        runVm.setaction_type(VdcActionType.RunVm);
+        runVm.setcluster_minimal_version(RUN_VM_VERSION.toString());
+        runVm.setstorage_pool_minimal_version(RUN_VM_VERSION.toString());
+        ActionVersionMap addVmFromSnapshot = new ActionVersionMap();
+        addVmFromSnapshot.setaction_type(VdcActionType.AddVmFromSnapshot);
+        
addVmFromSnapshot.setcluster_minimal_version(ADD_VM_FROM_SNAPSHOT_VERSION.toString());
+        
addVmFromSnapshot.setstorage_pool_minimal_version(ADD_VM_FROM_SNAPSHOT_VERSION.toString());
+        List<ActionVersionMap> entriesFromDb = Arrays.asList(runVm, 
addVmFromSnapshot);
         
doReturn(entriesFromDb).when(actionGroupDaoMock).getAllActionVersionMap();
         queryToRun.execute();
         VdcQueryReturnValue returnValue = queryToRun.getQueryReturnValue();
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
index 12452da..5d943d5 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ActionVersionMap.java
@@ -4,7 +4,6 @@
 
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.utils.ObjectUtils;
-import org.ovirt.engine.core.compat.Version;
 
 public class ActionVersionMap implements Serializable {
     private static final long serialVersionUID = -212222175662336097L;
@@ -14,16 +13,6 @@
 
     public ActionVersionMap(boolean nullValue) {
         this.nullValue = nullValue;
-    }
-
-    public ActionVersionMap(VdcActionType actionType, String 
clusterMinimalVersion, String storagePoolMinimalVersion) {
-        setaction_type(actionType);
-        setcluster_minimal_version(clusterMinimalVersion);
-        setstorage_pool_minimal_version(storagePoolMinimalVersion);
-    }
-
-    public ActionVersionMap(VdcActionType actionType, Version 
clusterMinimalVersion, Version storagePoolMinimalVersion) {
-        this(actionType, clusterMinimalVersion.toString(), 
storagePoolMinimalVersion.toString());
     }
 
     private int actionType = VdcActionType.Unknown.getValue();
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ActionGroupDAOTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ActionGroupDAOTest.java
index 6ccafd4..d32b930 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ActionGroupDAOTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/ActionGroupDAOTest.java
@@ -27,7 +27,10 @@
 
         dao = dbFacade.getActionGroupDao();
         existingActionMap = 
dao.getActionVersionMapByActionType(VdcActionType.AddVm);
-        newActionMap = new 
ActionVersionMap(VdcActionType.ActivateStorageDomain, "3.0", "3.0");
+        newActionMap = new ActionVersionMap();
+        newActionMap.setaction_type(VdcActionType.ActivateStorageDomain);
+        newActionMap.setcluster_minimal_version("3.0");
+        newActionMap.setstorage_pool_minimal_version("3.0");
     }
 
     @Test


-- 
To view, visit http://gerrit.ovirt.org/18128
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf70140e80240e7bf9950e7c48da3aef604ca2bc
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

Reply via email to