mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-07 21:51:07 +01:00
Phase 1 of large refactoring. Removing dead code, bug fixes, updates to JDK 1.5.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4511 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
1a08715f67
commit
bbbfe09c31
62 changed files with 291 additions and 3524 deletions
|
|
@ -58,7 +58,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
|
|||
*/
|
||||
public void testReadAndDelete() {
|
||||
// Make user2 unavailable
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.UNAVAILABLE));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.unavailable));
|
||||
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
|
|
@ -103,7 +103,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
|
|||
// User2 becomes available again
|
||||
PacketCollector collector = getConnection(1).createPacketCollector(
|
||||
new MessageTypeFilter(Message.Type.CHAT));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.AVAILABLE));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.available));
|
||||
|
||||
// Check that no offline messages was sent to the user
|
||||
Message message = (Message) collector.nextResult(2500);
|
||||
|
|
@ -127,7 +127,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
|
|||
*/
|
||||
public void testFetchAndPurge() {
|
||||
// Make user2 unavailable
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.UNAVAILABLE));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.unavailable));
|
||||
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
|
|
@ -161,7 +161,7 @@ public class OfflineMessageManagerTest extends SmackTestCase {
|
|||
// User2 becomes available again
|
||||
PacketCollector collector = getConnection(1).createPacketCollector(
|
||||
new MessageTypeFilter(Message.Type.CHAT));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.AVAILABLE));
|
||||
getConnection(1).sendPacket(new Presence(Presence.Type.available));
|
||||
|
||||
// Check that no offline messages was sent to the user
|
||||
Message message = (Message) collector.nextResult(2500);
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
public void testSendRosterGroup() {
|
||||
// Send user1's RosterGroups to user2
|
||||
try {
|
||||
RosterExchangeManager rosterExchangeManager =
|
||||
new RosterExchangeManager(getConnection(0));
|
||||
for (Iterator it = getConnection(0).getRoster().getGroups(); it.hasNext();)
|
||||
rosterExchangeManager.send((RosterGroup) it.next(), getBareJID(1));
|
||||
RosterExchangeManager rosterExchangeManager = new RosterExchangeManager(getConnection(0));
|
||||
for (RosterGroup rosterGroup : getConnection(0).getRoster().getGroups()) {
|
||||
rosterExchangeManager.send(rosterGroup, getBareJID(1));
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
* protocol.
|
||||
*/
|
||||
public void testGroupchatCompatibility() {
|
||||
try {
|
||||
// TODO: this test needs to be re-written so that it manually emulates the old-style
|
||||
// TODO: group chat protocol. Tne GroupChat class was deleted for Smack 3.0.
|
||||
/*try {
|
||||
Message message;
|
||||
|
||||
GroupChat groupchat = new GroupChat(getConnection(1), room);
|
||||
|
|
@ -103,7 +105,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
assertNotNull("Presence of user2 in room is missing", presence);
|
||||
assertEquals(
|
||||
"Presence mode of user2 is wrong",
|
||||
Presence.Mode.AVAILABLE,
|
||||
Presence.Mode.available,
|
||||
presence.getMode());
|
||||
|
||||
// User using old client send a message
|
||||
|
|
@ -126,7 +128,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void testDiscussionHistory() {
|
||||
|
|
@ -202,16 +204,16 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
assertNotNull("Presence of user2 in room is missing", presence);
|
||||
assertEquals(
|
||||
"Presence mode of user2 is wrong",
|
||||
Presence.Mode.AVAILABLE,
|
||||
Presence.Mode.available,
|
||||
presence.getMode());
|
||||
|
||||
// User2 changes his availability to AWAY
|
||||
muc2.changeAvailabilityStatus("Gone to have lunch", Presence.Mode.AWAY);
|
||||
muc2.changeAvailabilityStatus("Gone to have lunch", Presence.Mode.away);
|
||||
Thread.sleep(200);
|
||||
// User1 checks the presence of user2 in the room
|
||||
presence = muc.getOccupantPresence(room + "/testbot2");
|
||||
assertNotNull("Presence of user2 in room is missing", presence);
|
||||
assertEquals("Presence mode of user2 is wrong", Presence.Mode.AWAY, presence.getMode());
|
||||
assertEquals("Presence mode of user2 is wrong", Presence.Mode.away, presence.getMode());
|
||||
assertEquals(
|
||||
"Presence status of user2 is wrong",
|
||||
"Gone to have lunch",
|
||||
|
|
@ -258,7 +260,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
assertNotNull("Presence of user2 in room is missing", presence);
|
||||
assertEquals(
|
||||
"Presence mode of user2 is wrong",
|
||||
Presence.Mode.AVAILABLE,
|
||||
Presence.Mode.available,
|
||||
presence.getMode());
|
||||
|
||||
// Anonymous user leaves the room
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue