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

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

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

Archive.toString介绍

[英]Acts as a shorthand for Archive#toString(Formatter) where the Formatters#SIMPLE is leveraged.
[中]作为归档文件toString(格式化程序)的简写,其中格式化程序SIMPLE被利用。

代码示例

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-nio2

/**
 * {@inheritDoc}
 *
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
  return this.getClass().getSimpleName() + " with mounted archive: " + archive.toString();
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-nio2

/**
 * {@inheritDoc}
 *
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
  return this.getClass().getSimpleName() + " for: " + archive.toString();
}

代码示例来源:origin: org.jboss.embedded/jboss-embedded-core

/**
* {@inheritDoc}
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
 return this.getClass().getSimpleName() + " [archive=" + createdFrom.toString(true) + "]";
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * {@inheritDoc}
 *
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
  return this.getArchive().toString();
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

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());
  }
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * {@inheritDoc}
 *
 * @see org.jboss.shrinkwrap.api.Archive#toString(boolean)
 */
@Override
public String toString(final boolean verbose) {
  return this.getArchive().toString(verbose);
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

/**
 * {@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);
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

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());
  }
}

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

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());
  }
}

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

/**
 * {@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);
}

代码示例来源:origin: org.hibernate.beanvalidation.tck/beanvalidation-tck-tests

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 );
    }
  }
}

代码示例来源:origin: org.agiso.tempel/tempel-support-test

@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);
}

代码示例来源:origin: org.agiso.tempel/tempel-support-test

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;
}

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

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));
}

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

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));
}

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

/**
 * 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));
}

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

/**
 * 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);
}

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

/**
 * 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));
}

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

@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));
  }
}

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

@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));      

  }
}

相关文章