use of com.corundumstudio.socketio.protocol.Packet in project netty-socketio by mrniko.
the class DecoderConnectionPacketTest method testDecodeWithQueryString.
@Test
public void testDecodeWithQueryString() throws IOException {
Packet packet = decoder.decodePacket("1::/test:?test=1", null);
Assert.assertEquals(PacketType.CONNECT, packet.getType());
Assert.assertEquals("/test", packet.getNsp());
// Assert.assertEquals("?test=1", packet.getQs());
}
use of com.corundumstudio.socketio.protocol.Packet in project netty-socketio by mrniko.
the class DecoderConnectionPacketTest method testDecode.
@Test
public void testDecode() throws IOException {
Packet packet = decoder.decodePacket("1::/tobi", null);
Assert.assertEquals(PacketType.CONNECT, packet.getType());
Assert.assertEquals("/tobi", packet.getNsp());
}
use of com.corundumstudio.socketio.protocol.Packet in project netty-socketio by mrniko.
the class DecoderConnectionPacketTest method testDecodeDisconnection.
@Test
public void testDecodeDisconnection() throws IOException {
Packet packet = decoder.decodePacket("0::/woot", null);
Assert.assertEquals(PacketType.DISCONNECT, packet.getType());
Assert.assertEquals("/woot", packet.getNsp());
}
use of com.corundumstudio.socketio.protocol.Packet in project netty-socketio by mrniko.
the class DecoderEventPacketTest method testDecode.
@Test
public void testDecode() throws IOException {
Packet packet = decoder.decodePacket("5:::{\"name\":\"woot\"}", null);
Assert.assertEquals(PacketType.EVENT, packet.getType());
Assert.assertEquals("woot", packet.getName());
}
use of com.corundumstudio.socketio.protocol.Packet in project netty-socketio by mrniko.
the class DecoderEventPacketTest method testDecodeWithMessageIdAndAck.
@Test
public void testDecodeWithMessageIdAndAck() throws IOException {
Packet packet = decoder.decodePacket("5:1+::{\"name\":\"tobi\"}", null);
Assert.assertEquals(PacketType.EVENT, packet.getType());
// Assert.assertEquals(1, (long)packet.getId());
// Assert.assertEquals(Packet.ACK_DATA, packet.getAck());
Assert.assertEquals("tobi", packet.getName());
}
Aggregations