1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

More detailed logging to RosterIntegrationTest

This commit is contained in:
Florian Schmaus 2016-12-23 23:41:31 +01:00
parent ecf1ed7f6b
commit 1f7770b831

View file

@ -32,6 +32,7 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.roster.packet.RosterPacket.ItemType; import org.jivesoftware.smack.roster.packet.RosterPacket.ItemType;
import org.jivesoftware.smack.util.StringUtils;
import org.jxmpp.jid.BareJid; import org.jxmpp.jid.BareJid;
import org.jxmpp.jid.Jid; import org.jxmpp.jid.Jid;
@ -77,7 +78,17 @@ public class RosterIntegrationTest extends AbstractSmackIntegrationTest {
if (!jid.equals(conTwo.getUser().asBareJid())) { if (!jid.equals(conTwo.getUser().asBareJid())) {
continue; continue;
} }
RosterEntry rosterEntry = rosterOne.getEntry(conTwo.getUser().asBareJid()); BareJid bareJid = conTwo.getUser().asBareJid();
RosterEntry rosterEntry = rosterOne.getEntry(bareJid);
if (rosterEntry == null) {
addedAndSubscribed.signalFailure("No roster entry for " + bareJid);
return;
}
String name = rosterEntry.getName();
if (StringUtils.isNullOrEmpty(name)) {
addedAndSubscribed.signalFailure("Roster entry without name");
return;
}
if (!rosterEntry.getName().equals(conTwosRosterName)) { if (!rosterEntry.getName().equals(conTwosRosterName)) {
addedAndSubscribed.signalFailure("Roster name does not match"); addedAndSubscribed.signalFailure("Roster name does not match");
return; return;