org.jboss.shrinkwrap.api.Archive.contains()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(107)

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

Archive.contains介绍

[英]Denotes whether this archive contains a resource at the specified path
[中]表示此存档文件是否包含位于指定路径的资源

代码示例

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

@Test
  public void shouldGenerateDependencies() throws Exception {
    Archive<?> archive = new JUnitDeploymentAppender().createAuxiliaryArchive();

    Assert.assertTrue(
      "Should have added Extension",
      archive.contains(
        ArchivePaths.create("/META-INF/services/org.jboss.arquillian.container.test.spi.TestRunner")));

    Assert.assertTrue(
      "Should have added TestRunner Impl",
      archive.contains(ArchivePaths.create("/org/jboss/arquillian/junit/container/JUnitTestRunner.class")));
  }
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationResourcePackages() throws Exception {
  getEnterpriseContainer().addAsApplicationResources(AssetUtil.class.getPackage(), "Test.properties",
    "Test2.properties");
  ArchivePath testPath = new BasicPath(getApplicationPath(), NAME_TEST_PROPERTIES);
  ArchivePath testPath2 = new BasicPath(getApplicationPath(), NAME_TEST_PROPERTIES_2);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
  Assert.assertTrue("Archive should contain " + testPath2, getArchive().contains(testPath2));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebInfResourcePackages() throws Exception {
  getWebContainer().addAsWebInfResources(AssetUtil.class.getPackage(), "Test.properties", "Test2.properties");
  ArchivePath testPath = new BasicPath(getWebInfPath(), NAME_TEST_PROPERTIES);
  ArchivePath testPath2 = new BasicPath(getWebInfPath(), NAME_TEST_PROPERTIES_2);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
  Assert.assertTrue("Archive should contain " + testPath2, getArchive().contains(testPath2));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePackages() throws Exception {
  getWebContainer().addAsWebResources(AssetUtil.class.getPackage(), "Test.properties", "Test2.properties");
  ArchivePath testPath = new BasicPath(getWebPath(), NAME_TEST_PROPERTIES);
  ArchivePath testPath2 = new BasicPath(getWebPath(), NAME_TEST_PROPERTIES_2);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
  Assert.assertTrue("Archive should contain " + testPath2, getArchive().contains(testPath2));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibrariesResource() throws Exception {
  getLibraryContainer().addAsLibraries(NAME_TEST_PROPERTIES, NAME_TEST_PROPERTIES_2);
  ArchivePath testPath = new BasicPath(getLibraryPath(), NAME_TEST_PROPERTIES);
  ArchivePath testPath2 = new BasicPath(getLibraryPath(), NAME_TEST_PROPERTIES_2);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
  Assert.assertTrue("Archive should contain " + testPath2, getArchive().contains(testPath2));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePackage() throws Exception {
  getWebContainer().addAsWebResource(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getWebPath(), NAME_TEST_PROPERTIES);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testSetWebXMLResourceInPackage() throws Exception {
  getWebContainer().setWebXML(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getWebInfPath(), "web.xml");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebInfResourcePackageStringTarget() throws Exception {
  getWebContainer().addAsWebInfResource(AssetUtil.class.getPackage(), "Test.properties", "Test.txt");
  ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ManifestContainer.class)
public void testSetManifestResourceInPackage() throws Exception {
  getManifestContainer().setManifest(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getManifestPath(), MANIFEST_FILE);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPackage() throws Exception {
  getManifestContainer().addAsManifestResource(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getManifestPath(), NAME_TEST_PROPERTIES);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePackage() throws Exception {
  getResourceContainer().addAsResource(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getResourcePath(), NAME_TEST_PROPERTIES);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationResourcePackageStringTarget() throws Exception {
  getEnterpriseContainer().addAsApplicationResource(AssetUtil.class.getPackage(), "Test.properties", "Test.txt");
  ArchivePath testPath = new BasicPath(getApplicationPath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddModulePathTargetResource() throws Exception {
  getEnterpriseContainer().addAsModule(NAME_TEST_PROPERTIES, new BasicPath("Test.properties"));
  ArchivePath expectedPath = new BasicPath(getModulePath(), "Test.properties");
  Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ResourceAdapterContainer.class)
public void testSetResourceAdapterXMLResourceInPackage() throws Exception {
  getResourceAdapterContainer().setResourceAdapterXML(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getResourceAdapterPath(), "ra.xml");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePathTargetResource() throws Exception {
  getWebContainer().addAsWebResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
  ArchivePath testPath = new BasicPath(getWebPath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebInfResourcePathTargetResource() throws Exception {
  getWebContainer().addAsWebInfResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
  ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(WebContainer.class)
public void testAddWebInfResourcePackage() throws Exception {
  getWebContainer().addAsWebInfResource(AssetUtil.class.getPackage(), "Test.properties");
  ArchivePath testPath = new BasicPath(getWebInfPath(), NAME_TEST_PROPERTIES);
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePackageStringTarget() throws Exception {
  getResourceContainer().addAsResource(AssetUtil.class.getPackage(), "Test.properties", "Test.txt");
  ArchivePath testPath = new BasicPath(getResourcePath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPathTargetResource() throws Exception {
  getManifestContainer().addAsManifestResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
  ArchivePath testPath = new BasicPath(getManifestPath(), "Test.txt");
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
@ArchiveType(ManifestContainer.class)
public void testAddServiceProvider() throws Exception {
  getManifestContainer().addAsServiceProvider(DummyInterfaceForTest.class, DummyClassForTest.class);
  ArchivePath testPath = new BasicPath(getManifestPath(), "services/" + DummyInterfaceForTest.class.getName());
  Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}

相关文章