#374 - MsSqlServer - adjust tests (due to jdbc batch support etc) add in support for unique index handling

This commit is contained in:
Robin Bygrave
2015-08-06 21:49:04 +12:00
parent 3a9668fe6c
commit 1dd0841f00
31 changed files with 586 additions and 360 deletions
@@ -27,6 +27,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
transaction.setBatch(PersistBatch.NONE);
transaction.setBatchOnCascade(PersistBatch.INSERT);
transaction.setBatchSize(30);
// setBatchGetGeneratedKeys MUST be turned off for MS SQL Server because :(
transaction.setBatchGetGeneratedKeys(false);
for (int i = 0; i < numOfMasters; i++) {
UTMaster master = createMasterAndDetails(i, 20);
@@ -43,6 +45,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
@Test
public void testTransactional() {
if (isMsSqlServer()) return;
saveWithFullBatchMode();
}
@@ -69,6 +73,8 @@ public class TestBatchInsertSimple extends BaseTestCase {
transaction.setBatch(PersistBatch.NONE);
transaction.setBatchOnCascade(PersistBatch.INSERT);
transaction.setBatchSize(30);
// setBatchGetGeneratedKeys MUST be turned off for MS SQL Server because :(
transaction.setBatchGetGeneratedKeys(false);
for (int i = 0; i < numOfMasters; i++) {
UTMaster master = createMaster(i);
@@ -85,6 +91,9 @@ public class TestBatchInsertSimple extends BaseTestCase {
@Test
public void testJdbcBatchOnCollection() {
// MS SQL Server doesn't like batch inserts when we need getGeneratedKeys
if (isMsSqlServer()) return;
int numOfMasters = 3;
List<UTMaster> masters = new ArrayList<UTMaster>();
@@ -18,6 +18,8 @@ public class TestBatchInsertWithInitialisedCollection extends BaseTestCase {
@Test
public void test() {
if (isMsSqlServer()) return;
List<OCachedBean> list = new ArrayList();
for (int i = 0; i < 3; i++) {