Search in sources :

Example 21 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class EzyDisconnectEventImplTest method test.

@Test
public void test() {
    EzyUser user = newUser();
    EzyUserRemovedEvent event = new EzySimpleUserRemovedEvent(user, EzyDisconnectReason.IDLE);
    assert event.getUser() == user;
    assert event.getReason() == EzyDisconnectReason.IDLE;
}
Also used : EzyUser(com.tvd12.ezyfoxserver.entity.EzyUser) EzyUserRemovedEvent(com.tvd12.ezyfoxserver.event.EzyUserRemovedEvent) EzySimpleUserRemovedEvent(com.tvd12.ezyfoxserver.event.EzySimpleUserRemovedEvent) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Example 22 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class EzySimpleUserAccessedAppEventTest method test.

@Test
public void test() {
    // given
    EzyUser user = newUser();
    EzySimpleUserAccessedAppEvent underTest = new EzySimpleUserAccessedAppEvent(user);
    // when
    EzyUser actual = underTest.getUser();
    // then
    Asserts.assertEquals(actual, user);
}
Also used : EzyUser(com.tvd12.ezyfoxserver.entity.EzyUser) EzySimpleUserAccessedAppEvent(com.tvd12.ezyfoxserver.event.EzySimpleUserAccessedAppEvent) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Example 23 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class HelloController method greet.

@EzyDoHandle("Hello2")
public void greet(@EzyRequestData GreetRequest request, EzyUser user, EzySession session, Integer nothing) {
    GreetResponse response = new GreetResponse("Hello " + request.getWho() + "!");
    System.out.println("HelloController::Big/Hello response: " + response);
}
Also used : GreetResponse(com.tvd12.ezyfoxserver.support.test.data.GreetResponse) EzyDoHandle(com.tvd12.ezyfox.core.annotation.EzyDoHandle)

Example 24 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class HelloController method greet.

@EzyDoHandle("Hello")
public void greet(GreetRequest request, EzyUser user, EzySession session) {
    GreetResponse response = new GreetResponse("Hello " + request.getWho() + "!");
    System.out.println("HelloController::Big/Hello response: " + response);
}
Also used : GreetResponse(com.tvd12.ezyfoxserver.support.test.data.GreetResponse) EzyDoHandle(com.tvd12.ezyfox.core.annotation.EzyDoHandle)

Example 25 with EzyUser

use of com.tvd12.ezyfoxserver.client.entity.EzyUser in project ezyfox-server by youngmonkeys.

the class HelloController method greet.

@EzyDoHandle("Hello5")
public void greet(@EzyRequestData GreetRequest request, EzyUser user, EzySession session, char nothing) {
    GreetResponse response = new GreetResponse("Hello " + request.getWho() + "!");
    System.out.println("HelloController::Big/Hello response: " + response);
}
Also used : GreetResponse(com.tvd12.ezyfoxserver.support.test.data.GreetResponse) EzyDoHandle(com.tvd12.ezyfox.core.annotation.EzyDoHandle)

Aggregations

EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)26 Test (org.testng.annotations.Test)16 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)13 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)12 GreetResponse (com.tvd12.ezyfoxserver.support.test.data.GreetResponse)8 EzyDoHandle (com.tvd12.ezyfox.core.annotation.EzyDoHandle)7 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)6 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)6 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)5 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)5 EzyLoginProcessor (com.tvd12.ezyfoxserver.controller.EzyLoginProcessor)5 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)5 EzyZoneUserManager (com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager)5 EzySimpleZone (com.tvd12.ezyfoxserver.EzySimpleZone)4 EzySessionDelegate (com.tvd12.ezyfoxserver.delegate.EzySessionDelegate)4 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)4 EzyUserLoginEvent (com.tvd12.ezyfoxserver.event.EzyUserLoginEvent)4 EzyAppUserManager (com.tvd12.ezyfoxserver.wrapper.EzyAppUserManager)4 EzyConstant (com.tvd12.ezyfox.constant.EzyConstant)3 EzyArray (com.tvd12.ezyfox.entity.EzyArray)3