@Deployment
  public static Archive<?> getDeployment() throws Exception {
    doSetup();

    WebArchive war =
        ShrinkWrap.create(WebArchive.class, "test.war")
            .addClasses(
                WeldBundledLibraryDeploymentEarTestCase.class,
                AbstractBundledLibraryDeploymentTestCase.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    JavaArchive library =
        ShrinkWrap.create(JavaArchive.class, "library.jar")
            .addClasses(InjectedBean.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    JavaArchive ejbJar =
        ShrinkWrap.create(JavaArchive.class, "ejb-archive.jar")
            .addClasses(InjectedSessionBean.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    ear.addAsModule(ejbJar);
    ear.addAsLibrary(library);
    ear.setManifest(
        new StringAsset("Extension-List: weld1\nweld1-Extension-Name: " + EXTENSION_NAME + "\n"));
    return ear;
  }
  @Before
  public void setupDomain() throws Exception {

    // Create our deployments
    webArchive = ShrinkWrap.create(WebArchive.class, TEST);
    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
    URL index = tccl.getResource("helloWorld/index.html");
    webArchive.addAsWebResource(index, "index.html");

    webArchive2 = ShrinkWrap.create(WebArchive.class, TEST);
    index = tccl.getResource("helloWorld/index.html");
    webArchive2.addAsWebResource(index, "index.html");
    index = tccl.getResource("helloWorld/index2.html");
    webArchive2.addAsWebResource(index, "index2.html");

    // Make versions on the filesystem for URL-based deploy and for unmanaged content testing
    tmpDir = new File("target/deployments/" + this.getClass().getSimpleName());
    new File(tmpDir, "archives").mkdirs();
    new File(tmpDir, "exploded").mkdirs();
    webArchive.as(ZipExporter.class).exportTo(new File(tmpDir, "archives/" + TEST), true);
    webArchive.as(ExplodedExporter.class).exportExploded(new File(tmpDir, "exploded"));

    // Make the jsf war to test that jsf works on the older slaves that did not have the jsf
    // subsystem
    jsfTestArchive = ShrinkWrap.create(WebArchive.class, "jsf-test.war");
    jsfTestArchive.addClass(Bean.class);
    jsfTestArchive.addAsWebResource("jsf-test/index.html");
    jsfTestArchive.addAsWebResource("jsf-test/home.xhtml");
    jsfTestArchive.addAsWebInfResource("jsf-test/WEB-INF/beans.xml");
    jsfTestArchive.addAsWebInfResource("jsf-test/WEB-INF/faces-config.xml");

    // Launch the domain
    testSupport = MixedDomainTestSuite.getSupport(this.getClass());
    confirmNoDeployments();
  }
 @Deployment
 public static Archive<?> createTestArchive() {
   Archive<?> ar =
       ShrinkWrap.create(WebArchive.class, "test.war")
           .addAsResource("template.text.render", "template.text.render")
           .addAsResource("template.html.render", "template.html.render")
           .addAsWebResource("seam-mail-logo.png")
           .addPackages(true, SeamRenderMailMessageTest.class.getPackage())
           // workaround for Weld EE embedded not properly reading Seam Solder jar
           .addAsLibrary(
               ShrinkWrap.create(ZipImporter.class, "seam-solder-3.0.0.Final.jar")
                   .importFrom(
                       MavenArtifactResolver.resolve(
                           "org.jboss.seam.solder:seam-solder:3.0.0.Final"))
                   .as(JavaArchive.class))
           .addAsLibrary(
               ShrinkWrap.create(ZipImporter.class, "seam-render-1.0.0.Alpha3.jar")
                   .importFrom(
                       MavenArtifactResolver.resolve(
                           "org.jboss.seam.render:seam-render:1.0.0.Alpha3"))
                   .as(JavaArchive.class))
           .addAsLibraries(
               MavenArtifactResolver.resolve("org.subethamail:subethasmtp:3.1.4"),
               MavenArtifactResolver.resolve("commons-lang:commons-lang:2.4"))
           .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
   return ar;
 }
  @Deployment
  public static Archive createDeployment() {
    final Package currentPackage = MissingMethodPermissionsTestCase.class.getPackage();

    final JavaArchive ejbJarOne =
        ShrinkWrap.create(JavaArchive.class, MODULE_ONE_NAME + ".jar")
            .addClasses(SecuredBeanOne.class)
            .addAsManifestResource(currentPackage, "one-jboss-ejb3.xml", "jboss-ejb3.xml");

    final JavaArchive ejbJarTwo =
        ShrinkWrap.create(JavaArchive.class, MODULE_TWO_NAME + ".jar")
            .addClass(SecuredBeanTwo.class)
            .addAsManifestResource(currentPackage, "two-jboss-ejb3.xml", "jboss-ejb3.xml");

    final JavaArchive ejbJarThree =
        ShrinkWrap.create(JavaArchive.class, MODULE_THREE_NAME + ".jar")
            .addClass(SecuredBeanThree.class);

    final JavaArchive libJar =
        ShrinkWrap.create(JavaArchive.class, "bean-interfaces.jar")
            .addClasses(
                SecurityTestRemoteView.class, Util.class, MissingMethodPermissionsTestCase.class);

    final EnterpriseArchive ear =
        ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear")
            .addAsModules(ejbJarOne, ejbJarTwo, ejbJarThree)
            .addAsLibrary(libJar)
            .addAsManifestResource(currentPackage, "permissions.xml", "permissions.xml");

    return ear;
  }
  @Deployment
  public static Archive<?> deploy() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class);
    earLib.addClasses(EarResourceListingTestCase.class, ResourceListingUtils.class);
    earLib.addAsManifestResource(EmptyAsset.INSTANCE, "emptyJarLibResource.properties");
    earLib.addAsManifestResource(EmptyAsset.INSTANCE, "properties/nestedJarLib.properties");
    ear.addAsLibraries(earLib);

    WebArchive war = ShrinkWrap.create(WebArchive.class, INNER_WAR_ARCHIVE_NAME);
    war.addClass(TestA.class);
    war.add(EmptyAsset.INSTANCE, "META-INF/example.txt");
    war.add(EmptyAsset.INSTANCE, "META-INF/properties/nested.properties");
    war.add(EmptyAsset.INSTANCE, "example2.txt");
    war.addAsResource(
        EarResourceListingTestCase.class.getPackage(), "TextFile1.txt", "TextFile1.txt");
    war.addAsWebInfResource(EarResourceListingTestCase.class.getPackage(), "web.xml", "web.xml");

    JavaArchive libJar = ShrinkWrap.create(JavaArchive.class, INNER_JAR_ARCHIVE_NAME);
    libJar.addClass(WebInfLibClass.class);

    war.addAsLibraries(libJar);
    ear.addAsModules(libJar, war);
    ear.addAsManifestResource(EmptyAsset.INSTANCE, "MANIFEST.MF");
    ear.addAsResource(EmptyAsset.INSTANCE, "emptyEarResource");
    ear.addAsManifestResource(
        EarResourceListingTestCase.class.getPackage(), "application.xml", "application.xml");

    return ear;
  }
  /**
   * Define the deployment
   *
   * @return The deployment archive
   */
  @Deployment(order = 1)
  public static ResourceAdapterArchive createDeployment() {
    String deploymentName = "ConnectorTestCase.rar";

    ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName);
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar");
    ja.addClasses(
        HelloWorldResourceAdapter.class,
        HelloWorldManagedConnectionFactory.class,
        HelloWorldManagedConnection.class,
        HelloWorldManagedConnectionMetaData.class,
        HelloWorldConnectionFactory.class,
        HelloWorldConnectionFactoryImpl.class,
        HelloWorldConnection.class,
        HelloWorldConnectionImpl.class);
    raa.addAsLibrary(ja);
    // Contains the deployment information
    raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml");

    String rootPath = System.getProperty("test.dir") + File.separator + ".." + File.separator;

    File root = new File(rootPath);
    for (File f : root.listFiles()) {
      if (f.getName().contains("HelloWorld")) raa.addAsLibrary(f);
    }

    return raa;
  }
  @Deployment
  public static WebArchive processArchive() {

    Asset pa2ProcessesXml =
        TestHelper.getStringAsAssetWithReplacements(
            PROCESSES_XML, new String[][] {new String[] {"PA_NAME", "PA2"}});

    Asset[] processAssets = TestHelper.generateProcessAssets(9);

    JavaArchive pa2 =
        ShrinkWrap.create(JavaArchive.class, "pa2.jar")
            .addAsResource(pa2ProcessesXml, "META-INF/processes.xml");

    WebArchive deployment =
        ShrinkWrap.create(WebArchive.class, "test.war")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsLibraries(DeploymentHelper.getEngineCdi())
            .addAsLibraries(pa2)
            .addAsResource(processAssets[0], "process0.bpmn")
            .addAsResource(processAssets[1], "directory/process1.bpmn")
            .addAsResource(processAssets[2], "alternateDirectory/process2.bpmn")
            .addClass(AbstractFoxPlatformIntegrationTest.class);

    TestContainer.addContainerSpecificResources(deployment);

    return deployment;
  }
