/** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString() { return this.getClass().getSimpleName() + " with mounted archive: " + archive.toString(); }
/** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString() { return this.getClass().getSimpleName() + " for: " + archive.toString(); }
/** * {@inheritDoc} * @see java.lang.Object#toString() */ @Override public String toString() { return this.getClass().getSimpleName() + " [archive=" + createdFrom.toString(true) + "]"; }
/** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString() { return this.getArchive().toString(); }
protected ZipExporterDelegate(final Archive<?> archive) { super(archive); compressed = true; // Precondition check if (archive.getContent().isEmpty()) { throw new IllegalArgumentException( "[SHRINKWRAP-93] Cannot use this JDK-based implementation to export as ZIP an archive with no content: " + archive.toString()); } }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#toString(boolean) */ @Override public String toString(final boolean verbose) { return this.getArchive().toString(verbose); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#toString(org.jboss.shrinkwrap.api.formatter.Formatter) */ @Override public String toString(final Formatter formatter) throws IllegalArgumentException { return this.getArchive().toString(formatter); }
protected ZipExporterDelegate(final Archive<?> archive, final boolean compressed) { super(archive); this.compressed = compressed; // Precondition check if (archive.getContent().isEmpty()) { throw new IllegalArgumentException( "[SHRINKWRAP-93] Cannot use this JDK-based implementation to export as ZIP an archive with no content: " + archive.toString()); } }
protected ZipExporterDelegate(final Archive<?> archive) { super(archive); compressed = true; // Precondition check if (archive.getContent().isEmpty()) { throw new IllegalArgumentException( "[SHRINKWRAP-93] Cannot use this JDK-based implementation to export as ZIP an archive with no content: " + archive.toString()); } }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#toString(org.jboss.shrinkwrap.api.formatter.Formatter) */ @Override public String toString(final Formatter formatter) throws IllegalArgumentException { return this.getArchive().toString(formatter); }
private static void processClass(Class<?> clazz) throws Exception { for ( Method m : clazz.getMethods() ) { if ( m.isAnnotationPresent( Deployment.class ) ) { Object o = clazz.newInstance(); Archive<?> archive = (Archive<?>) m.invoke( o ); logger.fine( archive.toString( true ) ); archive.as( ZipExporter.class ).exportTo( new File( artifactDir, clazz.getName() + ".war" ), true ); } } }
@Override public void addArchive(String key, Archive<?> archive) { if(logger.isDebugEnabled()) logger.debug("Putting template {} archive {}", ansiString(GREEN, key), ansiString(GREEN, archive.toString()) ); repository.put(key, archive); }
protected Archive<?> resolve(String key) throws Exception { Archive<?> archive = repository.get(key); if(logger.isTraceEnabled()) logger.trace("Resolved template {} archive {}", ansiString(GREEN, key), ansiString(GREEN, archive == null? null : archive.toString()) ); return archive; }
private void verifyThatIsContainedInArchive(Archive<?> archive, Class<?> clazz) { String classPath = clazz.getName().replace(".", "/") + ".class"; Assert.assertTrue(String.format("archive %s should contain the path %s", archive.toString(true), classPath), archive.contains(classPath)); }
private void verifyThatIsContainedInArchive(Archive<?> archive, Class<?> clazz) { String classPath = clazz.getName().replace(".", "/") + ".class"; Assert.assertTrue(String.format("archive %s should contain the path %s", archive.toString(true), classPath), archive.contains(classPath)); }
/** * Simple printout of the tested archive. */ @After public void ls() { Archive<T> archive = getArchive(); System.out.println("test@jboss:/$ ls -l " + archive.getName()); System.out.println(archive.toString(true)); }
/** * Ensures that the {@link Formatter} is functioning as contracted given a test archive */ @Test public void testFormatter() { // Format final String formatted = archive.toString(getFormatter()); // Log out, just so we can see log.info(formatted); // Ensure expected form TestCase.assertEquals("Formatter output did not match that expected", this.getExpectedOutput(), formatted); }
/** * SHRINKWRAP-275 */ @Test @ArchiveType(ResourceContainer.class) public void testAddResourceStringTargetResourceFromJar() throws Exception { // Causing NPE getResourceContainer().addAsResource("java/lang/String.class", "String.class"); ArchivePath testPath = new BasicPath(getResourcePath(), "String.class"); Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath)); Logger.getAnonymousLogger().info(getArchive().toString(true)); }
@Test public void shouldGenerateDependencies() throws Exception { Archive<?> archive = new TestNGDeploymentAppender().createAuxiliaryArchive(); Assert.assertTrue( "Should have added TestRunner SPI", 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/testng/container/TestNGTestRunner.class"))); System.out.println(archive.toString(true)); } }
@Test public void shouldGenerateDependencies() throws Exception { Archive<?> archive = new TestNGDeploymentAppender().createAuxiliaryArchive(); Assert.assertTrue( "Should have added TestRunner SPI", archive.contains(ArchivePaths.create("/META-INF/services/org.jboss.arquillian.spi.TestRunner"))); Assert.assertTrue( "Should have added TestRunner Impl", archive.contains(ArchivePaths.create("/org/jboss/arquillian/testng/TestNGTestRunner.class"))); System.out.println(archive.toString(true)); } }