Hi
Another instalment in my quest to get the Smack tests to run against a different server.
In the test below, from MessageTest.java, the test code expects a message at the end to be non-null. In fact, the message is null and the test fails.
I have copied the test code below interspersed with the messages taken from the Smack debug tool. The message AKcTl-20 is the last message to appear in the debug, which implies that there is no message to collected as there is nothing being sent by my server when the test code expects there to be.
I can’t really tell who is right here though, the test code or my server.
Many thanks
Nathan
/**
-
Will a user recieve a message from another after only sending the user a directed presence,
-
or will Wildfire intercept for offline storage?
-
User1 becomes lines. User0 never sent an available presence to the server but
-
instead sent one to User1. User1 sends a message to User0. Should User0 get the
-
message?
*/
public void testDirectPresence() {
getConnection(1).sendPacket(new Presence(Presence.Type.available));
Presence presence = new Presence(Presence.Type.available);
presence.setTo(getBareJID(1));
getConnection(0).sendPacket(presence);
PacketCollector collector = getConnection(0)
.createPacketCollector(new MessageTypeFilter(Message.Type.chat));
try {
getConnection(1).getChatManager().createChat(getBareJID(0), null).sendMessage(“Test 1”);
Test 1gQvkt0
}
catch (XMPPException e) {
e.printStackTrace();
fail(e.getMessage());
}
Message message = (Message) collector.nextResult(2500);
Message is null, test fails.
assertNotNull(“Message not recieved from remote user”, message);