Replace transaction.setComplete() by database.commitTransaction()

This commit is contained in:
Torsten Grote
2016-10-31 08:47:11 -02:00
parent 36f087c512
commit b34b4623ed
39 changed files with 259 additions and 241 deletions

View File

@@ -509,7 +509,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
Transaction txn = db.startTransaction(false);
try {
queue.sendMessage(txn, group, time, body, new Metadata());
txn.setComplete();
db.commitTransaction(txn);
} finally {
db.endTransaction(txn);
}
@@ -580,7 +580,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
DatabaseComponent db1 = t1.getDatabaseComponent();
Transaction txn = db1.startTransaction(false);
db1.addGroup(txn, forum0.getGroup());
txn.setComplete();
db1.commitTransaction(txn);
db1.endTransaction(txn);
// send invitation
@@ -707,7 +707,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
Transaction txn = db.startTransaction(false);
try {
queue.sendMessage(txn, group, time, body, new Metadata());
txn.setComplete();
db.commitTransaction(txn);
} finally {
db.endTransaction(txn);
}
@@ -736,7 +736,7 @@ public class ForumSharingIntegrationTest extends BriarTestCase {
DatabaseComponent db2 = t2.getDatabaseComponent();
Transaction txn = db2.startTransaction(false);
db2.addGroup(txn, forum0.getGroup());
txn.setComplete();
db2.commitTransaction(txn);
db2.endTransaction(txn);
// add listeners

View File

@@ -339,7 +339,7 @@ public class PrivateGroupManagerTest extends BriarIntegrationTest {
t0.getDatabaseComponent()
.setVisibleToContact(txn0, contactId1, privateGroup0.getId(),
true);
txn0.setComplete();
t0.getDatabaseComponent().commitTransaction(txn0);
t0.getDatabaseComponent().endTransaction(txn0);
// author1 joins privateGroup0 and refers to wrong NEW_MEMBER message
@@ -358,7 +358,7 @@ public class PrivateGroupManagerTest extends BriarIntegrationTest {
t1.getDatabaseComponent()
.setVisibleToContact(txn1, contactId0, privateGroup0.getId(),
true);
txn1.setComplete();
t1.getDatabaseComponent().commitTransaction(txn1);
t1.getDatabaseComponent().endTransaction(txn1);
// sync join messages
@@ -467,7 +467,7 @@ public class PrivateGroupManagerTest extends BriarIntegrationTest {
t0.getDatabaseComponent()
.setVisibleToContact(txn0, contactId1, privateGroup0.getId(),
true);
txn0.setComplete();
t0.getDatabaseComponent().commitTransaction(txn0);;
t0.getDatabaseComponent().endTransaction(txn0);
// author1 joins privateGroup0
@@ -487,7 +487,7 @@ public class PrivateGroupManagerTest extends BriarIntegrationTest {
t1.getDatabaseComponent()
.setVisibleToContact(txn1, contactId0, privateGroup0.getId(),
true);
txn1.setComplete();
t1.getDatabaseComponent().commitTransaction(txn1);
t1.getDatabaseComponent().endTransaction(txn1);
// sync join messages

View File

@@ -590,7 +590,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
Transaction txn = db0.startTransaction(false);
try {
sender0.sendMessage(txn, d);
txn.setComplete();
db0.commitTransaction(txn);
} finally {
db0.endTransaction(txn);
}
@@ -637,7 +637,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
Transaction txn = db1.startTransaction(false);
try {
map = db1.getMessageMetadata(txn, group1.getId());
txn.setComplete();
db1.commitTransaction(txn);
} finally {
db1.endTransaction(txn);
}
@@ -651,7 +651,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
txn = db1.startTransaction(false);
try {
map = db1.getMessageMetadata(txn, group1.getId());
txn.setComplete();
db1.commitTransaction(txn);
} finally {
db1.endTransaction(txn);
}
@@ -694,7 +694,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
Transaction txn = db0.startTransaction(false);
try {
map = db0.getMessageMetadata(txn, group1.getId());
txn.setComplete();
db0.commitTransaction(txn);
} finally {
db0.endTransaction(txn);
}
@@ -708,7 +708,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
txn = db0.startTransaction(false);
try {
map = db0.getMessageMetadata(txn, group1.getId());
txn.setComplete();
db0.commitTransaction(txn);
} finally {
db0.endTransaction(txn);
}
@@ -722,7 +722,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
txn = db0.startTransaction(false);
try {
map = db0.getMessageMetadata(txn, group1.getId());
txn.setComplete();
db0.commitTransaction(txn);
} finally {
db0.endTransaction(txn);
}
@@ -780,7 +780,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
try {
db0.deleteMessage(txn, responseId);
sender0.sendMessage(txn, response);
txn.setComplete();
db0.commitTransaction(txn);
} finally {
db0.endTransaction(txn);
}
@@ -804,7 +804,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
txn = db2.startTransaction(true);
try {
contacts2 = db2.getContacts(txn);
txn.setComplete();
db2.commitTransaction(txn);
} finally {
db2.endTransaction(txn);
}
@@ -832,7 +832,7 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest {
txn = db1.startTransaction(true);
try {
contacts1 = db1.getContacts(txn);
txn.setComplete();
db1.commitTransaction(txn);
} finally {
db1.endTransaction(txn);
}