private InMemoryTestContainer(final URI baseUri, final DeploymentContext context) { this.baseUri = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating InMemoryTestContainer configured at the base URI " + this.baseUri); } this.appHandler = new ApplicationHandler(context.getResourceConfig()); }
private GrizzlyTestContainer(final URI baseUri, final DeploymentContext context) { this.baseUri = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating GrizzlyTestContainer configured at the base URI " + TestHelper.zeroPortToAvailablePort(baseUri)); } this.server = GrizzlyHttpServerFactory.createHttpServer(this.baseUri, context.getResourceConfig(), false); }
private JdkHttpServerTestContainer(final URI baseUri, final DeploymentContext context) { this.baseUri = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating JdkHttpServerTestContainer configured at the base URI " + TestHelper.zeroPortToAvailablePort(baseUri)); } this.server = JdkHttpServerFactory.createHttpServer(this.baseUri, context.getResourceConfig(), false); }
private JettyTestContainer(final URI baseUri, final DeploymentContext context) { final URI base = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (!"/".equals(base.getRawPath())) { throw new TestContainerException(String.format( "Cannot deploy on %s. Jetty HTTP container only supports deployment on root path.", base.getRawPath())); } this.baseUri = base; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating JettyTestContainer configured at the base URI " + TestHelper.zeroPortToAvailablePort(baseUri)); } this.server = JettyHttpContainerFactory.createServer(this.baseUri, context.getResourceConfig(), false); }
@Override public void start() { server = NettyHttpContainerProvider.createServer(getBaseUri(), deploymentContext.getResourceConfig(), false); }
@Override public void start() { LOGGER.log(Level.FINE, "Starting SimpleTestContainer..."); try { server = SimpleContainerFactory.create(baseUri, deploymentContext.getResourceConfig()); if (baseUri.getPort() == 0) { baseUri = UriBuilder.fromUri(baseUri) .port(server.getPort()) .build(); LOGGER.log(Level.INFO, "Started SimpleTestContainer at the base URI " + baseUri); } } catch (ProcessingException e) { throw new TestContainerException(e); } }
private GrizzlyTestContainer(final URI baseUri, final DeploymentContext context) { this.baseUri = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating GrizzlyTestContainer configured at the base URI " + TestHelper.zeroPortToAvailablePort(baseUri)); } this.server = GrizzlyHttpServerFactory.createHttpServer(this.baseUri, context.getResourceConfig(), false); }
private JettyTestContainer(final URI baseUri, final DeploymentContext context) { final URI base = UriBuilder.fromUri(baseUri).path(context.getContextPath()).build(); if (!"/".equals(base.getRawPath())) { throw new TestContainerException(String.format( "Cannot deploy on %s. Jetty HTTP container only supports deployment on root path.", base.getRawPath())); } this.baseUri = base; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating JettyTestContainer configured at the base URI " + TestHelper.zeroPortToAvailablePort(baseUri)); } this.server = JettyHttpContainerFactory.createServer(this.baseUri, context.getResourceConfig(), false); }