* <ul>
* <li>1: The new study must be created. The new product simulation context must be created.</li>
* <li>2: The new study must be created.</li>
- * <li>3: The new study must not be created. Exception is thrown.</li>
+ * <li>3: The new study must not be created. Exception must be thrown.</li>
* </ul>
* </i>
*
* <ul>
* <li>1: The new study must be created. The new product simulation context must be created.</li>
* <li>2: The new study must be created.</li>
- * <li>3: The new study must not be created. Exception is thrown.</li>
+ * <li>3: The new study must not be created. Exception must be thrown.</li>
* </ul>
* </i>
*
LOG.debug(">>>>> BEGIN testCreateStudyFromPython()");
startNestedTransaction();
+ HibernateTemplate ht = getHibernateTemplate();
+
Database.getInstance().reset();
_projectSettings.getAllSteps().clear(); // Clear config to be able to load it again
_projectSettings.configure("classpath:test/som.xml");
"Simulation context type 'product' must be created in the database.");
String productName = "New Test Product " + new Date().toString();
+
+ ht.flush();
+ ht.clear();
long studyId1 = _scenarioService.createStudy("goodUser",
"Test Study 1", productName, "Test description");
Assert.assertTrue(studyId1 > 0);
+ ht.flush();
+ ht.clear();
try {
_scenarioService.createStudy("badbadUser", "Test Study 2",
productName, "Test description");
LOG.debug("Expected exception: " + ipe.getMessage());
}
+ ht.flush();
+ ht.clear();
long studyId3 = _scenarioService.createStudy("goodUser",
"Test Study 3", productName, "Test description");
Assert.assertTrue(studyId3 > 0);