Example #8
0
  @Deployment
  public static EnterpriseArchive criaDeployment() {

    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    adicionaDependenciasMaven(ear);

    JavaArchive jar =
        ShrinkWrap.create(JavaArchive.class, "test.jar")
            .addPackage(Entidade.class.getPackage())
            .addPackage(EntidadeServiceImpl.class.getPackage())
            .addPackage(ClienteTest.class.getPackage())
            .addPackage(Cliente.class.getPackage())
            .addPackage(Projeto.class.getPackage())
            .addPackage(Funcionario.class.getPackage())
            .addPackage(Departamento.class.getPackage())
            .addPackage(Endereco.class.getPackage())
            .addPackage(Dispositivo.class.getPackage())
            .addPackage(Vaga.class.getPackage())
            .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

    ear.addAsModule(jar);

    return ear;
  }
  /**
   * Define the deployment
   *
   * @return The deployment archive
   */
  @Deployment
  public static ResourceAdapterArchive createDeployment() throws Exception {
    setUp();

    String deploymentName = "as7_1452.rar";

    ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName);
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "as7_1452.jar");
    ja.addPackage("org.jboss.as.test.smoke.embedded.deployment.rar.configproperty")
        .addClasses(
            ConfigPropertyTestCase.class,
            AbstractMgmtTestBase.class,
            MgmtOperationException.class,
            XMLElementReader.class,
            XMLElementWriter.class);
    raa.addAsLibrary(ja);

    raa.addAsManifestResource("rar/" + deploymentName + "/META-INF/ra.xml", "ra.xml")
        .addAsManifestResource(
            new StringAsset(
                "Dependencies: org.jboss.as.controller-client,org.jboss.dmr,org.jboss.as.cli\n"),
            "MANIFEST.MF");
    ;

    return raa;
  }
  /** Deploy package classes with project-stage integration-test */
  @Deployment
  public static WebArchive deploy() {
    URL deltaSpikeConfig =
        ExcludeIntegrationTest.class
            .getClassLoader()
            .getResource("META-INF/apache-deltaspike.properties");

    URL testExtensionsFileUrl =
        ExcludeIntegrationTest.class
            .getClassLoader()
            .getResource("META-INF/services/test.javax.enterprise.inject.spi.Extension");

    JavaArchive testJar =
        ShrinkWrap.create(JavaArchive.class, "excludeIntegrationTest.jar")
            .addPackage("org.apache.deltaspike.test.core.api.exclude")
            .addPackage("org.apache.deltaspike.test.core.impl.activation")
            .addPackage("org.apache.deltaspike.test.category")
            .addPackage("org.apache.deltaspike.integration.core.api.exclude")
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

    return ShrinkWrap.create(WebArchive.class, "excludeIntegration.war")
        .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
        .addAsLibraries(testJar)
        .addAsResource(
            FileUtils.getFileForURL(deltaSpikeConfig.toString()),
            "META-INF/apache-deltaspike.properties")
        .addAsResource(
            FileUtils.getFileForURL(testExtensionsFileUrl.toString()),
            "META-INF/services/javax.enterprise.inject.spi.Extension")
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
  }
