Search in sources :

Example 6 with HomeController

use of com.tvd12.ezyhttp.server.jetty.test.controller.HomeController in project ezyhttp by youngmonkeys.

the class ControllerProxyTest method test.

@Test
public void test() {
    ControllerProxy home = new ControllerProxy(new HomeController());
    System.out.println(home);
}
Also used : HomeController(com.tvd12.ezyhttp.server.jetty.test.controller.HomeController) ControllerProxy(com.tvd12.ezyhttp.server.core.reflect.ControllerProxy) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Example 7 with HomeController

use of com.tvd12.ezyhttp.server.jetty.test.controller.HomeController in project java-examples by tvd12.

the class PerformanceCompareTest method main.

public static void main(String[] args) {
    final EzyBeanContext beanContext = EzyBeanContext.builder().scan("com.tvd12.example.reactive").build();
    final HomeController sequenceHomeController = (HomeController) beanContext.getBean(HomeController.class);
    final RxHomeController rxHomeController = (RxHomeController) beanContext.getBean(RxHomeController.class);
    // warm up
    sequenceHomeController.getHomeData();
    rxHomeController.getHomeData();
    long sequenceCallElapsedTime = Performance.create().loop(100000).test(sequenceHomeController::getHomeData).getTime();
    long rxCallElapsedTime = Performance.create().loop(100000).test(rxHomeController::getHomeData).getTime();
    System.out.printf("sequence call elapsed time: %d\nreactive call elapsed time: %d\n", sequenceCallElapsedTime, rxCallElapsedTime);
    Reactive.destroy();
}
Also used : RxHomeController(com.tvd12.example.reactive.RxHomeController) EzyBeanContext(com.tvd12.ezyfox.bean.EzyBeanContext) RxHomeController(com.tvd12.example.reactive.RxHomeController) HomeController(com.tvd12.example.reactive.HomeController)

Aggregations

ControllerProxy (com.tvd12.ezyhttp.server.core.reflect.ControllerProxy)6 BaseTest (com.tvd12.test.base.BaseTest)6 Test (org.testng.annotations.Test)6 RequestHandlerImplementer (com.tvd12.ezyhttp.server.core.asm.RequestHandlerImplementer)3 RequestHandlerMethod (com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod)3 HomeController (com.tvd12.ezyhttp.server.boot.test.controller.HomeController)2 HomeController (com.tvd12.ezyhttp.server.core.test.controller.HomeController)2 HomeController (com.tvd12.ezyhttp.server.jetty.test.controller.HomeController)2 HomeController (com.tvd12.example.reactive.HomeController)1 RxHomeController (com.tvd12.example.reactive.RxHomeController)1 EzyBeanContext (com.tvd12.ezyfox.bean.EzyBeanContext)1 ExceptionHandlerMethod (com.tvd12.ezyhttp.server.core.reflect.ExceptionHandlerMethod)1