*/
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>());
*/
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;