Tomas Jelinek has uploaded a new change for review.

Change subject: frontend: fix broken tests
......................................................................

frontend: fix broken tests

Some tests expected the WINDOWS_VM_NAME_MAX_LIMIT and
NON_WINDOWS_VM_NAME_MAX_LIMIT to be set, but they was set
from the AsyncDataProvider which is not inited in tests.

Added fallback to the default values.

Change-Id: Ia570c7e06f0c411025ae0a694225ccac83250d3f
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/06/17706/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
index 7b61112..c3eead6 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
@@ -59,11 +59,19 @@
 
 public class UnitVmModel extends Model {
 
-    public static final Integer WINDOWS_VM_NAME_MAX_LIMIT = (Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.MaxVmNameLengthWindows);
-    public static final Integer NON_WINDOWS_VM_NAME_MAX_LIMIT = (Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.MaxVmNameLengthNonWindows);
+    public static final Integer WINDOWS_VM_NAME_MAX_LIMIT;
+    public static final Integer NON_WINDOWS_VM_NAME_MAX_LIMIT;
     public static final int VM_TEMPLATE_NAME_MAX_LIMIT = 40;
     public static final int DESCRIPTION_MAX_LIMIT = 255;
 
+    static {
+        Integer maxVmNameLengthWindows = (Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.MaxVmNameLengthWindows);
+        WINDOWS_VM_NAME_MAX_LIMIT = maxVmNameLengthWindows == null ? 15 : 
maxVmNameLengthWindows;
+
+        Integer maxVmNameLengthNonWindows = (Integer) 
AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.MaxVmNameLengthNonWindows);
+        NON_WINDOWS_VM_NAME_MAX_LIMIT = maxVmNameLengthNonWindows == null ? 64 
: maxVmNameLengthNonWindows;
+    }
+
     private boolean privateIsNew;
 
     public boolean getIsNew()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia570c7e06f0c411025ae0a694225ccac83250d3f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to