use of org.springframework.http.server.reactive.bootstrap.UndertowHttpServer in project spring-framework by spring-projects.
the class ZeroCopyIntegrationTests method zeroCopy.
@Test
public void zeroCopy() throws Exception {
// Zero-copy only does not support servlet
assumeTrue(server instanceof ReactorHttpServer || server instanceof UndertowHttpServer);
RestTemplate restTemplate = new RestTemplate();
RequestEntity<?> request = RequestEntity.get(new URI("http://localhost:" + port)).build();
ResponseEntity<byte[]> response = restTemplate.exchange(request, byte[].class);
Resource logo = new ClassPathResource("spring.png", ZeroCopyIntegrationTests.class);
assertTrue(response.hasBody());
assertEquals(logo.contentLength(), response.getHeaders().getContentLength());
assertEquals(logo.contentLength(), response.getBody().length);
assertEquals(MediaType.IMAGE_PNG, response.getHeaders().getContentType());
}
use of org.springframework.http.server.reactive.bootstrap.UndertowHttpServer in project spring-framework by spring-projects.
the class AbstractWebSocketIntegrationTests method arguments.
@Parameters(name = "client[{0}] - server [{1}]")
public static Object[][] arguments() throws IOException {
Flux<? extends WebSocketClient> clients = Flux.concat(Flux.just(new StandardWebSocketClient()).repeat(5), Flux.just(new JettyWebSocketClient()).repeat(5), Flux.just(new ReactorNettyWebSocketClient()).repeat(5), Flux.just(new RxNettyWebSocketClient()).repeat(5), Flux.just(new UndertowWebSocketClient(Xnio.getInstance().createWorker(OptionMap.EMPTY))).repeat(5));
Flux<? extends HttpServer> servers = Flux.just(new TomcatHttpServer(TMP_DIR.getAbsolutePath(), WsContextListener.class), new JettyHttpServer(), new ReactorHttpServer(), new RxNettyHttpServer(), new UndertowHttpServer()).repeat(5);
Flux<? extends Class<?>> configs = Flux.just(TomcatConfig.class, JettyConfig.class, ReactorNettyConfig.class, RxNettyConfig.class, UndertowConfig.class).repeat(5);
return Flux.zip(clients, servers, configs).map(Tuple3::toArray).collectList().block().toArray(new Object[25][2]);
}
Aggregations