aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/src/androidTest
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-10-06 19:55:03 +0200
committerpedroGitt <pedro.contreiras@amdocs.com>2016-10-06 19:55:03 +0200
commit655c841cc3720d1bb9892d60a2d7ca136c90cfbd (patch)
treee598da0ee20e90620873e7c13d36c9b32a3fe8d4 /java/android/OlmLibSdk/olm-sdk/src/androidTest
parent0393ad68438669f60a6679c9e0f8010c7366c5ed (diff)
- Update Unit tests for OlmAccount
- new file olm_utility.cpp to have a stand alone function to initialize/alloc a random buffer - new class OlmMessage - complete OlmSession API with encryptMessage() - comments review - OlmAccount unit tests are green - new gradle to compile the shared lib according to debug mode
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src/androidTest')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java16
1 files changed, 1 insertions, 15 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
index 061c79d..f592aa4 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
@@ -55,7 +55,6 @@ public class OlmAccountTest {
}
}
-
@After
public void tearDown() {
// TBD
@@ -63,30 +62,25 @@ public class OlmAccountTest {
@Test
public void test1CreateAccount() {
- Log.d(LOG_TAG,"## testInitNewAccount");
mOlmAccount = new OlmAccount();
assertNotNull(mOlmAccount);
}
@Test
public void test2InitNewAccount() {
- Log.d(LOG_TAG,"## testInitNewAccount");
assertTrue(mOlmAccount.initNewAccount());
mIsAccountCreated = true;
}
@Test
public void test3GetOlmAccountId() {
- Log.d(LOG_TAG,"## testGetOlmAccountId");
-
long olmNativeInstance = mOlmAccount.getOlmAccountId();
+ Log.d(LOG_TAG,"## testGetOlmAccountId olmNativeInstance="+olmNativeInstance);
assertTrue(0!=olmNativeInstance);
}
@Test
public void test4IdentityKeys() {
- Log.d(LOG_TAG,"## testIdentityKeys");
-
JSONObject identityKeysJson = mOlmAccount.identityKeys();
assertNotNull(identityKeysJson);
Log.d(LOG_TAG,"## testIdentityKeys Keys="+identityKeysJson);
@@ -115,8 +109,6 @@ public class OlmAccountTest {
//****************************************************
@Test
public void test5MaxOneTimeKeys() {
- Log.d(LOG_TAG,"## testMaxOneTimeKeys");
-
long maxOneTimeKeys = mOlmAccount.maxOneTimeKeys();
Log.d(LOG_TAG,"## testMaxOneTimeKeys(): maxOneTimeKeys="+maxOneTimeKeys);
@@ -125,14 +117,12 @@ public class OlmAccountTest {
@Test
public void test6GenerateOneTimeKeys() {
- Log.d(LOG_TAG,"## testGenerateOneTimeKeys");
int retValue = mOlmAccount.generateOneTimeKeys(GENERATION_ONE_TIME_KEYS_NUMBER);
assertTrue(0==retValue);
}
@Test
public void test7OneTimeKeysJsonFormat() {
- Log.d(LOG_TAG,"## test7OneTimeKeysJsonFormat");
int oneTimeKeysCount = 0;
JSONObject generatedKeysJsonObj;
JSONObject oneTimeKeysJson = mOlmAccount.oneTimeKeys();
@@ -169,8 +159,6 @@ public class OlmAccountTest {
@Test
public void test8MarkOneTimeKeysAsPublished() {
- Log.d(LOG_TAG,"## testMarkOneTimeKeysAsPublished");
-
int retCode = mOlmAccount.markOneTimeKeysAsPublished();
// if OK => retCode=0
assertTrue(0 == retCode);
@@ -178,8 +166,6 @@ public class OlmAccountTest {
@Test
public void test9SignMessage() {
- Log.d(LOG_TAG,"## testMarkOneTimeKeysAsPublished");
-
String clearMsg = "String to be signed by olm";
String signedMsg = mOlmAccount.signMessage(clearMsg);
assertNotNull(signedMsg);