diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java index f1a8c7c38aa0fe66126f27785a53b586cec5ff3c..69df074d138204ceae82969492538d82733b0bb2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SystemTestCase.java @@ -22,7 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockMultipartFile; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; +import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; +import org.springframework.test.context.transaction.TransactionConfiguration; import org.testng.AssertJUnit; import org.testng.annotations.BeforeSuite; @@ -40,7 +41,10 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; * @author Franz-Josef Elmer */ @ContextConfiguration(locations = "classpath:applicationContext.xml") -public abstract class SystemTestCase extends AbstractTestNGSpringContextTests +// In 'commonContext.xml', our transaction manager is called 'transaction-manager' (by default +// Spring looks for 'transactionManager'). +@TransactionConfiguration(transactionManager = "transaction-manager") +public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringContextTests { protected static final String SESSION_KEY = "session-key"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/DynamicPropertiesEvaluationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/DynamicPropertiesEvaluationTest.java index f26ae8521bcaf2c8589b1f5df6d114aae6c25ee4..dcfa4b9c402c4d3e3384c7c2a077999a773fc24c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/DynamicPropertiesEvaluationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/DynamicPropertiesEvaluationTest.java @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import org.springframework.test.context.transaction.TransactionConfiguration; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @@ -47,6 +48,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; * @author Piotr Buczek */ @Test(groups = "system test") +@TransactionConfiguration(defaultRollback = false) public class DynamicPropertiesEvaluationTest extends GenericSystemTestCase { private static final String CELL_PLATE = "CELL_PLATE"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java index 92c3c3f8afa5c2fce7ba4a622f7aa4c2382f383b..e69972d4c9790c5f3c35629fb88b6558e6fc5993 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/FileFormatTypeHeadlessTest.java @@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSe import ch.systemsx.cisd.openbis.generic.shared.basic.Row; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.FileFormatType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject; +import ch.systemsx.cisd.openbis.systemtest.SystemTestCase; /** * A headless system test having the same functionality as {@link FileFormatTypeGridTest}. @@ -35,8 +36,9 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRowWithObject * @author Kaloyan Enimanev */ @Test(groups = "system test") -public class FileFormatTypeHeadlessTest extends GenericSystemTestCase +public class FileFormatTypeHeadlessTest extends SystemTestCase { + private static final int FILE_TYPES_IN_DB = 8; @BeforeMethod public final void setUp() @@ -44,7 +46,7 @@ public class FileFormatTypeHeadlessTest extends GenericSystemTestCase logIntoCommonClientService(); } - @Test + @Test() public void testListFileFormats() { DefaultResultSetConfig<String, TableModelRowWithObject<FileFormatType>> criteria = @@ -52,7 +54,7 @@ public class FileFormatTypeHeadlessTest extends GenericSystemTestCase TypedTableResultSet<FileFormatType> tableResultSet = commonClientService.listFileTypes(criteria); - assertTable(tableResultSet).hasNumberOfRows(8); + assertTable(tableResultSet).hasNumberOfRows(FILE_TYPES_IN_DB); assertColumn(tableResultSet, "CODE").containsValues("TIFF", "XML", "HDF5"); } @@ -76,7 +78,7 @@ public class FileFormatTypeHeadlessTest extends GenericSystemTestCase new Row().withCell("CODE", fft.getCode()).withCell("DESCRIPTION", fft.getDescription()); - assertTable(tableResultSet).hasNumberOfRows(9); + assertTable(tableResultSet).hasNumberOfRows(FILE_TYPES_IN_DB + 1); assertTable(tableResultSet).containsRow(expectedRow); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java index eb9b4c8d09fa50484cc438e462a932a8236764f1..2e5807139a6cb01ba4e270bcd8a16149397fd21f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleBrowsingTest.java @@ -69,7 +69,7 @@ public class SampleBrowsingTest extends GenericSystemTestCase ResultSetWithEntityTypes<Sample> samples = commonClientService.listSamples(new ListSampleDisplayCriteria(listCriteria)); - assertEquals(42, samples.getResultSet().getTotalLength()); + assertEquals(40, samples.getResultSet().getTotalLength()); assertEquals("[DILUTION_PLATE, REINFECT_PLATE, MASTER_PLATE, CONTROL_LAYOUT, CELL_PLATE]", samples.getAvailableEntityTypes().toString()); @@ -162,7 +162,7 @@ public class SampleBrowsingTest extends GenericSystemTestCase ResultSetWithEntityTypes<Sample> samples = commonClientService.listSamples(new ListSampleDisplayCriteria(listCriteria)); - assertEquals(17, samples.getResultSet().getTotalLength()); + assertEquals(15, samples.getResultSet().getTotalLength()); assertEquals("[CELL_PLATE]", samples.getAvailableEntityTypes().toString()); GridRowModels<Sample> list = samples.getResultSet().getList(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java index 83c013d1f32cc718a189685bfd2358151db9aa61..de7482494dc3168d8cb283a3727d1e58bc03b3cb 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/SampleDetailsTest.java @@ -133,7 +133,7 @@ public class SampleDetailsTest extends GenericSystemTestCase ResultSetWithEntityTypes<Sample> samples = commonClientService.listSamples(new ListSampleDisplayCriteria(listCriteria)); - assertEquals(17, samples.getResultSet().getTotalLength()); + assertEquals(15, samples.getResultSet().getTotalLength()); assertEquals("[CELL_PLATE]", samples.getAvailableEntityTypes().toString()); GridRowModels<Sample> list = samples.getResultSet().getList(); @@ -179,7 +179,7 @@ public class SampleDetailsTest extends GenericSystemTestCase ResultSetWithEntityTypes<Sample> samples = commonClientService.listSamples(new ListSampleDisplayCriteria(listCriteria)); - assertEquals(17, samples.getResultSet().getTotalLength()); + assertEquals(15, samples.getResultSet().getTotalLength()); assertEquals("[CELL_PLATE]", samples.getAvailableEntityTypes().toString()); GridRowModels<Sample> list = samples.getResultSet().getList(); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QueryEditingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QueryEditingTest.java index e5f15c705d76b893f2079c9ac3a5c93fe3132e52..57fbcd2f7be1fcc7a743f210336f0e816b47952b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QueryEditingTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/query/QueryEditingTest.java @@ -25,6 +25,8 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; @@ -51,6 +53,7 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.basic.dto.QueryParameterBind * @author Franz-Josef Elmer */ @Test(groups = "system test") +@Transactional(propagation = Propagation.NOT_SUPPORTED) public class QueryEditingTest extends QuerySystemTestCase {