com.google.appengine.tck.base.TestContext.setAppEngineWebXmlFile()方法的使用及代码示例

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

本文整理了Java中com.google.appengine.tck.base.TestContext.setAppEngineWebXmlFile()方法的一些代码示例,展示了TestContext.setAppEngineWebXmlFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TestContext.setAppEngineWebXmlFile()方法的具体详情如下:
包路径:com.google.appengine.tck.base.TestContext
类名称:TestContext
方法名:setAppEngineWebXmlFile

TestContext.setAppEngineWebXmlFile介绍

暂无

代码示例

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  return getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-system-properties.xml"));
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  return getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-env-variables.xml"));
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static WebArchive getBaseDeployment(boolean enabled) {
  System.setProperty("appengine.warmup.enabled", Boolean.toString(enabled));
  try {
    TestContext context = new TestContext();
    context.setWebXmlFile("web-warmup.xml");
    context.setAppEngineWebXmlFile("appengine-web-warmup.xml");
    WebArchive war = getTckDeployment(context);
    war.addClass(AbstractWarmupTestBase.class);
    war.addClass(WarmupServlet.class);
    war.addClass(WarmupData.class);
    return war;
  } finally {
    System.clearProperty("appengine.warmup.enabled");
  }
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static Archive getDeploymentWithLoggingLevelSetTo(Level level) {
  TestContext context = newTestContext().setAppEngineWebXmlFile("appengine-web-with-logging-properties.xml");
  WebArchive war = getDefaultDeployment(context);
  war.addClass(LoggingConfigurationTestBase.class);
  war.addAsWebInfResource(new StringAsset(".level=" + level.getName()), "logging.properties");
  return war;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static WebArchive getBaseDeployment(boolean enabled) {
  System.setProperty("appengine.sessions.enabled", Boolean.toString(enabled));
  try {
    TestContext context = new TestContext();
    context.setWebXmlFile("web-sessions.xml");
    context.setAppEngineWebXmlFile("appengine-web-sessions.xml");
    WebArchive war = getTckDeployment(context);
    war.addClass(AbstractHttpSessionTestBase.class);
    war.addClass(RequestFilter.class);
    war.addClass(SessionServlet.class);
    war.addClass(Client.class);
    return war;
  } finally {
    System.clearProperty("appengine.sessions.enabled");
  }
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static WebArchive getBytemanDeployment() {
    TestContext context = new TestContext();
    context.setWebXmlFile("bm-web.xml");
    context.setAppEngineWebXmlFile("bm-appengine-web.xml");

    WebArchive war = getTckDeployment(context);
    war.addClass(BytemanTestBase.class);
    war.addClasses(ConcurrentTxServlet.class, Poke.class);
    return war;
  }
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-admin-staticfiles.xml")
  .setWebXmlFile("web-security-constraint.xml"));
  createFile(archive, "/admin/index.html");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-public-root-static-files.xml"));
  createFile(archive, "/static/foo.txt");
  createFile(archive, "/static/subdir/foo.txt");
  createFile(archive, "/bar.txt");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  // -Dtck.sql.connection=//my_project:test_instance
  // -Dtck.sql.user
  // -Dtck.sql.pw
  TestContext context = new TestContext().setUseSystemProperties(true).setCompatibilityProperties(TCK_PROPERTIES);
  // Declares usage of com.mysql.jdbc.GoogleDriver
  context.setAppEngineWebXmlFile("sql-appengine-web.xml");
  WebArchive war = getTckDeployment(context);
  war.addClasses(CloudSqlTestBase.class, SqlUtil.class);
  return war;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-headers-static-files.xml"));
  createFile(archive, "/with-header/foo.txt");
  createFile(archive, "/with-expiration/foo.txt");
  createFile(archive, "/with-default-expiration/foo.txt");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static WebArchive getDefaultDeployment() {
    TestContext context = new TestContext().setUseSystemProperties(true).setCompatibilityProperties(TCK_PROPERTIES);

    context.setWebXmlFile("xmpp-web.xml");
    context.setAppEngineWebXmlFile("xmpp-appengine-web.xml");

    WebArchive war = getTckDeployment(context);
    war.addClasses(XmppTestBase.class, XmppMessageServlet.class);
    return war;
  }
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
  public static WebArchive getDeployment() {
    TestContext context = new TestContext();
    context.setAppEngineWebXmlFile("channel-appengine-web.xml");
    context.setWebXmlFile("channel-web.xml");

    WebArchive war = getTckDeployment(context);
    war.addClasses(ChannelTestBase.class, PresenceServlet.class);

    war.addAsWebResource("channelPage.jsp");
    war.addAsWebResource("channelEcho.jsp");

    return war;
  }
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-nostaticfiles.xml"));
  createFile(archive, "/foo.html");
  createFile(archive, "/foo/bar.html");
  createFile(archive, "/excluded/bar.html");
  createFile(archive, "/foo/bar.excluded.html");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setWebXmlFile("web-overlapping-servlets-and-static-files.xml")
    .setAppEngineWebXmlFile("appengine-web-staticfiles.xml"))
    .addClass(FooServlet.class);
  createFile(archive, "/fooservlet/static/foo.html");
  createFile(archive, "/fooservlet/nonstatic/foo.html");
  createFile(archive, "/noservlet/static/foo.html");
  createFile(archive, "/noservlet/nonstatic/foo.html");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-extension-based-static-files.xml"));
  createFile(archive, "/foo.csv");
  createFile(archive, "/foo.txt");
  createFile(archive, "/foo/bar.txt");
  createFile(archive, "/foo.html");
  createFile(archive, "/foo/bar.html");
  createFile(archive, "/excluded_shallow/bar.html");
  createFile(archive, "/excluded_shallow/subdir/bar.html");
  createFile(archive, "/excluded_deep/bar.html");
  createFile(archive, "/excluded_deep/subdir/bar.html");
  return archive;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

protected static WebArchive getDefaultDeployment(TestContext context) {
  context.setAppEngineWebXmlFile("appengine-web-with-logging-properties.xml");
  WebArchive war = getTckDeployment(context);
  war.addClasses(LoggingTestBase.class, TestBase.class)
    // classes for Base64.isBase64()
    .addClasses(Base64.class, BaseNCodec.class)
    .addClasses(BinaryEncoder.class, Encoder.class)
    .addClasses(BinaryDecoder.class, Decoder.class)
    .addClasses(EncoderException.class, DecoderException.class)
    .addAsWebInfResource("currentTimeUsec.jsp")
    .addAsWebInfResource("doNothing.jsp")
    .addAsWebInfResource("storeTestData.jsp")
    .addAsWebInfResource("throwException.jsp")
    .addAsWebInfResource("log4j-test.properties")
    .addAsWebInfResource("logging-all.properties");
  return war;
}

代码示例来源:origin: GoogleCloudPlatform/appengine-tck

@Deployment
public static WebArchive getDeployment() {
  WebArchive archive = getTckDeployment(new TestContext()
    .setAppEngineWebXmlFile("appengine-web-path-based-static-files.xml"));
  createFile(archive, "/foo/bar.txt");
  createFile(archive, "/included_shallow/foo.txt");
  createFile(archive, "/included_shallow/subdir/foo.txt");
  createFile(archive, "/included_shallow/subdir/subsubdir/foo.txt");
  createFile(archive, "/included_deep/foo.txt");
  createFile(archive, "/included_deep/subdir/foo.txt");
  createFile(archive, "/included_deep/subdir/subsubdir/foo.txt");
  createFile(archive, "/included_deep/not_excluded/foo.txt");
  createFile(archive, "/included_deep/excluded_shallow/foo.txt");
  createFile(archive, "/included_deep/excluded_shallow/subdir/foo.txt");
  return archive;
}

相关文章