mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Merge branch '4.2' into master-paul-merged
This commit is contained in:
commit
431e5b3c67
434 changed files with 1770 additions and 1517 deletions
|
@ -374,12 +374,12 @@ public class ChatConnectionTest {
|
|||
}
|
||||
|
||||
private static class TestChatServer extends Thread {
|
||||
private Stanza chatPacket;
|
||||
private DummyConnection con;
|
||||
private final Stanza chatPacket;
|
||||
private final DummyConnection con;
|
||||
|
||||
TestChatServer(Stanza chatMsg, DummyConnection conect) {
|
||||
TestChatServer(Stanza chatMsg, DummyConnection connection) {
|
||||
chatPacket = chatMsg;
|
||||
con = conect;
|
||||
con = connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,9 +32,9 @@ import org.junit.Test;
|
|||
*/
|
||||
public class RosterOfflineTest {
|
||||
|
||||
DummyConnection connection;
|
||||
private DummyConnection connection;
|
||||
|
||||
Roster roster;
|
||||
private Roster roster;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
|
|
|
@ -387,7 +387,7 @@ public class RosterTest extends InitSmackIm {
|
|||
connection.processStanza(packet);
|
||||
|
||||
// Smack should reply with an error IQ
|
||||
ErrorIQ errorIQ = (ErrorIQ) connection.getSentPacket();
|
||||
ErrorIQ errorIQ = connection.getSentPacket();
|
||||
assertEquals(requestId, errorIQ.getStanzaId());
|
||||
assertEquals(Condition.service_unavailable, errorIQ.getError().getCondition());
|
||||
|
||||
|
@ -537,9 +537,7 @@ public class RosterTest extends InitSmackIm {
|
|||
* Initialize the roster according to the example in
|
||||
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
|
||||
* >RFC3921: Retrieving One's Roster on Login</a>.
|
||||
*
|
||||
* @param connection the dummy connection of which the provided roster belongs to.
|
||||
* @param roster the roster (or buddy list) which should be initialized.
|
||||
*
|
||||
* @throws SmackException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
|
|
|
@ -108,13 +108,13 @@ public class RosterVersioningTest {
|
|||
Collection<RosterEntry> entries = roster.getEntries();
|
||||
assertSame("Size of the roster", 3, entries.size());
|
||||
|
||||
HashSet<Item> items = new HashSet<Item>();
|
||||
HashSet<Item> items = new HashSet<>();
|
||||
for (RosterEntry entry : entries) {
|
||||
items.add(RosterEntry.toRosterItem(entry));
|
||||
}
|
||||
RosterStore store = DirectoryRosterStore.init(tmpFolder.newFolder());
|
||||
populateStore(store);
|
||||
assertEquals("Elements of the roster", new HashSet<Item>(store.getEntries()), items);
|
||||
assertEquals("Elements of the roster", new HashSet<>(store.getEntries()), items);
|
||||
|
||||
for (RosterEntry entry : entries) {
|
||||
assertTrue("joe stevens".equals(entry.getName()) || "geoff hurley".equals(entry.getName())
|
||||
|
@ -168,7 +168,7 @@ public class RosterVersioningTest {
|
|||
RosterStore store = roster.getRosterStore();
|
||||
assertEquals("Size of store", 1, store.getEntries().size());
|
||||
Item item = store.getEntry(vaglafItem.getJid());
|
||||
assertNotNull("Store contains vaglaf entry");
|
||||
assertNotNull("Store contains vaglaf entry", item);
|
||||
assertEquals("vaglaf entry in store equals the sent entry", vaglafItem, item);
|
||||
}
|
||||
|
||||
|
@ -201,11 +201,11 @@ public class RosterVersioningTest {
|
|||
assertNotNull("Expect vaglaf to be added", storedItem);
|
||||
assertEquals("Expect vaglaf to be equal to pushed item", pushedItem, storedItem);
|
||||
|
||||
Collection<Item> rosterItems = new HashSet<Item>();
|
||||
Collection<Item> rosterItems = new HashSet<>();
|
||||
for (RosterEntry entry : roster.getEntries()) {
|
||||
rosterItems.add(RosterEntry.toRosterItem(entry));
|
||||
}
|
||||
assertEquals(rosterItems, new HashSet<Item>(store.getEntries()));
|
||||
assertEquals(rosterItems, new HashSet<>(store.getEntries()));
|
||||
}
|
||||
|
||||
// Simulate a roster push removing vaglaf
|
||||
|
|
|
@ -150,7 +150,7 @@ public class SubscriptionPreApprovalTest extends InitSmackIm {
|
|||
*/
|
||||
abstract void verifyRosterUpdateRequest(final RosterPacket updateRequest);
|
||||
/**
|
||||
* Overwrite this method to check if recieved pre-approval request is valid
|
||||
* Overwrite this method to check if received pre-approval request is valid
|
||||
*
|
||||
* @param preApproval the request which would be sent to server.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue