Metadata for groups. #221

This commit is contained in:
akwizgran
2016-01-20 13:01:52 +00:00
parent 3c543b0d62
commit 88a8081351
7 changed files with 207 additions and 27 deletions

View File

@@ -533,11 +533,11 @@ public class DatabaseComponentImplTest extends BriarTestCase {
final EventBus eventBus = context.mock(EventBus.class);
context.checking(new Expectations() {{
// Check whether the subscription is in the DB (which it's not)
exactly(5).of(database).startTransaction();
exactly(7).of(database).startTransaction();
will(returnValue(txn));
exactly(5).of(database).containsGroup(txn, groupId);
exactly(7).of(database).containsGroup(txn, groupId);
will(returnValue(false));
exactly(5).of(database).abortTransaction(txn);
exactly(7).of(database).abortTransaction(txn);
// This is needed for getMessageStatus() to proceed
exactly(1).of(database).containsContact(txn, contactId);
will(returnValue(true));
@@ -552,6 +552,13 @@ public class DatabaseComponentImplTest extends BriarTestCase {
// Expected
}
try {
db.getGroupMetadata(groupId);
fail();
} catch (NoSuchSubscriptionException expected) {
// Expected
}
try {
db.getMessageStatus(contactId, groupId);
fail();
@@ -566,6 +573,13 @@ public class DatabaseComponentImplTest extends BriarTestCase {
// Expected
}
try {
db.mergeGroupMetadata(groupId, metadata);
fail();
} catch (NoSuchSubscriptionException expected) {
// Expected
}
try {
db.removeGroup(group);
fail();