]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/test/splat/service/TestScenarioService.java
Salome HOME
Fix for a document version removing.
[tools/siman.git] / Workspace / Siman-Common / src / test / splat / service / TestScenarioService.java
index ddb34ac2c23a4361f052b6a02ce766b6c5ec1788..2cf593124dadde1c7112ef80730f9ce792114d97 100644 (file)
@@ -1357,8 +1357,9 @@ public class TestScenarioService extends BaseTest {
                                        + doc.value().getReference() + "]" + " ["
                                        + doc.value().getRid() + "]");
                }
-               // // Add a version relations
-               // Publication pub31 = version(pub3);
+               // Add a version relations
+               Publication pub31 = version(pub3);
+               ht.flush();
                //
                // LOG.debug("pub31 version doc: " + pub31.value().getTitle() + " ["
                // + pub31.value().getReference() + "]" + " ["
@@ -1391,10 +1392,11 @@ public class TestScenarioService extends BaseTest {
                ht.flush();
 
                // Create a scenario document version
-               // Publication spub31 = version(spub3);
+               Publication spub31 = version(spub3);
                // LOG.debug("spub31 version doc: " + spub31.value().getTitle() + " ["
                // + spub31.value().getReference() + "]" + " ["
                // + spub31.value().getRid() + "]");
+               ht.flush();
 
                // Add uses relations
                pub2.addDependency(pub1);
@@ -1409,8 +1411,8 @@ public class TestScenarioService extends BaseTest {
                ht.saveOrUpdate(spub2.value());
                spub3.addDependency(spub2);
                ht.saveOrUpdate(spub3.value());
-               // spub31.addDependency(spub31);
-               // ht.saveOrUpdate(spub31.value());
+               spub31.addDependency(pub31);
+               ht.saveOrUpdate(spub31.value());
                ht.flush();
 
                // Create target study1
@@ -1551,12 +1553,15 @@ public class TestScenarioService extends BaseTest {
                        throws BusinessException, IOException {
                Document.Properties dprop = new Document.Properties();
                dprop.setDocument(pub.value(), pub.getStep().getStep());
+               dprop.setLocalPath(pub.value().getTitle() + "_v1");
                Publication newpub = _stepService.versionDocument(pub.getStep(), pub,
                                dprop);
                pub.getOwner().getDocums().remove(pub);
                pub.getStep().getDocuments().remove(pub);
                pub.getOwner().add(newpub);
                pub.getStep().getDocuments().add(newpub);
+               String filepath = newpub.getSourceFile().asFile().getAbsolutePath();
+               createFile(filepath);
                return newpub;
        }