Hello Laszlo Hornyak, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18574 to review the following change. Change subject: engien: test for ClusterPolicyCRUDCommandTest ...................................................................... engien: test for ClusterPolicyCRUDCommandTest test for ClusterPolicyCRUDCommandTest Change-Id: I9b370e4cc0a43645961b7693310695110f7f8281 Signed-off-by: Laszlo Hornyak <lhorn...@redhat.com> --- A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java 1 file changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/18574/1 diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java new file mode 100644 index 0000000..e86df84 --- /dev/null +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java @@ -0,0 +1,55 @@ +package org.ovirt.engine.core.bll.scheduling.commands; + +import java.util.HashMap; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.ovirt.engine.core.common.config.ConfigValues; +import org.ovirt.engine.core.common.scheduling.ClusterPolicy; +import org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.core.utils.MockConfigRule; + +public class ClusterPolicyCRUDCommandTest { + + @Rule + public MockConfigRule mockConfigRule = + new MockConfigRule(MockConfigRule.mockConfig(ConfigValues.EnableVdsLoadBalancing, false)); + + @Test + public void testCheckAddEditValidations() { + Guid clusterPolicyId = new Guid("e754440b-76a6-4099-8235-4565ab4b5521"); + ClusterPolicy clusterPolicy = new ClusterPolicy(); + clusterPolicy.setId(clusterPolicyId); + ClusterPolicyCRUDCommand command = + new ClusterPolicyCRUDCommand(new ClusterPolicyCRUDParameters(clusterPolicyId, + clusterPolicy)) { + + @Override + protected void executeCommand() { + } + }; + Assert.assertTrue(command.checkAddEditValidations()); + } + + @Test + public void testCheckAddEditValidationsFailOnParameters() { + Guid clusterPolicyId = new Guid("e754440b-76a6-4099-8235-4565ab4b5521"); + ClusterPolicy clusterPolicy = new ClusterPolicy(); + clusterPolicy.setId(clusterPolicyId); + HashMap<String, String> parameterMap = new HashMap<String, String>(); + parameterMap.put("fail?", "sure, fail!"); + clusterPolicy.setParameterMap(parameterMap); + ClusterPolicyCRUDCommand command = + new ClusterPolicyCRUDCommand(new ClusterPolicyCRUDParameters(clusterPolicyId, + clusterPolicy)) { + + @Override + protected void executeCommand() { + } + }; + Assert.assertFalse(command.checkAddEditValidations()); + } + +} -- To view, visit http://gerrit.ovirt.org/18574 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b370e4cc0a43645961b7693310695110f7f8281 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches