Tal Nisan has uploaded a new change for review. Change subject: Change init type of BackwardCompatibilityTaskCreationTest ......................................................................
Change init type of BackwardCompatibilityTaskCreationTest Since this test fails sporadically, added an after method to run after each test that resets the DbFacade static reference to avoid it from affecting other tests This is the failure log from the tests: Tests in error: testConcreateCreateTaskBackwardsComaptibility(org.ovirt.engine.core.bll. BackwardCompatibilityTaskCreationTest): testConcreateCreateTaskBackwardsComaptibility(data[6]) Change-Id: Ic51dcdbe554844698d1897c5323b0a4290ba10c9 Signed-off-by: Tal Nisan <tni...@redhat.com> --- M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/42014/1 diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java index 948860d..742f4a1 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java @@ -1,6 +1,8 @@ package org.ovirt.engine.core.bll; import org.ovirt.engine.core.bll.tasks.CommandAsyncTask; +import org.junit.After; +import org.junit.Before; import org.ovirt.engine.core.bll.tasks.AsyncTaskState; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -12,7 +14,6 @@ import java.sql.Connection; import java.util.Collections; -import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; @@ -77,8 +78,8 @@ @ClassRule public static MockEJBStrategyRule ejbRule = new MockEJBStrategyRule(BeanType.SCHEDULER, mock(SchedulerUtil.class)); - @BeforeClass - public static void beforeClass() { + @Before + public void before() { ejbRule.mockResource(ContainerManagedResourceType.DATA_SOURCE, mock(Connection.class)); DbFacade dbFacade = spy(new DbFacade()); DbFacadeLocator.setDbFacade(dbFacade); @@ -90,6 +91,11 @@ when(cmdEntityDao.getAll()).thenReturn(Collections.EMPTY_LIST); } + @After + public void after() { + DbFacadeLocator.setDbFacade(null); + } + @SuppressWarnings({ "unchecked", "rawtypes"}) @DataPoints public static CommandBase<? extends VdcActionParametersBase>[] data() { -- To view, visit https://gerrit.ovirt.org/42014 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic51dcdbe554844698d1897c5323b0a4290ba10c9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Tal Nisan <tni...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches