diff --git a/briar-android-tests/src/test/java/org/briarproject/introduction/IntroductionIntegrationTest.java b/briar-android-tests/src/test/java/org/briarproject/introduction/IntroductionIntegrationTest.java index cc1560291fcd007a9af47feb04b17dd48a16a19a..961b6ad666a7107ae0ddaefc3e43d81500584be8 100644 --- a/briar-android-tests/src/test/java/org/briarproject/introduction/IntroductionIntegrationTest.java +++ b/briar-android-tests/src/test/java/org/briarproject/introduction/IntroductionIntegrationTest.java @@ -537,109 +537,6 @@ public class IntroductionIntegrationTest extends BriarIntegrationTest { } } - @Test - public void testIntroductionToIdentitiesOfSameContact() throws Exception { - startLifecycles(); - try { - // Get Identities - getDefaultIdentities(); - author2 = authorFactory.createLocalAuthor(INTRODUCEE2, - TestUtils.getRandomBytes(MAX_PUBLIC_KEY_LENGTH), - TestUtils.getRandomBytes(123)); - identityManager1.registerLocalAuthor(author2); - - // Add introducees' authors as contacts - contactId1 = contactManager0.addContact(author1, - author0.getId(), master, clock.currentTimeMillis(), true, - true, true - ); - contactId2 = contactManager0.addContact(author2, - author0.getId(), master, clock.currentTimeMillis(), true, - true, true - ); - // Add introducer back - contactId0 = null; - ContactId contactId01 = contactManager1.addContact(author0, - author1.getId(), master, clock.currentTimeMillis(), false, - true, true - ); - ContactId contactId02 = contactManager1.addContact(author0, - author2.getId(), master, clock.currentTimeMillis(), false, - true, true - ); - // listen to events - addListeners(true, false); - - // Add Transport Properties - TransportPropertyManager tpm0 = t0.getTransportPropertyManager(); - TransportPropertyManager tpm1 = t1.getTransportPropertyManager(); - TransportProperties tp = new TransportProperties( - Collections.singletonMap("key", "value")); - tpm0.mergeLocalProperties(TRANSPORT_ID, tp); - deliverMessage(sync0, contactId01, sync1, contactId1, "0 to 11"); - deliverMessage(sync0, contactId02, sync1, contactId2, "0 to 12"); - tpm1.mergeLocalProperties(TRANSPORT_ID, tp); - deliverMessage(sync1, contactId1, sync0, contactId01, "1 to 01"); - deliverMessage(sync1, contactId2, sync0, contactId02, "1 to 02"); - - // make introduction - long time = clock.currentTimeMillis(); - Contact introducee1 = contactManager0.getContact(contactId1); - Contact introducee2 = contactManager0.getContact(contactId2); - introductionManager0 - .makeIntroduction(introducee1, introducee2, "Hi!", time); - - // sync request messages - deliverMessage(sync0, contactId01, sync1, contactId1); - deliverMessage(sync0, contactId02, sync1, contactId2); - - // wait for request to arrive - eventWaiter.await(TIMEOUT, 2); - assertTrue(listener1.requestReceived); - - // sync responses - deliverMessage(sync1, contactId1, sync0, contactId01); - deliverMessage(sync1, contactId2, sync0, contactId02); - - // wait for two responses to arrive - eventWaiter.await(TIMEOUT, 2); - assertTrue(listener0.response1Received); - assertTrue(listener0.response2Received); - - // sync forwarded responses to introducees - deliverMessage(sync0, contactId01, sync1, contactId1); - deliverMessage(sync0, contactId02, sync1, contactId2); - - // wait for "both" introducees to abort session - eventWaiter.await(TIMEOUT, 2); - assertTrue(listener1.aborted); - - // sync abort message - deliverMessage(sync1, contactId1, sync0, contactId01); - deliverMessage(sync1, contactId2, sync0, contactId02); - - // wait for introducer to abort session (gets event twice) - eventWaiter.await(TIMEOUT, 2); - assertTrue(listener0.aborted); - - assertFalse(contactManager1 - .contactExists(author1.getId(), author2.getId())); - assertFalse(contactManager1 - .contactExists(author2.getId(), author1.getId())); - - assertEquals(2, introductionManager0.getIntroductionMessages( - contactId1).size()); - assertEquals(2, introductionManager0.getIntroductionMessages( - contactId2).size()); - assertEquals(2, introductionManager1.getIntroductionMessages( - contactId01).size()); - assertEquals(2, introductionManager1.getIntroductionMessages( - contactId02).size()); - } finally { - stopLifecycles(); - } - } - @Test public void testSessionIdReuse() throws Exception { startLifecycles(); diff --git a/briar-android/src/org/briarproject/android/controller/SetupController.java b/briar-android/src/org/briarproject/android/controller/SetupController.java index b77a541fbe44b50238b51ffcfe52b6b6c0177284..0a671cf58d79d5486aa983180672cbd13d036db6 100644 --- a/briar-android/src/org/briarproject/android/controller/SetupController.java +++ b/briar-android/src/org/briarproject/android/controller/SetupController.java @@ -6,7 +6,7 @@ public interface SetupController { float estimatePasswordStrength(String password); - void storeAuthorInfo(String password, String nickName, + void storeAuthorInfo(String password, String nickname, ResultHandler<Void> resultHandler); } diff --git a/briar-android/src/org/briarproject/android/controller/SetupControllerImpl.java b/briar-android/src/org/briarproject/android/controller/SetupControllerImpl.java index e62e6800deb0b0f284027a2bcdb83abab85e3cb8..dc310422d1774a1d6c616026abfc450a48018b16 100644 --- a/briar-android/src/org/briarproject/android/controller/SetupControllerImpl.java +++ b/briar-android/src/org/briarproject/android/controller/SetupControllerImpl.java @@ -37,7 +37,7 @@ public class SetupControllerImpl extends PasswordControllerImpl } @Override - public void storeAuthorInfo(final String password, final String nickName, + public void storeAuthorInfo(final String password, final String nickname, final ResultHandler<Void> resultHandler) { cryptoExecutor.execute(new Runnable() { @Override @@ -46,7 +46,7 @@ public class SetupControllerImpl extends PasswordControllerImpl databaseConfig.setEncryptionKey(key); String hex = encryptDatabaseKey(key, password); storeEncryptedDatabaseKey(hex); - databaseConfig.setAuthorNick(nickName); + databaseConfig.setAuthorNick(nickname); resultHandler.onResult(null); } });