Example #11
0
  /**
   * Define the deployment
   *
   * @return The deployment archive
   */
  @Deployment
  public static ResourceAdapterArchive createDeployment() throws Exception {
    String deploymentName = "inflow.rar";

    ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName);
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "multiple.jar");
    ja.addPackage(PureInflowResourceAdapter.class.getPackage())
        .addClasses(
            InflowTestCase.class,
            MgmtOperationException.class,
            XMLElementReader.class,
            XMLElementWriter.class);
    ja.addPackage(AbstractMgmtTestBase.class.getPackage());
    raa.addAsLibrary(ja);

    raa.addAsManifestResource(InflowTestCase.class.getPackage(), "ra.xml", "ra.xml")
        .addAsManifestResource(
            InflowTestCase.class.getPackage(), "ironjacamar.xml", "ironjacamar.xml")
        .addAsManifestResource(
            new StringAsset(
                "Dependencies: org.jboss.as.controller-client,org.jboss.dmr,org.jboss.as.cli,javax.inject.api,org.jboss.as.connector\n"),
            "MANIFEST.MF");

    return raa;
  }
Example #12
0
  public static void main(String[] args) throws Exception {
    Swarm swarm = new Swarm();

    swarm.fraction(
        MessagingFraction.createDefaultFraction()
            .defaultServer(
                (s) -> {
                  s.enableClustering();
                  s.jmsTopic("my-topic");
                  s.jmsQueue("my-queue");
                }));

    // Start the container
    swarm.start();

    JAXRSArchive appDeployment = ShrinkWrap.create(JAXRSArchive.class);
    appDeployment.addResource(MyResource.class);

    // Deploy your app
    swarm.deploy(appDeployment);

    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.addClass(MyService.class);
    deployment.as(ServiceActivatorArchive.class).addServiceActivator(MyServiceActivator.class);

    // Deploy the services
    swarm.deploy(deployment);
  }
 @Deployment(name = SUB_WEBAPP_EAR, testable = false)
 public static Archive<?> getSimpleEar() {
   WebArchive war = ShrinkWrap.create(WebArchive.class, SUB_WEBAPP_WAR);
   war.addClasses(SimpleServlet.class);
   EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, SUB_WEBAPP_EAR);
   ear.addAsModule(war);
   return ear;
 }
 @Deployment
 public static EnterpriseArchive createDeployment() throws Exception {
   return ShrinkWrap.create(EnterpriseArchive.class)
       .addAsModule(
           ShrinkWrap.create(JavaArchive.class)
               .addClasses(NoInterfaceEJB.class, NameProvider.class)
               .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"));
 }
 @Deployment
 public static Archive<?> deploy() {
   return ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
       .addAsModule(
           ShrinkWrap.create(JavaArchive.class)
               .addPackage(EnterpriseBeanProxyTest.class.getPackage())
               .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
               .addClass(Utils.class));
 }
 @Deployment
 public static EnterpriseArchive createDeployment() {
   return ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
       .addAsModule(
           ShrinkWrap.create(JavaArchive.class, "test.jar")
               .addClass(MyEjb.class)
               .addClass(MyEjbLocal.class)
               .addClass(MyEjbRemote.class)
               .addClass(WebsphereIntegrationClientTestCase.class));
 }
  @Deployment
  public static EnterpriseArchive createDeployment() {

    return ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
        .addAsModule(
            ShrinkWrap.create(WebArchive.class, "test.war")
                .addClass(TestingServlet.class)
                .addAsWebResource(new File("src/main/webapp/index.html"))
                .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"));
  }
 @Deployment(name = MANAGED_BEAN_EAR, testable = false)
 public static Archive<?> getManagedBeanEar() {
   WebArchive war = ShrinkWrap.create(WebArchive.class, MANAGED_BEAN_WAR);
   war.addClasses(SimpleBeanServlet.class);
   JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MANAGED_BEAN_JAR);
   jar.addClasses(SimpleManagedBean.class);
   jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
   EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, MANAGED_BEAN_EAR);
   ear.addAsModules(jar, war);
   return ear;
 }
  /**
   * Creates an EJB deployment
   *
   * @return
   */
  @Deployment
  public static Archive<?> createDeployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear");

    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(EJBClientAPIUsageTestCase.class.getPackage());
    jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    ear.addAsModule(jar);

    return ear;
  }
  /**
   * Creates an EJB deployment
   *
   * @return
   */
  @Deployment
  public static Archive<?> createDeployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear");

    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(EJBClientAPIUsageTestCase.class.getPackage());
    jar.addClass(AnonymousCallbackHandler.class);

    ear.addAsModule(jar);

    return ear;
  }
 public static WebArchive create() {
   JavaArchive javaArchive =
       ShrinkWrap.create(JavaArchive.class)
           .addAsManifestResource("META-INF/pluto.tld", "pluto.tld")
           .addAsManifestResource("META-INF/web-fragment.xml", "web-fragment.xml");
   return ShrinkWrap.create(WebArchive.class, "integrationTest.war")
       .addAsWebInfResource("themes/pluto.jsp", "themes/pluto.jsp")
       .addAsWebInfResource("themes/portlet-skin.jsp", "themes/portlet-skin.jsp")
       .addAsWebInfResource("META-INF/pluto.tld", "tld/pluto.tld")
       .addAsWebInfResource("pluto-portal-driver-config.xml")
       .addAsLibrary(javaArchive);
 }
 @Deployment
 public static EnterpriseArchive createEarDeployment() {
   return ShrinkWrap.create(EnterpriseArchive.class, "camel-ejb-ear.ear")
       .addAsModule(
           ShrinkWrap.create(JavaArchive.class, "camel-ejb-jar.jar")
               .addAsManifestResource(
                   new StringAsset("Dependencies: org.apache.camel services export"),
                   "MANIFEST.MF")
               .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
               .addPackage(Bootstrap.class.getPackage())
               .addPackage(CdiEarWithModularizedDependenciesTest.class.getPackage()));
 }
  public CoreDeployment withWholeCore() {
    JavaArchive coreArchive = ShrinkWrap.create(JavaArchive.class, "dynamic-richfaces-core.jar");
    coreArchive.merge(
        ShrinkWrap.create(GenericArchive.class)
            .as(ExplodedImporter.class)
            .importDirectory("target/classes/")
            .as(GenericArchive.class),
        "/",
        Filters.includeAll());
    archive().addAsLibrary(coreArchive);

    return this;
  }
  /**
   * Define the deployment
   *
   * @return The deployment archive
   */
  @Deployment
  public static ResourceAdapterArchive createDeployment() {
    ResourceAdapterArchive raa =
        ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".rar");

    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + ".jar");
    ja.addPackage(TestConnection.class.getPackage());

    raa.addAsLibrary(ja);
    raa.addAsManifestResource("simple.rar/META-INF/ra.xml", "ra.xml");

    return raa;
  }
  @Deployment
  public static Archive<?> createTestArchive() {
    // Our non-bean archive with an extension
    JavaArchive jar1 =
        ShrinkWrap.create(JavaArchive.class, "a.jar")
            .addClasses(BeanClassToRegister.class, ManualBeanRegistrationExtension.class)
            .addServiceProvider(Extension.class, ManualBeanRegistrationExtension.class);

    // Web archive is necessary so that Arquillian can find the BeanManager
    return ShrinkWrap.create(WebArchive.class, "test.war")
        .addWebResource(EmptyAsset.INSTANCE, "beans.xml")
        .addLibrary(jar1);
  }
  @Deployment
  public static EnterpriseArchive createDeployment() throws Exception {
    String applicationXml =
        Descriptors.create(ApplicationDescriptor.class, "application.xml")
            .ejbModule("test.jar")
            .exportAsString();

    return ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
        .addAsModule(
            ShrinkWrap.create(JavaArchive.class, "test.jar")
                .addClasses(JBossASIntegrationEarTestCase.class, MyEjb.class, MyEjbBean.class))
        .setApplicationXML(new StringAsset(applicationXml));
  }
  @Deployment
  public static WebArchive deploy() {
    JavaArchive testJar =
        ShrinkWrap.create(JavaArchive.class, "manualTransactionTest.jar")
            .addPackage(ArchiveUtils.SHARED_PACKAGE)
            .addPackage(ManualTransactionTest.class.getPackage().getName())
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

    return ShrinkWrap.create(WebArchive.class)
        .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive())
        .addAsLibraries(testJar)
        .addAsServiceProvider(Extension.class, TransactionContextExtension.class)
        .addAsWebInfResource(ArchiveUtils.getBeansXml(), "beans.xml");
  }
