Search in sources :

Example 1 with IChannelMessageSender

use of org.qiunet.flash.handler.context.sender.IChannelMessageSender in project DuoDuo by qiunet.

the class TestWebsocketBootstrap method testProtobufWebSocket.

@Test
public void testProtobufWebSocket() throws InterruptedException {
    LoadBadWordEventData.valueOf(new DefaultBadWord(Lists.newArrayList("毛泽东"))).fireEventHandler();
    text = "test [testProtobufWebSocket]";
    IChannelMessageSender client = NettyWebSocketClient.create(WebSocketClientParams.custom().setAddress("localhost", port).build(), new ResponseTrigger());
    WsPbLoginRequest request = WsPbLoginRequest.valueOf(text, text, 11);
    latch = new CountDownLatch(1);
    client.sendMessage(request);
    latch.await();
}
Also used : DefaultBadWord(org.qiunet.function.badword.DefaultBadWord) IPersistConnResponseTrigger(org.qiunet.flash.handler.netty.client.trigger.IPersistConnResponseTrigger) WsPbLoginRequest(org.qiunet.test.handler.proto.WsPbLoginRequest) CountDownLatch(java.util.concurrent.CountDownLatch) IChannelMessageSender(org.qiunet.flash.handler.context.sender.IChannelMessageSender) Test(org.junit.jupiter.api.Test)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)1 Test (org.junit.jupiter.api.Test)1 IChannelMessageSender (org.qiunet.flash.handler.context.sender.IChannelMessageSender)1 IPersistConnResponseTrigger (org.qiunet.flash.handler.netty.client.trigger.IPersistConnResponseTrigger)1 DefaultBadWord (org.qiunet.function.badword.DefaultBadWord)1 WsPbLoginRequest (org.qiunet.test.handler.proto.WsPbLoginRequest)1