org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet.<init>()方法的一些代码示例,展示了Servlet.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Servlet.<init>()方法的具体详情如下:
包路径:org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet
类名称:Servlet
方法名:<init>

Servlet.<init>介绍

暂无

代码示例

代码示例来源:origin: arquillian/arquillian-core

@BeforeClass
public static void before() {
  servlet = new Servlet(TEST_SERVLET_NAME, TEST_CONTEXT_ROOT);
  servletWithParent = new Servlet(TEST_SERVLET_NAME, TEST_CONTEXT_ROOT);
  servletWithParent.setParent(TEST_HTTP_CONTEXT);
  rootContextServletWithParent = new Servlet(TEST_SERVLET_NAME, Servlet.ROOT_CONTEXT);
  rootContextServletWithParent.setParent(TEST_HTTP_CONTEXT);
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-spi

@BeforeClass
public static void before() {
  servlet = new Servlet(TEST_SERVLET_NAME, TEST_CONTEXT_ROOT);
  servletWithParent = new Servlet(TEST_SERVLET_NAME, TEST_CONTEXT_ROOT);
  servletWithParent.setParent(TEST_HTTP_CONTEXT);
  rootContextServletWithParent = new Servlet(TEST_SERVLET_NAME, Servlet.ROOT_CONTEXT);
  rootContextServletWithParent.setParent(TEST_HTTP_CONTEXT);
}

代码示例来源:origin: arquillian/arquillian-core

@Test(expected = IllegalArgumentException.class)
public void testServletForNullName() {
  new Servlet(null, TEST_CONTEXT_ROOT);
}

代码示例来源:origin: arquillian/arquillian-core

@Test(expected = IllegalArgumentException.class)
public void testServletForNullContextRoot() {
  new Servlet(TEST_SERVLET_NAME, null);
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-spi

@Test(expected = IllegalArgumentException.class)
public void testServletForNullContextRoot() {
  new Servlet(TEST_SERVLET_NAME, null);
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-spi

@Test(expected = IllegalArgumentException.class)
public void testServletForNullName() {
  new Servlet(null, TEST_CONTEXT_ROOT);
}

代码示例来源:origin: arquillian/arquillian-core

protected HTTPContext createContext() {
  URI baseURI = createBaseURL();
  HTTPContext context = new HTTPContext(baseURI.getHost(), baseURI.getPort());
  context.add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, baseURI.getPath()));
  return context;
}

代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet

protected HTTPContext createContext() {
  URI baseURI = createBaseURL();
  HTTPContext context = new HTTPContext(baseURI.getHost(), baseURI.getPort());
  context.add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, baseURI.getPath()));
  return context;
}

代码示例来源:origin: org.apache.tomee/arquillian-openejb-embedded

private static ProtocolMetaData newHttpProtocolMetaData(final ServerService ss, final String contextRoot) {
    final HTTPContext httpContext = new HTTPContext(ss.getIP(), ss.getPort());
    httpContext.add(new Servlet("ArquillianServletRunner", contextRoot));
    return new ProtocolMetaData().addContext(httpContext);
  }
}

代码示例来源:origin: arquillian/arquillian-core

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionOnUnKnownTargetInDeployment() throws Exception {
  execute(
    URLBaseContextClassQualifiedTargetedMissing.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-Y", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))),
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-X", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X"))));
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionOnUnKnownTargetInDeployment() throws Exception {
  execute(
    URLBaseContextClassQualifiedTargetedMissing.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-Y", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))),
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-X", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X"))));
}

