aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/src/androidTest
diff options
context:
space:
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/OlmGroupSessionTest.java30
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java50
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java7
3 files changed, 43 insertions, 44 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java
index c5122b2..2152a8d 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java
@@ -180,8 +180,8 @@ public class OlmGroupSessionTest {
@Test
public void test14CheckUnreleaseedCount() {
- assertTrue(0==mAliceOutboundGroupSession.getUnreleasedCount());
- assertTrue(0==mBobInboundGroupSession.getUnreleasedCount());
+ assertTrue(mAliceOutboundGroupSession.isReleased());
+ assertTrue(mBobInboundGroupSession.isReleased());
}
@Test
@@ -235,8 +235,8 @@ public class OlmGroupSessionTest {
outboundGroupSessionRef.releaseSession();
outboundGroupSessionSerial.releaseSession();
- assertTrue(0==outboundGroupSessionRef.getUnreleasedCount());
- assertTrue(0==outboundGroupSessionSerial.getUnreleasedCount());
+ assertTrue(outboundGroupSessionRef.isReleased());
+ assertTrue(outboundGroupSessionSerial.isReleased());
} catch (FileNotFoundException e) {
Log.e(LOG_TAG, "## test15SerializeOutboundSession(): Exception FileNotFoundException Msg=="+e.getMessage());
} catch (ClassNotFoundException e) {
@@ -309,9 +309,9 @@ public class OlmGroupSessionTest {
bobInboundGroupSessionRef.releaseSession();
bobInboundGroupSessionSerial.releaseSession();
- assertTrue(0==aliceOutboundGroupSession.getUnreleasedCount());
- assertTrue(0==bobInboundGroupSessionRef.getUnreleasedCount());
- assertTrue(0==bobInboundGroupSessionSerial.getUnreleasedCount());
+ assertTrue(aliceOutboundGroupSession.isReleased());
+ assertTrue(bobInboundGroupSessionRef.isReleased());
+ assertTrue(bobInboundGroupSessionSerial.isReleased());
} catch (FileNotFoundException e) {
Log.e(LOG_TAG, "## test16SerializeInboundSession(): Exception FileNotFoundException Msg=="+e.getMessage());
} catch (ClassNotFoundException e) {
@@ -405,14 +405,14 @@ public class OlmGroupSessionTest {
outboundGroupSession7.releaseSession();
outboundGroupSession8.releaseSession();
- assertTrue(0==outboundGroupSession1.getUnreleasedCount());
- assertTrue(0==outboundGroupSession2.getUnreleasedCount());
- assertTrue(0==outboundGroupSession3.getUnreleasedCount());
- assertTrue(0==outboundGroupSession4.getUnreleasedCount());
- assertTrue(0==outboundGroupSession5.getUnreleasedCount());
- assertTrue(0==outboundGroupSession6.getUnreleasedCount());
- assertTrue(0==outboundGroupSession7.getUnreleasedCount());
- assertTrue(0==outboundGroupSession8.getUnreleasedCount());
+ assertTrue(outboundGroupSession1.isReleased());
+ assertTrue(outboundGroupSession2.isReleased());
+ assertTrue(outboundGroupSession3.isReleased());
+ assertTrue(outboundGroupSession4.isReleased());
+ assertTrue(outboundGroupSession5.isReleased());
+ assertTrue(outboundGroupSession6.isReleased());
+ assertTrue(outboundGroupSession7.isReleased());
+ assertTrue(outboundGroupSession8.isReleased());
} catch (OlmException e) {
assertTrue("Exception in OlmOutboundGroupSession, Exception code=" + e.getExceptionCode(), false);
}
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java
index df8dadb..b25d865 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmSessionTest.java
@@ -143,14 +143,14 @@ public class OlmSessionTest {
// release accounts
bobAccount.releaseAccount();
aliceAccount.releaseAccount();
- assertTrue(0==bobAccount.getUnreleasedCount());
- assertTrue(0==aliceAccount.getUnreleasedCount());
+ assertTrue(bobAccount.isReleased());
+ assertTrue(aliceAccount.isReleased());
// release sessions
bobSession.releaseSession();
aliceSession.releaseSession();
- assertTrue(0==bobSession.getUnreleasedCount());
- assertTrue(0==aliceSession.getUnreleasedCount());
+ assertTrue(bobSession.isReleased());
+ assertTrue(aliceSession.isReleased());
}
@@ -273,13 +273,13 @@ public class OlmSessionTest {
assertTrue(0==bobAccount.removeOneTimeKeysForSession(bobSession));
bobAccount.releaseAccount();
aliceAccount.releaseAccount();
- assertTrue(0==bobAccount.getUnreleasedCount());
- assertTrue(0==aliceAccount.getUnreleasedCount());
+ assertTrue(bobAccount.isReleased());
+ assertTrue(aliceAccount.isReleased());
bobSession.releaseSession();
aliceSession.releaseSession();
- assertTrue(0==bobSession.getUnreleasedCount());
- assertTrue(0==aliceSession.getUnreleasedCount());
+ assertTrue(bobSession.isReleased());
+ assertTrue(aliceSession.isReleased());
}
@@ -329,13 +329,13 @@ public class OlmSessionTest {
aliceAccount.releaseAccount();
bobAccount.releaseAccount();
- assertTrue(0==aliceAccount.getUnreleasedCount());
- assertTrue(0==bobAccount.getUnreleasedCount());
+ assertTrue(aliceAccount.isReleased());
+ assertTrue(bobAccount.isReleased());
bobSession.releaseSession();
aliceSession.releaseSession();
- assertTrue(0==bobSession.getUnreleasedCount());
- assertTrue(0==aliceSession.getUnreleasedCount());
+ assertTrue(bobSession.isReleased());
+ assertTrue(aliceSession.isReleased());
}
@Test
@@ -391,13 +391,13 @@ public class OlmSessionTest {
assertTrue(0==bobAccount.removeOneTimeKeysForSession(bobSession));
aliceAccount.releaseAccount();
bobAccount.releaseAccount();
- assertTrue(0==aliceAccount.getUnreleasedCount());
- assertTrue(0==bobAccount.getUnreleasedCount());
+ assertTrue(aliceAccount.isReleased());
+ assertTrue(bobAccount.isReleased());
aliceSession.releaseSession();
bobSession.releaseSession();
- assertTrue(0==aliceSession.getUnreleasedCount());
- assertTrue(0==bobSession.getUnreleasedCount());
+ assertTrue(aliceSession.isReleased());
+ assertTrue(bobSession.isReleased());
}
// ********************************************************
@@ -522,15 +522,15 @@ public class OlmSessionTest {
assertTrue(0==bobAccount.removeOneTimeKeysForSession(bobSession));
bobAccount.releaseAccount();
aliceAccount.releaseAccount();
- assertTrue(0==bobAccount.getUnreleasedCount());
- assertTrue(0==aliceAccount.getUnreleasedCount());
+ assertTrue(bobAccount.isReleased());
+ assertTrue(aliceAccount.isReleased());
bobSession.releaseSession();
aliceSession.releaseSession();
aliceSessionDeserial.releaseSession();
- assertTrue(0==bobSession.getUnreleasedCount());
- assertTrue(0==aliceSession.getUnreleasedCount());
- assertTrue(0==aliceSessionDeserial.getUnreleasedCount());
+ assertTrue(bobSession.isReleased());
+ assertTrue(aliceSession.isReleased());
+ assertTrue(aliceSessionDeserial.isReleased());
}
catch (FileNotFoundException e) {
Log.e(LOG_TAG, "## test03SessionSerialization(): Exception FileNotFoundException Msg=="+e.getMessage());
@@ -631,13 +631,13 @@ public class OlmSessionTest {
assertTrue(0==bobAccount.removeOneTimeKeysForSession(bobSession));
aliceAccount.releaseAccount();
bobAccount.releaseAccount();
- assertTrue(0==aliceAccount.getUnreleasedCount());
- assertTrue(0==bobAccount.getUnreleasedCount());
+ assertTrue(aliceAccount.isReleased());
+ assertTrue(bobAccount.isReleased());
aliceSession.releaseSession();
bobSession.releaseSession();
- assertTrue(0==aliceSession.getUnreleasedCount());
- assertTrue(0==bobSession.getUnreleasedCount());
+ assertTrue(aliceSession.isReleased());
+ assertTrue(bobSession.isReleased());
}
}
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
index a1b3f81..9a97205 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmUtilityTest.java
@@ -106,13 +106,12 @@ public class OlmUtilityTest {
assertFalse(String.valueOf(errorMsg).isEmpty());
utility.releaseUtility();
- assertTrue(0==utility.getUnreleasedCount());
+ assertTrue(utility.isReleased());
account.releaseAccount();
- assertTrue(0==account.getUnreleasedCount());
+ assertTrue(account.isReleased());
}
-
@Test
public void test02sha256() {
OlmUtility utility = new OlmUtility();
@@ -122,6 +121,6 @@ public class OlmUtilityTest {
assertFalse(TextUtils.isEmpty(hashResult));
utility.releaseUtility();
- assertTrue(0==utility.getUnreleasedCount());
+ assertTrue(utility.isReleased());
}
}