1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Rename processPacket to processStanza

and assert that 'stanza' is a Stanza.
This commit is contained in:
Florian Schmaus 2015-06-05 14:04:17 +02:00
parent 1cd268a8f0
commit 2f219c7317
11 changed files with 33 additions and 44 deletions

View file

@ -383,7 +383,7 @@ public class ChatConnectionTest {
@Override
public void run() {
con.processPacket(chatPacket);
con.processStanza(chatPacket);
}
}

View file

@ -341,7 +341,7 @@ public class RosterTest extends InitSmackIm {
rosterListener.reset();
// Simulate receiving the roster push
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
rosterListener.waitUntilInvocationOrTimeout();
// Verify the roster entry of the new contact
@ -380,7 +380,7 @@ public class RosterTest extends InitSmackIm {
final String requestId = packet.getStanzaId();
// Simulate receiving the roster push
connection.processPacket(packet);
connection.processStanza(packet);
// Smack should reply with an error IQ
ErrorIQ errorIQ = (ErrorIQ) connection.getSentPacket();
@ -482,7 +482,7 @@ public class RosterTest extends InitSmackIm {
rosterListener.reset();
// Simulate receiving the roster push
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
rosterListener.waitUntilInvocationOrTimeout();
// Verify the roster entry of the new contact
@ -524,7 +524,7 @@ public class RosterTest extends InitSmackIm {
rosterPush.addRosterItem(item);
// simulate receiving the roster push
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
}
}
@ -572,7 +572,7 @@ public class RosterTest extends InitSmackIm {
rosterResult.addRosterItem(benvolio);
// simulate receiving the roster result and exit the loop
connection.processPacket(rosterResult);
connection.processStanza(rosterResult);
break;
}
}
@ -672,11 +672,11 @@ public class RosterTest extends InitSmackIm {
rosterPush.setType(Type.set);
rosterPush.setTo(connection.getUser());
rosterPush.addRosterItem(item);
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
// Create and process the IQ response
final IQ response = IQ.createResultIQ(rosterRequest);
connection.processPacket(response);
connection.processStanza(response);
// Verify the roster update request
assertSame("A roster set MUST contain one and only one <item/> element.",

View file

@ -152,7 +152,7 @@ public class RosterVersioningTest {
answer.addRosterItem(vaglafItem);
rosterListener.reset();
connection.processPacket(answer);
connection.processStanza(answer);
rosterListener.waitUntilInvocationOrTimeout();
} else {
assertTrue("Expected to get a RosterPacket ", false);
@ -191,7 +191,7 @@ public class RosterVersioningTest {
Item pushedItem = vaglafItem();
rosterPush.addRosterItem(pushedItem);
rosterListener.reset();
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
rosterListener.waitAndReset();
assertEquals("Expect store version after push", "v97", store.getRosterVersion());
@ -218,7 +218,7 @@ public class RosterVersioningTest {
item.setItemType(ItemType.remove);
rosterPush.addRosterItem(item);
rosterListener.reset();
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
rosterListener.waitAndReset();
assertNull("Store doses not contain vaglaf", store.getEntry(JidCreate.bareFrom("vaglaf@example.com")));
@ -255,7 +255,7 @@ public class RosterVersioningTest {
Stanza sentPacket = connection.getSentPacket();
if (sentPacket instanceof RosterPacket) {
final IQ emptyIQ = IQ.createResultIQ((RosterPacket)sentPacket);
connection.processPacket(emptyIQ);
connection.processStanza(emptyIQ);
} else {
assertTrue("Expected to get a RosterPacket ", false);
}

View file

@ -171,11 +171,11 @@ public class SubscriptionPreApprovalTest extends InitSmackIm {
rosterPush.setType(Type.set);
rosterPush.setTo(connection.getUser());
rosterPush.addRosterItem(item);
connection.processPacket(rosterPush);
connection.processStanza(rosterPush);
// Create and process the IQ response
final IQ response = IQ.createResultIQ(rosterRequest);
connection.processPacket(response);
connection.processStanza(response);
// Verify the roster update request
assertSame("A roster set MUST contain one and only one <item/> element.",