1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 23:42:06 +01:00

Fixed test case.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3175 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2005-12-08 20:56:54 +00:00 committed by gato
parent ee6cedcea7
commit 18ad3cfb66

View file

@ -147,12 +147,12 @@ public class MultiUserChatTest extends SmackTestCase {
Message msg; Message msg;
// Get first historic message // Get first historic message
msg = muc2.nextMessage(1000); msg = muc2.nextMessage(1000);
assertNotNull("First message is null", msg);
DelayInformation delay = (DelayInformation) msg.getExtension("x", "jabber:x:delay"); DelayInformation delay = (DelayInformation) msg.getExtension("x", "jabber:x:delay");
SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss"); SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
UTC_FORMAT.setTimeZone(TimeZone.getDefault()); UTC_FORMAT.setTimeZone(TimeZone.getDefault());
System.out.println(UTC_FORMAT.format(delay.getStamp())); System.out.println(UTC_FORMAT.format(delay.getStamp()));
assertNotNull("First message is null", msg);
assertEquals("Body of first message is incorrect", "Message 3", msg.getBody()); assertEquals("Body of first message is incorrect", "Message 3", msg.getBody());
// Try to get second historic message // Try to get second historic message
msg = muc2.nextMessage(1000); msg = muc2.nextMessage(1000);
@ -435,7 +435,15 @@ public class MultiUserChatTest extends SmackTestCase {
// Check that we have discovered the room used by this test // Check that we have discovered the room used by this test
assertFalse("No room was found", rooms.isEmpty()); assertFalse("No room was found", rooms.isEmpty());
// Check that we have discovered the room used by this test // Check that we have discovered the room used by this test
assertEquals("Wrong room JID found", room, ((HostedRoom)rooms.toArray()[0]).getJid()); boolean found = false;
for (Iterator it = rooms.iterator(); it.hasNext();) {
HostedRoom hostedRoom = (HostedRoom) it.next();
if (room.equals(hostedRoom.getJid())) {
found = true;
break;
}
}
assertTrue("JID of room was not found", found);
} }
catch (XMPPException e) { catch (XMPPException e) {
e.printStackTrace(); e.printStackTrace();