代码示例来源:origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Test
public void shouldBeAbleToInjectServletContextURL() throws Exception {
  URLServletContextClass test = execute(
    URLServletContextClass.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test"))));
  Assert.assertEquals("http://TEST:8080/test/", test.url.toExternalForm());
}

代码示例来源:origin: arquillian/arquillian_deprecated

@Test
public void shouldFindTestServletInMetadata() throws Exception
{
 ServletProtocolConfiguration config = new ServletProtocolConfiguration();
 
 ServletMethodExecutor executor = protocol.getExecutor(
    config, 
    new ProtocolMetaData()
      .addContext(
         new HTTPContext("127.0.0.1", 8080)
          .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"))));
 
 Assert.assertEquals("http://127.0.0.1:8080/test", executor.getBaseURI().toString());
}

代码示例来源:origin: arquillian/arquillian-core

@Test
public void shouldBeAbleToInjectServletContextURL() throws Exception {
  URLServletContextClass test = execute(
    URLServletContextClass.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test"))));
  Assert.assertEquals("http://TEST:8080/test/", test.url.toExternalForm());
}

代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet

@Test
public void shouldMatchNamedTargetedContext() throws Exception {
  ServletProtocolConfiguration config = new ServletProtocolConfiguration();
  HTTPContext testContextOne = new HTTPContext("Y", "127.0.0.1", 8080)
    .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  HTTPContext testContextTwo = new HTTPContext("X", "127.0.0.1", 8081)
    .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  Method testMethod = getTestMethod("testTargeted");
  ServletURIHandler handler = new ServletURIHandler(config, to(testContextOne, testContextTwo));
  URI result = handler.locateTestServlet(testMethod);
  Assert.assertEquals("http://127.0.0.1:8081/test", result.toString());
}

代码示例来源:origin: apache/meecrowave

@Override
public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
  final File dump = toArchiveDump(archive);
  archive.as(ZipExporter.class).exportTo(dump, true);
  final String context = sanitizeName(archive);
  container.deployWebapp(context, dump);
  final int port = configuration.isSkipHttp() ? configuration.getHttpsPort() : configuration.getHttpPort();
  return new ProtocolMetaData()
      .addContext(new HTTPContext(configuration.getHost(), port)
          .add(new Servlet("arquillian", context)));
}

代码示例来源:origin: org.apache.meecrowave/meecrowave-arquillian

@Override
public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException {
  final File dump = toArchiveDump(archive);
  archive.as(ZipExporter.class).exportTo(dump, true);
  final String context = sanitizeName(archive);
  container.deployWebapp(context, dump);
  final int port = configuration.isSkipHttp() ? configuration.getHttpsPort() : configuration.getHttpPort();
  return new ProtocolMetaData()
      .addContext(new HTTPContext(configuration.getHost(), port)
          .add(new Servlet("arquillian", context)));
}

代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet

@Test
public void shouldFindTestServletInMetadata() throws Exception {
  ServletProtocolConfiguration config = new ServletProtocolConfiguration();
  HTTPContext testContext = new HTTPContext("127.0.0.1", 8080)
    .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  Method testMethod = getTestMethod("testNoAnnotations");
  ServletURIHandler handler = new ServletURIHandler(config, to(testContext));
  URI result = handler.locateTestServlet(testMethod);
  Assert.assertEquals("http://127.0.0.1:8080/test", result.toString());
}

代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionOnMissingNamedTargetedContext() throws Exception {
  ServletProtocolConfiguration config = new ServletProtocolConfiguration();
  HTTPContext testContextOne = new HTTPContext("Y", "127.0.0.1", 8080)
    .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  Method testMethod = getTestMethod("testTargeted");
  ServletURIHandler handler = new ServletURIHandler(config, to(testContextOne));
  handler.locateTestServlet(testMethod);
}

代码示例来源:origin: org.jboss.arquillian.protocol/arquillian-protocol-servlet

@Test
public void shouldOverrideMetadata() throws Exception {
  ServletProtocolConfiguration config = new ServletProtocolConfiguration();
  config.setScheme("https");
  config.setHost("10.10.10.1");
  config.setPort(90);
  HTTPContext testContext = new HTTPContext("127.0.0.1", 8080)
    .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  Method testMethod = getTestMethod("testNoAnnotations");
  ServletURIHandler handler = new ServletURIHandler(config, to(testContext));
  URI result = handler.locateTestServlet(testMethod);
  Assert.assertEquals("https://10.10.10.1:90/test", result.toString());
}

相关文章

微信公众号

最新文章

更多