NettyTestContainer(URI baseUri, DeploymentContext deploymentContext) { this.baseUri = UriBuilder.fromUri(baseUri).path(deploymentContext.getContextPath()).build(); this.deploymentContext = deploymentContext; }
private SimpleTestContainer(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. Simple framework container only supports deployment on root path.", base.getRawPath())); } this.baseUri = base; if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating SimpleTestContainer configured at the base URI " + this.baseUri); } this.deploymentContext = context; }
private ExternalTestContainer(final URI baseUri, final DeploymentContext context) { final UriBuilder uriBuilder = UriBuilder.fromUri(baseUri).path(context.getContextPath()); if (context instanceof ServletDeploymentContext) { uriBuilder.path(((ServletDeploymentContext) context).getServletPath()); } this.baseUri = uriBuilder.build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating ExternalTestContainer configured at the base URI " + this.baseUri); } }
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 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 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); }
private ExternalTestContainer(final URI baseUri, final DeploymentContext context) { final UriBuilder uriBuilder = UriBuilder.fromUri(baseUri).path(context.getContextPath()); if (context instanceof ServletDeploymentContext) { uriBuilder.path(((ServletDeploymentContext) context).getServletPath()); } this.baseUri = uriBuilder.build(); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Creating ExternalTestContainer configured at the base URI " + this.baseUri); } }
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); }