Hello Allon Mureinik,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/32427

to review the following change.

Change subject: core: StoragePoolValidatorTest config mocking
......................................................................

core: StoragePoolValidatorTest config mocking

Removed redundant mocking that's not used in the test and streamlined
the existing mocking to use two version - 3.0 as an "old" version which
does not support new features and 3.1 and a "new" version which does.

Related-To: https://bugzilla.redhat.com/1127590
Change-Id: If916e1080686ec037dba6f79264307e73b1502d2
Signed-off-by: Allon Mureinik <amure...@redhat.com>
---
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java
1 file changed, 12 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/32427/1

diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java
index 2d8e5d1..ef79dee 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java
@@ -20,16 +20,15 @@
 
 public class StoragePoolValidatorTest {
 
+    private static final Version UNSUPPORTED_VERSION = Version.v3_0;
+    private static final Version SUPPORTED_VERSION = Version.v3_3;
+
     @ClassRule
     public static MockConfigRule mce = new MockConfigRule
-            (mockConfig(ConfigValues.PosixStorageEnabled, 
Version.v3_1.toString(), true),
-                    mockConfig(ConfigValues.PosixStorageEnabled, 
Version.v3_0.toString(), false),
-                    mockConfig(ConfigValues.PosixStorageEnabled, 
Version.v2_2.toString(), false),
-                    mockConfig(ConfigValues.PosixStorageEnabled, "general", 
false),
-                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
Version.v3_1.toString(), false),
-                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
Version.v3_2.toString(), false),
-                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
Version.v3_0.toString(), false),
-                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
Version.v3_3.toString(), true));
+            (mockConfig(ConfigValues.PosixStorageEnabled, 
UNSUPPORTED_VERSION.toString(), false),
+                    mockConfig(ConfigValues.PosixStorageEnabled, 
SUPPORTED_VERSION.toString(), true),
+                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
UNSUPPORTED_VERSION.toString(), false),
+                    mockConfig(ConfigValues.GlusterFsStorageEnabled, 
SUPPORTED_VERSION.toString(), true));
 
     private StoragePoolValidator validator = null;
     private StoragePool storagePool = null;
@@ -43,14 +42,14 @@
 
     @Test
     public void testPosixDcAndMatchingCompatiblityVersion() {
-        storagePool.setcompatibility_version(Version.v3_1);
+        storagePool.setcompatibility_version(SUPPORTED_VERSION);
         storagePool.setIsLocal(false);
         assertTrue(validator.isPosixSupportedInDC().isValid());
     }
 
     @Test
     public void testPosixDcAndNotMatchingCompatiblityVersion() {
-        storagePool.setcompatibility_version(Version.v3_0);
+        storagePool.setcompatibility_version(UNSUPPORTED_VERSION);
         storagePool.setIsLocal(false);
         ValidationResult result = validator.isPosixSupportedInDC();
         assertFalse(result.isValid());
@@ -59,14 +58,14 @@
 
     @Test
     public void testGlusterDcAndMatchingCompatiblityVersion() {
-        storagePool.setcompatibility_version(Version.v3_3);
+        storagePool.setcompatibility_version(SUPPORTED_VERSION);
         storagePool.setIsLocal(false);
         assertTrue(validator.isGlusterSupportedInDC().isValid());
     }
 
     @Test
     public void testGlusterDcAndNotMatchingCompatiblityVersion() {
-        storagePool.setcompatibility_version(Version.v3_1);
+        storagePool.setcompatibility_version(UNSUPPORTED_VERSION);
         storagePool.setIsLocal(false);
         ValidationResult result = validator.isGlusterSupportedInDC();
         assertFalse(result.isValid());
@@ -75,7 +74,7 @@
 
     @Test
     public void testLocalDcAndMatchingCompatiblityVersion() {
-        storagePool.setcompatibility_version(Version.v3_0);
+        storagePool.setcompatibility_version(UNSUPPORTED_VERSION);
         storagePool.setIsLocal(true);
         assertTrue(validator.isPosixSupportedInDC().isValid());
     }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If916e1080686ec037dba6f79264307e73b1502d2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: 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