mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
added a cache to the IdentityManager, changed its signature, modified when and where the author is stored
made the author creation single-threaded again in the LifecycleManager, removed redundant code
This commit is contained in:
@@ -93,7 +93,6 @@ public class BlogManagerImplTest extends BriarTestCase {
|
||||
@Test
|
||||
public void testCreateLocalState() throws DbException {
|
||||
final Transaction txn = new Transaction(null, false);
|
||||
final LocalAuthor localAuthor = (LocalAuthor) blog1.getAuthor();
|
||||
|
||||
final ContactId contactId = new ContactId(0);
|
||||
final Collection<ContactId> contactIds =
|
||||
@@ -105,7 +104,7 @@ public class BlogManagerImplTest extends BriarTestCase {
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(identityManager).getLocalAuthor(txn);
|
||||
will(returnValue(localAuthor));
|
||||
will(returnValue(blog1.getAuthor()));
|
||||
oneOf(blogFactory).createBlog(blog1.getAuthor());
|
||||
will(returnValue(blog1));
|
||||
oneOf(db).containsGroup(txn, blog1.getId());
|
||||
@@ -151,42 +150,6 @@ public class BlogManagerImplTest extends BriarTestCase {
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddingIdentity() throws DbException {
|
||||
final Transaction txn = new Transaction(null, false);
|
||||
Author a = blog1.getAuthor();
|
||||
final LocalAuthor localAuthor =
|
||||
new LocalAuthor(a.getId(), a.getName(), a.getPublicKey(),
|
||||
a.getPublicKey(), 0);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(blogFactory).createBlog(localAuthor);
|
||||
will(returnValue(blog1));
|
||||
oneOf(db).addGroup(txn, blog1.getGroup());
|
||||
}});
|
||||
|
||||
blogManager.addingIdentity(txn, localAuthor);
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemovingIdentity() throws DbException {
|
||||
final Transaction txn = new Transaction(null, false);
|
||||
Author a = blog1.getAuthor();
|
||||
final LocalAuthor localAuthor =
|
||||
new LocalAuthor(a.getId(), a.getName(), a.getPublicKey(),
|
||||
a.getPublicKey(), 0);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(blogFactory).createBlog(localAuthor);
|
||||
will(returnValue(blog1));
|
||||
oneOf(db).removeGroup(txn, blog1.getGroup());
|
||||
}});
|
||||
|
||||
blogManager.removingIdentity(txn, localAuthor);
|
||||
context.assertIsSatisfied();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncomingMessage() throws DbException, FormatException {
|
||||
final Transaction txn = new Transaction(null, false);
|
||||
|
||||
Reference in New Issue
Block a user