":nick!~user@host.org PRIVMSG #ircbottest :channel message",
":nick!~user@host.org PRIVMSG botNickName :private message"
};
public void testIrcMessageParser() {
IrcMessage message1 = IrcMessage.tryParse(this.messages[0]);
IrcMessage message2 = IrcMessage.tryParse(this.messages[1]);
assertNotNull(message1);
assertEquals(message1.getNick(), "nick");
assertEquals(message1.getHost(), "~user@host.org");
assertEquals(message1.getMessageType(), IrcMessageType.ChannelMessage);
assertEquals(message1.getReceiver(), "#ircbottest");
assertEquals(message1.getMessage(), "channel message");
assertNotNull(message2);
assertEquals(message2.getNick(), "nick");
assertEquals(message2.getHost(), "~user@host.org");
assertEquals(message2.getMessageType(), IrcMessageType.PrivateMessage);
assertEquals(message2.getReceiver(), "botNickName");
assertEquals(message2.getMessage(), "private message");
}