summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2016-03-10 12:00:49 (GMT)
committerAlex Clayton <alex.clayton@isode.com>2016-03-14 14:08:40 (GMT)
commit9a5a18ee69e1daf50ac60c3c33619fa13743205f (patch)
treea9cb31beb7aec44e09a7f7eeffe5b672acc052b6 /test
parent5c9f31f688e480d63daab8f99205a05ff4f91e8b (diff)
downloadstroke-9a5a18ee69e1daf50ac60c3c33619fa13743205f.zip
stroke-9a5a18ee69e1daf50ac60c3c33619fa13743205f.tar.bz2
Do not flush VCard cache if IQ request returns an error.
As per swiften patch of the same name (37aafcb4d693a0b4f5944a52e0c070e5aa384245) changes behaviour of VCard cache slightly, and updates test accordingly. Test-information: Unit tests pass. Change-Id: I933c8000b4cb73b43db28db94887a768d0272dd2
Diffstat (limited to 'test')
-rw-r--r--test/com/isode/stroke/vcards/VCardManagerTest.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/com/isode/stroke/vcards/VCardManagerTest.java b/test/com/isode/stroke/vcards/VCardManagerTest.java
index 4c51081..729eda9 100644
--- a/test/com/isode/stroke/vcards/VCardManagerTest.java
+++ b/test/com/isode/stroke/vcards/VCardManagerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -155,14 +155,12 @@ public class VCardManagerTest {
@Test
public void testRequest_Error() {
- VCardManager testling = createManager();
- testling.requestVCard(new JID("foo@bar.com/baz"));
- stanzaChannel.onIQReceived.emit(IQ.createError(new JID("baz@fum.com/foo"), stanzaChannel.sentStanzas.get(0).getTo(), stanzaChannel.sentStanzas.get(0).getID()));
+ VCardManager testling = createManager();
+ testling.requestVCard(new JID("foo@bar.com/baz"));
+ stanzaChannel.onIQReceived.emit(IQ.createError(new JID("baz@fum.com/foo"), stanzaChannel.sentStanzas.get(0).getTo(), stanzaChannel.sentStanzas.get(0).getID()));
- assertEquals(1, (changes.size()));
- assertEquals(new JID("foo@bar.com/baz"), changes.get(0).jid);
- assertEquals((""), changes.get(0).vcard.getFullName());
- assertEquals((""), vcardStorage.getVCard(new JID("foo@bar.com/baz")).getFullName());
+ // On error, cached vCards should not be changed
+ assertEquals(0,changes.size());
}
@Test