Search in sources :

Example 1 with EzySimpleRequestAppRequest

use of com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest in project ezyfox-server by youngmonkeys.

the class EzyRequestAppControllerTest method testHasNotAccessed.

@Test
public void testHasNotAccessed() {
    EzyArray data = EzyEntityArrays.newArray(1, EzyEntityArrays.newArray());
    EzyRequestAppController controller = new EzyRequestAppController();
    MyTestUser user = new MyTestUser();
    user.setName("dungtv1");
    user.addSession(session);
    EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
    request.deserializeParams(data);
    request.setUser(user);
    request.setSession(session);
    EzyServerContext ctx = newServerContext();
    controller.handle(ctx, request);
}
Also used : EzyRequestAppController(com.tvd12.ezyfoxserver.controller.EzyRequestAppController) MyTestUser(com.tvd12.ezyfoxserver.testing.MyTestUser) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyArray(com.tvd12.ezyfox.entity.EzyArray) EzySimpleRequestAppRequest(com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest) Test(org.testng.annotations.Test) BaseCoreContextTest(com.tvd12.ezyfoxserver.testing.BaseCoreContextTest)

Example 2 with EzySimpleRequestAppRequest

use of com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest in project ezyfox-server by youngmonkeys.

the class EzyRequestAppControllerTest method test.

@Test
public void test() {
    EzyArray data = EzyEntityArrays.newArray(1, EzyEntityArrays.newArray());
    EzyRequestAppController controller = new EzyRequestAppController();
    EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
    request.deserializeParams(data);
    request.setUser(user);
    request.setSession(session);
    EzyServerContext ctx = newServerContext();
    controller.handle(ctx, request);
}
Also used : EzyRequestAppController(com.tvd12.ezyfoxserver.controller.EzyRequestAppController) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyArray(com.tvd12.ezyfox.entity.EzyArray) EzySimpleRequestAppRequest(com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest) Test(org.testng.annotations.Test) BaseCoreContextTest(com.tvd12.ezyfoxserver.testing.BaseCoreContextTest)

Example 3 with EzySimpleRequestAppRequest

use of com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest in project ezyfox-server by youngmonkeys.

the class EzySimpleRequestPluginRequestTest method test.

@Test
public void test() {
    EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
    request.deserializeParams(EzyEntityFactory.newArrayBuilder().append(1).append(EzyEntityFactory.newArrayBuilder()).build());
    request.release();
}
Also used : EzySimpleRequestAppRequest(com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Example 4 with EzySimpleRequestAppRequest

use of com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest in project ezyfox-server by youngmonkeys.

the class EzyServerUserInterceptorTest method test.

@Test(expectedExceptions = { EzyNotAuthorizedException.class })
public void test() throws Exception {
    EzyServerContext context = newServerContext();
    EzyServerUserInterceptor interceptor = new EzyServerUserInterceptor();
    EzyRequestAppRequest request = new EzySimpleRequestAppRequest();
    interceptor.intercept(context, request);
}
Also used : EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzySimpleRequestAppRequest(com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest) EzyRequestAppRequest(com.tvd12.ezyfoxserver.request.EzyRequestAppRequest) EzyServerUserInterceptor(com.tvd12.ezyfoxserver.interceptor.EzyServerUserInterceptor) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Example 5 with EzySimpleRequestAppRequest

use of com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest in project ezyfox-server by youngmonkeys.

the class EzyServerUserInterceptorTest method test1.

@Test
public void test1() throws Exception {
    EzyServerContext context = newServerContext();
    EzyServerUserInterceptor interceptor = new EzyServerUserInterceptor();
    EzySimpleRequestAppRequest request = new EzySimpleRequestAppRequest();
    request.setUser(new MyTestUser());
    interceptor.intercept(context, request);
}
Also used : EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) MyTestUser(com.tvd12.ezyfoxserver.testing.MyTestUser) EzySimpleRequestAppRequest(com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest) EzyServerUserInterceptor(com.tvd12.ezyfoxserver.interceptor.EzyServerUserInterceptor) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Aggregations

EzySimpleRequestAppRequest (com.tvd12.ezyfoxserver.request.EzySimpleRequestAppRequest)5 Test (org.testng.annotations.Test)5 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)4 BaseCoreTest (com.tvd12.ezyfoxserver.testing.BaseCoreTest)3 EzyArray (com.tvd12.ezyfox.entity.EzyArray)2 EzyRequestAppController (com.tvd12.ezyfoxserver.controller.EzyRequestAppController)2 EzyServerUserInterceptor (com.tvd12.ezyfoxserver.interceptor.EzyServerUserInterceptor)2 BaseCoreContextTest (com.tvd12.ezyfoxserver.testing.BaseCoreContextTest)2 MyTestUser (com.tvd12.ezyfoxserver.testing.MyTestUser)2 EzyRequestAppRequest (com.tvd12.ezyfoxserver.request.EzyRequestAppRequest)1