use of org.roof.im.request.MessageRequest in project roof-im by madfroglx.
the class MessageRequestTest method testSuccess.
@Test
public void testSuccess() throws Exception {
online("bcd");
MessageRequest messageRequest = new MessageRequest();
messageRequest.setRequestType("message");
messageRequest.setToken("abc");
messageRequest.setReceiver("bcd");
messageRequest.setType(ContentType.TXT);
messageRequest.setClientType(ClientType.h5.name());
messageRequest.setCreateTime(System.currentTimeMillis());
messageRequest.setPayload("test");
ValueStack valueStack = new GenericValueStack();
valueStack.set(ImConstant.TEXT_MESSAGE, JSON.toJSONString(messageRequest));
valueStack.set(ImConstant.CONNECT_ID, "1");
valueStack.set("messageRequest", messageRequest);
messageRequestChain.doChain(valueStack);
}
use of org.roof.im.request.MessageRequest in project roof-im by madfroglx.
the class MessageTest method testSuccess.
@Test
public void testSuccess() throws Exception {
online("bcd");
online("abc");
MessageRequest messageRequest = new MessageRequest();
messageRequest.setRequestType("message");
messageRequest.setToken("abc");
messageRequest.setReceiver("abc");
messageRequest.setType(ContentType.TXT);
messageRequest.setClientType(ClientType.h5.name());
messageRequest.setCreateTime(System.currentTimeMillis());
messageRequest.setPayload("test");
System.out.println(JSON.toJSONString(messageRequest));
ValueStack valueStack = new GenericValueStack();
valueStack.set(ImConstant.TEXT_MESSAGE, JSON.toJSONString(messageRequest));
valueStack.set(ImConstant.CONNECT_ID, "1");
JSONObject jsonObjectMessage = JSON.parseObject(JSON.toJSONString(messageRequest));
valueStack.set(ImConstant.JSON_OBJECT_MESSAGE, jsonObjectMessage);
enterChain.doChain(valueStack);
}
Aggregations