@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)); }
@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)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourcePackagePathTarget() throws Exception { ArchivePath targetPath = ArchivePaths.create("Test.txt"); getWebContainer().addAsWebInfResource(AssetUtil.class.getPackage(), "Test.properties", targetPath); ArchivePath testPath = new BasicPath(getWebInfPath(), targetPath); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
/** * SHRINKWRAP-275 */ @Test @ArchiveType(WebContainer.class) public void testAddWebInfStringTargetResourceFromJar() throws Exception { // Causing NPE getWebContainer().addAsWebInfResource("java/lang/String.class", "String.class"); ArchivePath testPath = new BasicPath(getWebInfPath(), "String.class"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceResource() throws Exception { getWebContainer().addAsWebInfResource(NAME_TEST_PROPERTIES); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.properties"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceStringTargetResource() throws Exception { getWebContainer().addAsWebInfResource(NAME_TEST_PROPERTIES, "Test.txt"); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceFile() throws Exception { getWebContainer().addAsWebInfResource(getFileForClassResource(NAME_TEST_PROPERTIES)); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.properties"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceStringTargetAsset() throws Exception { getWebContainer().addAsWebInfResource(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt"); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@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)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceStringTargetFile() throws Exception { getWebContainer().addAsWebInfResource(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt"); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceStringTargetURL() throws Exception { getWebContainer().addAsWebInfResource(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt"); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourcePathTargetURL() throws Exception { getWebContainer().addAsWebInfResource(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt")); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourceURL() throws Exception { ArchivePath targetPath = new BasicPath("Test.properties"); getWebContainer().addAsWebInfResource(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath); ArchivePath testPath = new BasicPath(getWebInfPath(), targetPath); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourcePathTargetFile() throws Exception { getWebContainer().addAsWebInfResource(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt")); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }
@Test @ArchiveType(WebContainer.class) public void testAddWebInfResourcePathTargetAsset() throws Exception { getWebContainer() .addAsWebInfResource(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt")); ArchivePath testPath = new BasicPath(getWebInfPath(), "Test.txt"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); }