Tal Nisan has uploaded a new change for review. Change subject: core: Add VdcQueryType test ......................................................................
core: Add VdcQueryType test Added a tests validates that every query type in VdcQueryType corresponds to an existing query class Change-Id: I4cf3e10f2dfd2b132283d2408c1079e37a9789df Signed-off-by: Tal Nisan <[email protected]> --- A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/VdcQueryTypeTest.java 1 file changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/94/29794/1 diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/VdcQueryTypeTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/VdcQueryTypeTest.java new file mode 100644 index 0000000..dafad7a --- /dev/null +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/VdcQueryTypeTest.java @@ -0,0 +1,26 @@ +package org.ovirt.engine.core.bll; + +import org.junit.Test; +import org.ovirt.engine.core.common.queries.VdcQueryType; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class VdcQueryTypeTest { + + @Test + public void testQueryClassExistence() { + List<VdcQueryType> missingQueries = new ArrayList<>(); + for (VdcQueryType vqt : VdcQueryType.values()) { + if (vqt != VdcQueryType.Unknown) { + if (CommandsFactory.getQueryClass(vqt.name()) == null) { + missingQueries.add(vqt); + } + } + } + assertTrue("VdcQueryType contains the following values that does not correspond to an existing query class: " + missingQueries, + missingQueries.isEmpty()); + } +} -- To view, visit http://gerrit.ovirt.org/29794 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4cf3e10f2dfd2b132283d2408c1079e37a9789df Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tal Nisan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
