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 <[email protected]> --- M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/45/34745/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 c39f934..fcc4f04 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,5 +1,8 @@ package org.ovirt.engine.core.bll; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; import org.ovirt.engine.core.bll.tasks.AsyncTaskState; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -77,8 +80,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 +93,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 http://gerrit.ovirt.org/34745 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic51dcdbe554844698d1897c5323b0a4290ba10c9 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
