X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Workspace%2FSiman-Common%2Fsrc%2Ftest%2Fsplat%2Fservice%2FTestScenarioService.java;h=baddb0191ebade1c24ed126f47637be8797899b6;hb=a5ad17dfa926241e6a75e698e7c30ed2041ed026;hp=5cf66d462b10e284686f611aa3590759aac6e6d8;hpb=2b86d097148a80a388e055b63addcc79a62d3f8f;p=tools%2Fsiman.git diff --git a/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java b/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java index 5cf66d4..baddb01 100644 --- a/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java +++ b/Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java @@ -37,6 +37,7 @@ import org.splat.dal.bo.som.UsesRelation; import org.splat.dal.bo.som.ValidationCycle; import org.splat.dal.bo.som.ValidationCycleRelation; import org.splat.dal.bo.som.ValidationStep; +import org.splat.dal.bo.som.VersionsRelation; import org.splat.dal.bo.som.Document.Properties; import org.splat.dal.dao.kernel.UserDAO; import org.splat.dal.dao.som.Database; @@ -457,6 +458,7 @@ public class TestScenarioService extends BaseTest { createDocDTOForModule(stepToCheckin, "SMESH", "med", userId, step, stepsToCheckin); } + // ///////////////////////////////////////////////////////////////// // Do test checkin _scenarioService.checkin(scenarioId, userId, stepsToCheckin); @@ -511,15 +513,15 @@ public class TestScenarioService extends BaseTest { && "geometry".equals(prevDoc.getType() .getName())) { Assert.assertEquals(newPub.value().getFormat(), - "brep"); + newFormat); Assert.assertEquals(newPub.getSourceFile() - .getFormat(), "brep"); + .getFormat(), newFormat); Assert.assertEquals(newPub.getSourceFile() .getRelativePath().substring( newPub.getSourceFile() .getRelativePath() .lastIndexOf('.') + 1), - "brep"); + newFormat); } // Check that uses relations are copied correctly @@ -563,6 +565,21 @@ public class TestScenarioService extends BaseTest { + ") must become outdated."); } } + + // Check that a correct comment is generated for VersionsRelation + VersionsRelation versRel = (VersionsRelation) newPub + .value().getFirstRelation( + VersionsRelation.class); + Assert.assertNotNull(versRel, + "VersionsRelation must be created."); + Assert + .assertNotNull(versRel.getDescription(), + "VersionsRelation description was not generated."); + int descrLen = versRel.getDescription().length(); + Assert.assertTrue(descrLen > 0, + "VersionsRelation description is empty."); + LOG.debug("Version description: " + + versRel.getDescription()); } else { // Otherwise the new file format must differ from the previous one // and the new file must be attached to the same document @@ -769,8 +786,17 @@ public class TestScenarioService extends BaseTest { || (file.getPath().endsWith("py") && (format .equals("brep") || format.equals("med")))) { // Create a file in the download directory - docToCheckin.addFile(createDownloadedFile(userId, - doc.getTitle() + "_result", format)); + if ("GEOM".equals(module)) { + // New version case + docToCheckin.addFile(createDownloadedFile( + userId, doc.getTitle() + "_newvers", + "py")); + } else { + // Attached generated result case + docToCheckin.addFile(createDownloadedFile( + userId, doc.getTitle() + "_result", + format)); + } } } }