@Test public void handler() throws Exception { try ( ApplicationFacade app = new ApplicationFacade(Application.fromBuilder(new Application.Builder().container("default", new Application.Builder.Container() .handler("http: ) { RequestHandler handler = app.getRequestHandlerById(MockHttpHandler.class.getName()); assertNotNull(handler); Request request = new Request("http: Response response = app.handleRequest(request); assertNotNull(response); assertEquals(response.getStatus(), 200); assertEquals(response.getBodyAsString(), "OK"); request = new Request("http: response = app.handleRequest(request); assertNotNull(response); assertEquals(response.getStatus(), 200); assertEquals(response.getBodyAsString(), "OK"); request = new Request("http: response = app.handleRequest(request); assertNotNull(response); assertEquals(response.getStatus(), 200); assertEquals(response.getBodyAsString(), "OK"); } }
@Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); @Beta static Application fromBuilder(Builder builder); static Application fromServicesXml(String xml, Networking networking); static Application fromApplicationPackage(Path path, Networking networking); static Application fromApplicationPackage(File file, Networking networking); JDisc getJDisc(String id); @Override void close(); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); @Beta static Application fromBuilder(Builder builder); static Application fromServicesXml(String xml, Networking networking); static Application fromApplicationPackage(Path path, Networking networking); static Application fromApplicationPackage(File file, Networking networking); JDisc getJDisc(String id); @Override void close(); static final String vespaLocalProperty; }