1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-08 03:51:09 +01:00

smack-omemo*: Do not swallow IOException deep within the library

Those exception are caused by I/O operations in the OmemoStore, which
is now declaring that it throws those (since it is not uncommon for
I/O operations to cause IOExceptions). After all, this is nicely
demonstrated as this change is caused by switching with this commit to
the Android API 19 compatible methods in FileBasedOmemoStore, which
throw.

The library can not decide what to do in case of those exceptions,
hence it is sensible to expose them to the user.
This commit is contained in:
Florian Schmaus 2019-08-05 08:28:42 +02:00
parent 699905a1de
commit 1bce378e6d
16 changed files with 299 additions and 331 deletions

View file

@ -302,20 +302,20 @@ public abstract class OmemoStoreTest<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey
}
@Test
public void loadAllRawSessionsReturnsEmptyMapTest() {
public void loadAllRawSessionsReturnsEmptyMapTest() throws IOException {
HashMap<Integer, T_Sess> sessions = store.loadAllRawSessionsOf(alice, bob.getJid());
assertNotNull(sessions);
assertEquals(0, sessions.size());
}
@Test
public void loadNonExistentRawSessionReturnsNullTest() {
public void loadNonExistentRawSessionReturnsNullTest() throws IOException {
T_Sess session = store.loadRawSession(alice, bob);
assertNull(session);
}
@Test
public void loadStoreMessageCounterTest() {
public void loadStoreMessageCounterTest() throws IOException {
assertEquals(0, store.loadOmemoMessageCounter(alice, bob));
store.storeOmemoMessageCounter(alice, bob, 20);
assertEquals(20, store.loadOmemoMessageCounter(alice, bob));