From: rkv Date: Wed, 6 Feb 2013 05:53:46 +0000 (+0000) Subject: Unit test for checkin is ammended for testing the case with empty input list of steps. X-Git-Tag: Root_Delivery2_2013_04_22~148 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e6f588c4e73721b2898698076d3a78a237dd7baf;p=tools%2Fsiman.git Unit test for checkin is ammended for testing the case with empty input list of steps. --- diff --git a/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java b/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java index 1c48612..0710f11 100644 --- a/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java +++ b/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java @@ -350,16 +350,42 @@ public class TestScenarioService extends BaseTest { User user = aScen.getAuthor(); long userId = user.getIndex(); + // //////////////////////////////////////////////////////// - // Call checkin method for good prepared transient data. + // Call checkin method for empty list of modules. // Simulate checkout List steps = _scenarioService.getScenarioInfo(scenarioId); _scenarioService.checkout(aScen, user); + _scenarioDAO.flush(); + // Check that scenario is no more marked as checked out + aScen = _scenarioDAO.get(scenarioId); + Assert.assertTrue(aScen.isCheckedout(), + "Scenario is not marked as checked out after checkout."); // Prepare test data for checkin // Checkin only two first steps (geom and mesh) List stepsToCheckin = new ArrayList(); + // Do test checkin + _scenarioService.checkin(scenarioId, userId, stepsToCheckin); + + _scenarioDAO.flush(); + // Check that scenario is no more marked as checked out + aScen = _scenarioDAO.get(scenarioId); + Assert.assertFalse(aScen.isCheckedout(), + "Scenario is still marked as checked out after checkin."); + + + + // //////////////////////////////////////////////////////// + // Call checkin method for good prepared transient data. + + // Simulate checkout + steps = _scenarioService.getScenarioInfo(scenarioId); + _scenarioService.checkout(aScen, user); + + // Prepare test data for checkin + // Checkin only two first steps (geom and mesh) for (StepDTO step : steps) { // Prepare GEOM: checkin actual brep StepDTO stepToCheckin = createDocDTOForModule(null, "GEOM", "brep",