Search in sources :

Example 1 with OfflineRequest

use of org.roof.im.request.OfflineRequest in project roof-im by madfroglx.

the class OfflineTest method testUserNotOnline.

@Test
public void testUserNotOnline() throws Exception {
    OfflineRequest offlineRequest = createRequest();
    ValueStack valueStack = createValueStack(offlineRequest);
    enterChain.doChain(valueStack);
}
Also used : OfflineRequest(org.roof.im.request.OfflineRequest) ValueStack(com.roof.chain.api.ValueStack) GenericValueStack(com.roof.chain.support.GenericValueStack) Test(org.junit.Test)

Example 2 with OfflineRequest

use of org.roof.im.request.OfflineRequest in project roof-im by madfroglx.

the class OfflineTest method createRequest.

private OfflineRequest createRequest() {
    OfflineRequest offlineRequest = new OfflineRequest();
    offlineRequest.setClientType(ClientType.h5.name());
    offlineRequest.setRequestType("offline");
    offlineRequest.setToken("abc");
    offlineRequest.setCreateTime(System.currentTimeMillis());
    System.out.println(JSON.toJSONString(offlineRequest));
    return offlineRequest;
}
Also used : OfflineRequest(org.roof.im.request.OfflineRequest)

Example 3 with OfflineRequest

use of org.roof.im.request.OfflineRequest in project roof-im by madfroglx.

the class OfflineTest method testSuccess.

@Test
public void testSuccess() throws Exception {
    List<UserState> states = new ArrayList<>();
    UserState userState = new UserState();
    userState.setConnectId("1");
    userState.setClientType(ClientType.h5.name());
    userState.setUsername("abc");
    userState.setServerName(serverNameBuilder.getName());
    states.add(userState);
    UserState userState2 = new UserState();
    userState2.setConnectId("1");
    userState2.setClientType("applet");
    userState2.setUsername("abc");
    userState2.setServerName(serverNameBuilder.getName());
    states.add(userState2);
    userStateService.online("abc", states);
    OfflineRequest offlineRequest = createRequest();
    ValueStack valueStack = createValueStack(offlineRequest);
    enterChain.doChain(valueStack);
}
Also used : OfflineRequest(org.roof.im.request.OfflineRequest) UserState(org.roof.im.user.UserState) ValueStack(com.roof.chain.api.ValueStack) GenericValueStack(com.roof.chain.support.GenericValueStack) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

OfflineRequest (org.roof.im.request.OfflineRequest)3 ValueStack (com.roof.chain.api.ValueStack)2 GenericValueStack (com.roof.chain.support.GenericValueStack)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 UserState (org.roof.im.user.UserState)1