Example #28
0
 @Deployment(testable = false)
 public static Archive<?> ear() {
   return ShrinkWrap.create(EnterpriseArchive.class, "broken.ear")
       .addAsModule(
           ShrinkWrap.create(WebArchive.class, "broken-web.war")
               .addClasses(LoadJodaFromTheWebAppResource.class)
               .addAsLibraries(
                   Maven.resolver()
                       .offline()
                       .resolve("joda-time:joda-time:2.5")
                       .withClassPathResolution(true)
                       .using(new AcceptScopesStrategy(ScopeType.COMPILE, ScopeType.RUNTIME))
                       .asFile()));
 }
Example #29
0
 public static WebArchive createBaseDeployment() {
   return ShrinkWrap.create(WebArchive.class, "test.war")
       .addAsLibraries(
           DependencyResolvers.use(MavenDependencyResolver.class)
               .loadMetadataFromPom("pom.xml")
               .artifact("org.jboss.seam.validation:seam-validation")
               .resolveAs(GenericArchive.class, validationArtifactsFilter))
       .addAsLibraries(
           ShrinkWrap.create(ZipImporter.class, "seam-validation.jar")
               .importFrom(new File("../impl/target/seam-validation.jar"))
               .as(JavaArchive.class),
           ShrinkWrap.create(ZipImporter.class, "seam-validation-api.jar")
               .importFrom(new File("../api/target/seam-validation-api.jar"))
               .as(JavaArchive.class));
 }
  /**
   * Create a .ear, containing a web application (without any JSF constructs) and also the xerces
   * jar in the .ear/lib
   *
   * @return
   */
  @Deployment(name = "app-without-jsf", testable = false)
  public static EnterpriseArchive createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, WEB_APP_CONTEXT + ".war");
    war.addClasses(XercesUsageServlet.class);
    // add a dummy xml to parse
    war.addAsResource(XercesUsageServlet.class.getPackage(), "dummy.xml", "dummy.xml");

    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "xerces-usage.ear");
    // add the .war
    ear.addAsModule(war);
    // add the xerces jar in the .ear/lib
    ear.addAsLibrary("xerces/xercesImpl.jar", "xercesImpl.jar");

    return ear;
  }