Class Deployments

java.lang.Object
org.wildfly.testing.tools.deployment.Deployments

public class Deployments extends Object
Utility class for creating ShrinkWrap archives with conventional naming.

This is particularly useful when building complex deployments like EARs that contain multiple modules:

 @GenerateDeployment(DeploymentType.EAR)
 public static void deployment(EnterpriseArchive ear) {
     ear.addAsModule(Deployments.war("myapp")
             .addClasses(MyServlet.class));
     ear.addAsLibrary(Deployments.jar("mylib")
             .addClasses(MyLibrary.class));
 }
 
Author:
James R. Perkins
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.jboss.shrinkwrap.api.spec.JavaArchive
    jar(Class<?> testClass)
    Creates a JavaArchive using the test class simple name and .jar extension.
    static org.jboss.shrinkwrap.api.spec.JavaArchive
    jar(String name)
    Creates a JavaArchive with the specified name and .jar extension.
    static org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive
    rar(Class<?> testClass)
    Creates a ResourceAdapterArchive using the test class simple name and .rar extension.
    static org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive
    rar(String name)
    Creates a ResourceAdapterArchive with the specified name and .rar extension.
    static org.jboss.shrinkwrap.api.spec.WebArchive
    war(Class<?> testClass)
    Creates a WebArchive using the test class simple name and .war extension.
    static org.jboss.shrinkwrap.api.spec.WebArchive
    war(String name)
    Creates a WebArchive with the specified name and .war extension.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • war

      public static org.jboss.shrinkwrap.api.spec.WebArchive war(String name)
      Creates a WebArchive with the specified name and .war extension.
      Parameters:
      name - the name of the archive (without extension)
      Returns:
      a new WebArchive
    • war

      public static org.jboss.shrinkwrap.api.spec.WebArchive war(Class<?> testClass)
      Creates a WebArchive using the test class simple name and .war extension.
      Parameters:
      testClass - the test class to derive the name from
      Returns:
      a new WebArchive
    • jar

      public static org.jboss.shrinkwrap.api.spec.JavaArchive jar(String name)
      Creates a JavaArchive with the specified name and .jar extension.
      Parameters:
      name - the name of the archive (without extension)
      Returns:
      a new JavaArchive
    • jar

      public static org.jboss.shrinkwrap.api.spec.JavaArchive jar(Class<?> testClass)
      Creates a JavaArchive using the test class simple name and .jar extension.
      Parameters:
      testClass - the test class to derive the name from
      Returns:
      a new JavaArchive
    • rar

      public static org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive rar(String name)
      Creates a ResourceAdapterArchive with the specified name and .rar extension.
      Parameters:
      name - the name of the archive (without extension)
      Returns:
      a new ResourceAdapterArchive
    • rar

      public static org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive rar(Class<?> testClass)
      Creates a ResourceAdapterArchive using the test class simple name and .rar extension.
      Parameters:
      testClass - the test class to derive the name from
      Returns:
      a new ResourceAdapterArchive