From ed7b6454e4c33c7b82c8d02c839727a16c2386fe Mon Sep 17 00:00:00 2001 From: Danny van Heumen Date: Fri, 1 Aug 2014 20:42:17 +0200 Subject: Escape html entities while parsing the IRC message. Now escapes html entities during the parsing of the message received from IRC and added a unit test for this requirement. Renamed format* methods to styleAs*, since this is more appropriate. --- .../communicator/impl/protocol/irc/UtilsTest.java | 29 ++++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'test/net') diff --git a/test/net/java/sip/communicator/impl/protocol/irc/UtilsTest.java b/test/net/java/sip/communicator/impl/protocol/irc/UtilsTest.java index b38454e..92b6ed8 100644 --- a/test/net/java/sip/communicator/impl/protocol/irc/UtilsTest.java +++ b/test/net/java/sip/communicator/impl/protocol/irc/UtilsTest.java @@ -14,16 +14,6 @@ public class UtilsTest extends TestCase { - protected void setUp() throws Exception - { - super.setUp(); - } - - protected void tearDown() throws Exception - { - super.tearDown(); - } - public void testNullText() { Assert.assertEquals(null, Utils.parseIrcMessage(null)); @@ -183,26 +173,33 @@ public class UtilsTest final String htmlMessage = "With color and without color."; Assert.assertEquals(htmlMessage, Utils.parseIrcMessage(ircMessage)); } + + public void testMessageContainingHtmlEntities() + { + final String ircMessage = "\u0002This is very bad &&& text!!!