Salome HOME
Unit test for checkin is ammended for testing the case with empty input list of steps.
authorrkv <rkv@opencascade.com>
Wed, 6 Feb 2013 05:53:46 +0000 (05:53 +0000)
committerrkv <rkv@opencascade.com>
Wed, 6 Feb 2013 05:53:46 +0000 (05:53 +0000)
Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java

index 1c486123b063568e997415d0c98871c1aee437a2..0710f118397850642d4b5d67357577c276e421ae 100644 (file)
@@ -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<StepDTO> 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<StepDTO> stepsToCheckin = new ArrayList<StepDTO>();
+               // 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",