org.jboss.cdi.tck.shrinkwrap
Class EnterpriseArchiveBuilder

java.lang.Object
  extended by org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder<EnterpriseArchiveBuilder,org.jboss.shrinkwrap.api.spec.EnterpriseArchive>
      extended by org.jboss.cdi.tck.shrinkwrap.EnterpriseArchiveBuilder

public class EnterpriseArchiveBuilder
extends ArchiveBuilder<EnterpriseArchiveBuilder,org.jboss.shrinkwrap.api.spec.EnterpriseArchive>

Shrinkwrap enterprise archive builder for JSR299 TCK arquillian test. This builder is intended to provide basic functionality covering common TCK needs. Use shrinkwrap API to adapt archive to advanced scenarios.

Test classes are added to EJB module.

Default and custom web module

The default web module is defined in order to build portable EE archive - it has to contain Class-Path entry in the MANIFEST.MF to state module dependency (see Class Loading Requirements in Java EE spec). Custom web module is not supported directly however its possible to build such module with shrinkwrap API and add it to final enterprise archive. It is necessary to omit default web module using noDefaultWebModule() as long as custom web module is used since arquillian cannot handle in-container test packaged as EAR with multiple web modules at the moment (cannot determine which web module to enrich).

application.xml

The application.xml descriptor is not supported as it is no longer required (Java EE 5, Java EE 6). Use shrinkwrap API to add custom application.xml descriptor.

Use case

Use enterprise archive in TCK tests only while:

Tests that use EnterpriseArchiveBuilder must belong to TestGroups.JAVAEE_FULL group.

Author:
Martin Kouba

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder
ArchiveBuilder.LibraryDescriptor, ArchiveBuilder.ResourceDescriptor, ArchiveBuilder.ServiceProviderDescriptor
 
Field Summary
static String DEFAULT_EAR_NAME
           
static String DEFAULT_EJB_MODULE_NAME
           
 
Fields inherited from class org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder
beansDescriptor, beansXml, classes, excludedClasses, libraries, manifestResources, packages, persistenceDescriptor, resources, serviceProviders, webResources, webXml, webXmlDescriptor
 
Constructor Summary
EnterpriseArchiveBuilder()
           
 
Method Summary
protected  org.jboss.shrinkwrap.api.spec.EnterpriseArchive buildInternal()
           
 EnterpriseArchiveBuilder noDefaultWebModule()
          Do not add default web module.
 EnterpriseArchiveBuilder self()
           
 EnterpriseArchiveBuilder withEjbModuleName(String ejbModuleName)
           
 
Methods inherited from class org.jboss.cdi.tck.shrinkwrap.ArchiveBuilder
build, getName, isAsClientMode, isTestArchive, notTestArchive, processClasses, processLibraries, processManifestResources, processPackages, processResources, withBeanLibrary, withBeanLibrary, withBeanLibrary, withBeanLibrary, withBeansXml, withBeansXml, withClass, withClasses, withDefaultPersistenceXml, withEjbJarXml, withExcludedClass, withExcludedClasses, withExtension, withExtension, withExtensions, withLibrary, withLibrary, withLibrary, withLibrary, withManifestResource, withManifestResource, withManifestResource, withName, withPersistenceXml, withResource, withResource, withResource, withServiceProvider, withTestClass, withTestClassDefinition, withTestClassPackage, withWebResource, withWebResource, withWebResource, withWebResource, withWebXml, withWebXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EAR_NAME

public static final String DEFAULT_EAR_NAME
See Also:
Constant Field Values

DEFAULT_EJB_MODULE_NAME

public static final String DEFAULT_EJB_MODULE_NAME
See Also:
Constant Field Values
Constructor Detail

EnterpriseArchiveBuilder

public EnterpriseArchiveBuilder()
Method Detail

noDefaultWebModule

public EnterpriseArchiveBuilder noDefaultWebModule()
Do not add default web module.

Returns:
self

withEjbModuleName

public EnterpriseArchiveBuilder withEjbModuleName(String ejbModuleName)

self

public EnterpriseArchiveBuilder self()
Specified by:
self in class ArchiveBuilder<EnterpriseArchiveBuilder,org.jboss.shrinkwrap.api.spec.EnterpriseArchive>
Returns:
self to enable generic builder

buildInternal

protected org.jboss.shrinkwrap.api.spec.EnterpriseArchive buildInternal()
Specified by:
buildInternal in class ArchiveBuilder<EnterpriseArchiveBuilder,org.jboss.shrinkwrap.api.spec.EnterpriseArchive>
Returns:
concrete shrinkwrap archive


Copyright © 2008-2012 Seam Framework. All Rights Reserved.