Allon Mureinik has uploaded a new change for review.

Change subject: core: Remove VDS ctor only used in tests
......................................................................

core: Remove VDS ctor only used in tests

Removed the ctor that isn't used anywhere in production code.
This in fact also makes the tests easier to understand, as now the test
VDSs instances only have the relevant field values and not all
the values demanded by this useless constructor.

Change-Id: I3ada208fb41b88e91772306ae438cc93bd560762
Signed-off-by: Allon Mureinik <amure...@redhat.com>
---
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJobTest.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
3 files changed, 10 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/18110/1

diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
index e356f25..dec3895 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
@@ -27,9 +27,6 @@
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
-import org.ovirt.engine.core.common.businessentities.VdsDynamic;
-import org.ovirt.engine.core.common.businessentities.VdsStatic;
-import org.ovirt.engine.core.common.businessentities.VdsStatistics;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterHookConflictFlags;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterHookContentType;
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity;
@@ -192,12 +189,11 @@
     }
 
     private VDS createServer(Guid serverId, String hostname) {
-        VdsStatic vdsStatic = new VdsStatic();
-        vdsStatic.setId(serverId);
-        vdsStatic.setHostName(hostname);
-        VdsDynamic vdsDynamic = new VdsDynamic();
-        vdsDynamic.setstatus(VDSStatus.Up);
-        return new VDS(vdsStatic, vdsDynamic, new VdsStatistics());
+        VDS vds = new VDS();
+        vds.setId(serverId);
+        vds.setHostName(hostname);
+        vds.setStatus(VDSStatus.Up);
+        return vds;
     }
 
     private VDSGroup createCluster(int index) {
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJobTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJobTest.java
index 45594d0..66ada8c 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJobTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJobTest.java
@@ -31,9 +31,6 @@
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
-import org.ovirt.engine.core.common.businessentities.VdsDynamic;
-import org.ovirt.engine.core.common.businessentities.VdsStatic;
-import org.ovirt.engine.core.common.businessentities.VdsStatistics;
 import org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol;
 import org.ovirt.engine.core.common.businessentities.gluster.BrickDetails;
 import org.ovirt.engine.core.common.businessentities.gluster.BrickProperties;
@@ -160,7 +157,7 @@
         existingServer2 = createServer(SERVER_ID_2, SERVER_NAME_2, version);
         existingServers.add(existingServer1);
         existingServers.add(existingServer2);
-        existingServers.add(createServer(SERVER_ID_3, SERVER_NAME_3,version));
+        existingServers.add(createServer(SERVER_ID_3, SERVER_NAME_3, version));
 
         existingDistVol = createDistVol(DIST_VOL_NAME, EXISTING_VOL_DIST_ID);
         existingReplVol = createReplVol();
@@ -177,12 +174,10 @@
     }
 
     private VDS createServer(Guid serverId, String hostname, Version version) {
-        VdsStatic vdsStatic = new VdsStatic();
-        vdsStatic.setId(serverId);
-        vdsStatic.setHostName(hostname);
-        VdsDynamic vdsDynamic = new VdsDynamic();
-        vdsDynamic.setstatus(VDSStatus.Up);
-        VDS vds = new VDS(vdsStatic, vdsDynamic, new VdsStatistics());
+        VDS vds = new VDS();
+        vds.setId(serverId);
+        vds.setHostName(hostname);
+        vds.setStatus(VDSStatus.Up);
         vds.setVdsGroupCompatibilityVersion(version);
         return vds;
     }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
index dae2f5a..db4ebe1 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java
@@ -193,12 +193,6 @@
         this.setHBAs(HBAs);
     }
 
-    public VDS(VdsStatic vdsStatic, VdsDynamic vdsDynamic, VdsStatistics 
vdsStatistics) {
-        this.mVdsStatic = vdsStatic;
-        this.mVdsDynamic = vdsDynamic;
-        this.mVdsStatistics = vdsStatistics;
-    }
-
     public VDS clone() {
         VDS vds =
                 new VDS(getVdsGroupId(),


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ada208fb41b88e91772306ae438cc93bd560762
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amure...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to