aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImplTest.java78
1 files changed, 45 insertions, 33 deletions
diff --git a/test/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImplTest.java b/test/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImplTest.java
index 39af2d9..110a8f2 100644
--- a/test/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImplTest.java
+++ b/test/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImplTest.java
@@ -20,7 +20,8 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(null, chatroom, "user", "user",
- "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for parent provider instance");
}
catch (IllegalArgumentException e)
@@ -36,7 +37,8 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(provider, null, "user", "user",
- "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for ChatRoom instance");
}
catch (IllegalArgumentException e)
@@ -53,7 +55,8 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(provider, chatroom, null, "user",
- "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for ChatRoom instance");
}
catch (IllegalArgumentException e)
@@ -70,7 +73,8 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(provider, chatroom, "user", null,
- "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for ChatRoom instance");
}
catch (IllegalArgumentException e)
@@ -87,7 +91,7 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", null,
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for ChatRoom instance");
}
catch (IllegalArgumentException e)
@@ -104,7 +108,7 @@ public class ChatRoomMemberIrcImplTest
try
{
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user",
- "host.name", null);
+ "host.name", null, IrcStatusEnum.ONLINE);
Assert.fail("should throw IAE for ChatRoom instance");
}
catch (IllegalArgumentException e)
@@ -119,7 +123,8 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
Assert.assertNotNull(new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER));
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE));
}
public void testCheckGetters()
@@ -127,8 +132,10 @@ public class ChatRoomMemberIrcImplTest
ChatRoom chatroom = EasyMock.createMock(ChatRoom.class);
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
- ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberIrcImpl member =
+ new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user",
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.assertEquals(provider, member.getProtocolProvider());
Assert.assertEquals(chatroom, member.getChatRoom());
Assert.assertEquals("user", member.getContactAddress());
@@ -143,7 +150,8 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user",
- "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.assertEquals("user", member.getContactAddress());
Assert.assertEquals("user", member.getName());
try
@@ -162,8 +170,10 @@ public class ChatRoomMemberIrcImplTest
ChatRoom chatroom = EasyMock.createMock(ChatRoom.class);
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
- ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberIrcImpl member =
+ new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user",
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.assertEquals("user", member.getContactAddress());
Assert.assertEquals("user", member.getName());
member.setName("myNewName");
@@ -178,7 +188,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
member.setRole(null);
}
@@ -187,8 +197,10 @@ public class ChatRoomMemberIrcImplTest
ChatRoom chatroom = EasyMock.createMock(ChatRoom.class);
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
- ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberIrcImpl member =
+ new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user",
+ "host.name", ChatRoomMemberRole.SILENT_MEMBER,
+ IrcStatusEnum.ONLINE);
Assert.assertSame(ChatRoomMemberRole.SILENT_MEMBER, member.getRole());
member.setRole(ChatRoomMemberRole.ADMINISTRATOR);
Assert.assertSame(ChatRoomMemberRole.SILENT_MEMBER, member.getRole());
@@ -201,7 +213,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertSame(ChatRoomMemberRole.SILENT_MEMBER, member.getRole());
member.addRole(ChatRoomMemberRole.ADMINISTRATOR);
Assert.assertSame(ChatRoomMemberRole.ADMINISTRATOR, member.getRole());
@@ -214,7 +226,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
member.addRole(ChatRoomMemberRole.ADMINISTRATOR);
Assert.assertSame(ChatRoomMemberRole.ADMINISTRATOR, member.getRole());
member.removeRole(ChatRoomMemberRole.ADMINISTRATOR);
@@ -228,7 +240,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.ADMINISTRATOR);
+ ChatRoomMemberRole.ADMINISTRATOR, IrcStatusEnum.ONLINE);
Assert.assertSame(ChatRoomMemberRole.ADMINISTRATOR, member.getRole());
member.addRole(ChatRoomMemberRole.MEMBER);
Assert.assertSame(ChatRoomMemberRole.ADMINISTRATOR, member.getRole());
@@ -241,7 +253,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.ADMINISTRATOR);
+ ChatRoomMemberRole.ADMINISTRATOR, IrcStatusEnum.ONLINE);
member.addRole(ChatRoomMemberRole.MEMBER);
Assert.assertSame(ChatRoomMemberRole.ADMINISTRATOR, member.getRole());
member.removeRole(ChatRoomMemberRole.MEMBER);
@@ -259,7 +271,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.replay(provider);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertNull(member.getContact());
}
@@ -270,7 +282,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "user", "user", "host.name",
- ChatRoomMemberRole.SILENT_MEMBER);
+ ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertNull(member.getAvatar());
}
@@ -280,7 +292,7 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertTrue(member.equals(member));
}
@@ -290,7 +302,7 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertFalse(member.equals(null));
}
@@ -300,7 +312,7 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertFalse(member.equals(new Object()));
}
@@ -310,11 +322,11 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member1 = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
ProtocolProviderServiceIrcImpl provider2 =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member2 = new ChatRoomMemberIrcImpl(provider2, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertFalse(member1.equals(member2));
}
@@ -324,9 +336,9 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member1 = new ChatRoomMemberIrcImpl(provider, chatroom,
- "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "user", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
ChatRoomMemberIrcImpl member2 = new ChatRoomMemberIrcImpl(provider, chatroom,
- "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertFalse(member1.equals(member2));
}
@@ -336,9 +348,9 @@ public class ChatRoomMemberIrcImplTest
ProtocolProviderServiceIrcImpl provider =
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member1 = new ChatRoomMemberIrcImpl(provider, chatroom,
- "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
ChatRoomMemberIrcImpl member2 = new ChatRoomMemberIrcImpl(provider, chatroom,
- "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER);
+ "susy", "user", "host.name", ChatRoomMemberRole.SILENT_MEMBER, IrcStatusEnum.ONLINE);
Assert.assertTrue(member1.equals(member2));
}
@@ -349,7 +361,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "ET", "user", "host.name",
- ChatRoomMemberRole.ADMINISTRATOR);
+ ChatRoomMemberRole.ADMINISTRATOR, IrcStatusEnum.ONLINE);
member.hashCode();
}
@@ -360,7 +372,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "ET", "user", "host.name",
- ChatRoomMemberRole.ADMINISTRATOR);
+ ChatRoomMemberRole.ADMINISTRATOR, IrcStatusEnum.ONLINE);
Assert.assertEquals("user", member.getIdent());
}
@@ -371,7 +383,7 @@ public class ChatRoomMemberIrcImplTest
EasyMock.createMock(ProtocolProviderServiceIrcImpl.class);
ChatRoomMemberIrcImpl member =
new ChatRoomMemberIrcImpl(provider, chatroom, "ET", "user", "host.name",
- ChatRoomMemberRole.ADMINISTRATOR);
+ ChatRoomMemberRole.ADMINISTRATOR, IrcStatusEnum.ONLINE);
Assert.assertEquals("host.name", member.getHostname());
}
}