@@ -0,0 +1,2092 @@
+package org.ovirt.engine.core.bll.scheduling.commands;%0A%0Aimport java.util.HashMap;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.ovirt.engine.core.common.config.ConfigValues;%0Aimport org.ovirt.engine.core.common.scheduling.ClusterPolicy;%0Aimport org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters;%0Aimport org.ovirt.engine.core.compat.Guid;%0Aimport org.ovirt.engine.core.utils.MockConfigRule;%0A%0Apublic class ClusterPolicyCRUDCommandTest %7B%0A%0A    @Rule%0A    public MockConfigRule mockConfigRule =%0A            new MockConfigRule(MockConfigRule.mockConfig(ConfigValues.EnableVdsLoadBalancing, false));%0A%0A    @Test%0A    public void testCheckAddEditValidations() %7B%0A        Guid clusterPolicyId = new Guid(%22e754440b-76a6-4099-8235-4565ab4b5521%22);%0A        ClusterPolicy clusterPolicy = new ClusterPolicy();%0A        clusterPolicy.setId(clusterPolicyId);%0A        ClusterPolicyCRUDCommand command =%0A                new ClusterPolicyCRUDCommand(new ClusterPolicyCRUDParameters(clusterPolicyId,%0A                        clusterPolicy)) %7B%0A%0A                    @Override%0A                    protected void executeCommand() %7B%0A                    %7D%0A                %7D;%0A        Assert.assertTrue(command.checkAddEditValidations());%0A    %7D%0A%0A    @Test%0A    public void testCheckAddEditValidationsFailOnParameters() %7B%0A        Guid clusterPolicyId = new Guid(%22e754440b-76a6-4099-8235-4565ab4b5521%22);%0A        ClusterPolicy clusterPolicy = new ClusterPolicy();%0A        clusterPolicy.setId(clusterPolicyId);%0A        HashMap%3CString, String%3E parameterMap = new HashMap%3CString, String%3E();%0A        parameterMap.put(%22fail?%22, %22sure, fail!%22);%0A        clusterPolicy.setParameterMap(parameterMap);%0A        ClusterPolicyCRUDCommand command =%0A                new ClusterPolicyCRUDCommand(new ClusterPolicyCRUDParameters(clusterPolicyId,%0A                        clusterPolicy)) %7B%0A%0A                    @Override%0A                    protected void executeCommand() %7B%0A                    %7D%0A                %7D;%0A        Assert.assertFalse(command.checkAddEditValidations());%0A    %7D%0A%0A%7D%0A

test for ClusterPolicyCRUDCommandTest