Salome HOME
The draft of the "Copy from existing study" action is added. The YACS step is introdu...
[tools/siman.git] / Workspace / Siman-Common / src / test / splat / util / TestEntitiesGenerator.java
index f534c4bf3890cb3e79318c29d671de996d5021c9..e21a357d53de911b65f0d5da30c882e449c2c24f 100644 (file)
@@ -58,8 +58,7 @@ public class TestEntitiesGenerator {
         */
        public static Study getTestStudy(final User user) throws BusinessException {
                Study.Properties studyProps = new Study.Properties();
-               studyProps.setActor(user).setManager(user)
-                               .setTitle("a test study")
+               studyProps.setActor(user).setManager(user).setTitle("a test study")
                                // .setDescription("description")
                                .setDate(new Date()).setReference("test reference")
                                .setSimulationContexts(new ArrayList<SimulationContext>());
@@ -78,9 +77,24 @@ public class TestEntitiesGenerator {
         */
        public static Scenario getTestScenario(final Study study)
                        throws BusinessException {
-               Scenario.Properties sprops = new Scenario.Properties().setTitle(
-                               "TST_Scenario").setManager(study.getAuthor()).setOwnerStudy(
-                               study);
+               return getTestScenario(study, "TST_Scenario");
+       }
+
+       /**
+        * Create a transient test scenario.
+        * 
+        * @param title
+        *            the scenario title
+        * @param study
+        *            the owner study
+        * @return the created scenario
+        * @throws BusinessException
+        *             if creation is failed
+        */
+       public static Scenario getTestScenario(final Study study, final String title)
+                       throws BusinessException {
+               Scenario.Properties sprops = new Scenario.Properties().setTitle(title)
+                               .setManager(study.getAuthor()).setOwnerStudy(study);
                Scenario aScenario = new Scenario(sprops);
                study.getScenariiList().add(aScenario);
                return aScenario;