Changed willMessage and password in CONNECT message from String to byte[] (fix issue #94 and #95)

This commit is contained in:
andsel
2015-09-16 23:25:15 +02:00
parent 9a7ec7fd62
commit e08cf95135
18 changed files with 58 additions and 49 deletions
@@ -142,7 +142,7 @@ public class ConnectDecoderTest {
verifyBaseHeader(message);
assertEquals("ABCDEFGH", message.getClientID());
assertEquals("Topic", message.getWillTopic());
assertEquals("Message", message.getWillMessage());
assertEquals("Message", new String(message.getWillMessage()));
}
@@ -167,9 +167,9 @@ public class ConnectDecoderTest {
assertEquals(AbstractMessage.CONNECT, message.getMessageType());
assertEquals("ABCDEFGH", message.getClientID());
assertEquals("Topic", message.getWillTopic());
assertEquals("Message", message.getWillMessage());
assertEquals("Message", new String(message.getWillMessage()));
assertEquals("Fakeuser", message.getUsername());
assertEquals("pwd", message.getPassword());
assertEquals("pwd", new String(message.getPassword()));
}
@Test(expected = CorruptedFrameException.class)
@@ -75,7 +75,7 @@ public class ConnectEncoderTest {
//variable part
msg.setClientID("ABCDEF");
msg.setWillTopic("Topic");
msg.setWillMessage("Message");
msg.setWillMessage("Message".getBytes());
ByteBuf out = Unpooled.buffer();
@@ -111,9 +111,9 @@ public class ConnectEncoderTest {
//variable part
msg.setClientID("ABCDEF");
msg.setWillTopic("Topic");
msg.setWillMessage("Message");
msg.setWillMessage("Message".getBytes());
msg.setUsername("Pablo");
msg.setPassword("PBL");
msg.setPassword("PBL".getBytes());
ByteBuf out = Unpooled.buffer();