use of com.tvd12.example.lucky_wheel.entity.User 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);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class HelloController method greet.
@EzyDoHandle("Hello4")
public void greet(@EzyRequestData GreetRequest request, EzyUser user, EzySession session, boolean nothing) {
GreetResponse response = new GreetResponse("Hello " + request.getWho() + "!");
System.out.println("HelloController::Big/Hello response: " + response);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class HelloController method greet.
@EzyDoHandle("Hello3")
public void greet(@EzyRequestData GreetRequest request, EzyUser user, EzySession session, int nothing) {
GreetResponse response = new GreetResponse("Hello " + request.getWho() + "!");
System.out.println("HelloController::Big/Hello response: " + response);
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzyServerContextsTest method test.
@Test
public void test() {
EzySimpleApplication app = new EzySimpleApplication();
app.setUserManager(EzyAppUserManagerImpl.builder().maxUsers(1).appName("test").build());
EzyAppContext appContext = mock(EzyAppContext.class);
when(appContext.getApp()).thenReturn(app);
EzySimpleUser user = new EzySimpleUser();
assert !EzyServerContexts.containsUser(appContext, user);
assert !EzyServerContexts.containsUser(appContext, "test");
assert EzyServerContexts.getUserManager(appContext) != null;
}
use of com.tvd12.example.lucky_wheel.entity.User in project ezyfox-server by youngmonkeys.
the class EzySimpleAppContextTest method test.
@Test
public void test() {
EzyServerContext serverContext = mock(EzyServerContext.class);
EzySimpleZone zone = new EzySimpleZone();
EzyZoneContext zoneContext = mock(EzyZoneContext.class);
when(zoneContext.getZone()).thenReturn(zone);
when(zoneContext.getParent()).thenReturn(serverContext);
EzySimpleApplication app = new EzySimpleApplication();
EzySimpleAppSetting setting = new EzySimpleAppSetting();
app.setSetting(setting);
EzySimpleAppContext appContext = new EzySimpleAppContext();
appContext.setParent(zoneContext);
appContext.setApp(app);
appContext.init();
Asserts.assertNull(appContext.get(Void.class));
// noinspection EqualsWithItself
assert appContext.equals(appContext);
EzySimpleAppContext appContext2 = new EzySimpleAppContext();
assert !appContext.equals(appContext2);
assert appContext.cmd(EzyAppResponse.class) != null;
Asserts.assertNull(appContext.cmd(Void.class));
EzySimpleUser user = new EzySimpleUser();
user.setName("test");
EzyAbstractSession session = spy(EzyAbstractSession.class);
user.addSession(session);
EzyData data = EzyEntityFactory.newArrayBuilder().build();
appContext.send(data, session, false);
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
appContext.setExecutorService(executorService);
assert appContext.getExecutorService() != null;
appContext.handleException(Thread.currentThread(), new Exception());
}
Aggregations