mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Replace Client interface with OpenDatabaseHook.
This commit is contained in:
@@ -112,7 +112,7 @@ public class BlogManagerImplTest extends BriarTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateLocalState() throws DbException {
|
||||
public void testOpenDatabaseHook() throws DbException {
|
||||
Transaction txn = new Transaction(null, false);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
@@ -123,7 +123,7 @@ public class BlogManagerImplTest extends BriarTestCase {
|
||||
oneOf(db).addGroup(txn, blog1.getGroup());
|
||||
}});
|
||||
|
||||
blogManager.createLocalState(txn);
|
||||
blogManager.onDatabaseOpened(txn);
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateLocalStateFirstTime() throws Exception {
|
||||
public void testDatabaseOpenHookFirstTime() throws Exception {
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(contactGroupFactory).createLocalGroup(CLIENT_ID,
|
||||
MAJOR_VERSION);
|
||||
@@ -161,11 +161,11 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
||||
will(returnValue(Collections.singletonList(contact)));
|
||||
}});
|
||||
expectAddingContact(contact);
|
||||
groupInvitationManager.createLocalState(txn);
|
||||
groupInvitationManager.onDatabaseOpened(txn);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateLocalStateSubsequentTime() throws Exception {
|
||||
public void testOpenDatabaseHookSubsequentTime() throws Exception {
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(contactGroupFactory).createLocalGroup(CLIENT_ID,
|
||||
MAJOR_VERSION);
|
||||
@@ -173,7 +173,7 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
||||
oneOf(db).containsGroup(txn, localGroup.getId());
|
||||
will(returnValue(true));
|
||||
}});
|
||||
groupInvitationManager.createLocalState(txn);
|
||||
groupInvitationManager.onDatabaseOpened(txn);
|
||||
}
|
||||
|
||||
private void expectAddingContact(Contact c) throws Exception {
|
||||
|
||||
@@ -94,7 +94,7 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateLocalStateFirstTimeWithExistingContact()
|
||||
public void testOpenDatabaseHookFirstTimeWithExistingContact()
|
||||
throws Exception {
|
||||
Transaction txn = new Transaction(null, false);
|
||||
|
||||
@@ -113,7 +113,7 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
||||
// Set things up for the contact
|
||||
expectAddingContact(txn);
|
||||
|
||||
blogSharingManager.createLocalState(txn);
|
||||
blogSharingManager.onDatabaseOpened(txn);
|
||||
}
|
||||
|
||||
private void expectAddingContact(Transaction txn) throws Exception {
|
||||
@@ -149,7 +149,7 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateLocalStateSubsequentTime() throws Exception {
|
||||
public void testOpenDatabaseHookSubsequentTime() throws Exception {
|
||||
Transaction txn = new Transaction(null, false);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
@@ -161,7 +161,7 @@ public class BlogSharingManagerImplTest extends BrambleMockTestCase {
|
||||
will(returnValue(true));
|
||||
}});
|
||||
|
||||
blogSharingManager.createLocalState(txn);
|
||||
blogSharingManager.onDatabaseOpened(txn);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user