|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cdi.tck.shrinkwrap.ArchiveBuilder<T,A>
T - Self type to enable abstract builder patternA - Final shrinkwrap archivepublic abstract class ArchiveBuilder<T extends ArchiveBuilder<T,A>,A extends org.jboss.shrinkwrap.api.Archive<A>>
Abstract ShrinkWrap archive builder for CDI TCK Arquillian test.
This is a base class for builders that try to solve most JBoss Test Harness to Arquillian migration issues. The main goal was to use CDI TCK 1.0 tests with minimum code changes.
Note that all Arquillian tests running in as-client mode (including tests using ShouldThrowException) must not
contain testing related stuff (anything that depends on Arquillian, TestNG, incl. test class itself) since Arquillian is not
enriching as-client test archives. That's why isAsClientMode has to be properly set.
In case of isTestArchive set to false this archive may not include any testing related stuff as it is
probably part of another test archive.
| Nested Class Summary | |
|---|---|
protected class |
ArchiveBuilder.LibraryDescriptor
Internal library descriptor. |
protected class |
ArchiveBuilder.ResourceDescriptor
Internal resource descriptor. |
protected class |
ArchiveBuilder.ServiceProviderDescriptor
Internal service provider descriptor. |
| Constructor Summary | |
|---|---|
ArchiveBuilder()
|
|
| Method Summary | ||
|---|---|---|
A |
build()
|
|
protected abstract A |
buildInternal()
|
|
T |
debugMode()
Enable debug mode. |
|
protected org.jboss.shrinkwrap.api.asset.Asset |
getBeansDescriptorAsset()
|
|
protected String |
getBeansDescriptorTarget()
|
|
String |
getName()
|
|
Boolean |
isAsClientMode()
|
|
boolean |
isTestArchive()
|
|
T |
notTestArchive()
Mark this archive as non-testing. |
|
protected
|
processClasses(P archive)
Process classes. |
|
protected void |
processLibraries(org.jboss.shrinkwrap.api.container.LibraryContainer<?> archive)
Process libraries. |
|
protected void |
processManifestResources(org.jboss.shrinkwrap.api.container.ManifestContainer<?> archive)
Process manifest resources. |
|
protected
|
processPackages(P archive)
Process packages. |
|
protected void |
processResources(org.jboss.shrinkwrap.api.container.ResourceContainer<?> archive)
Process resources. |
|
abstract T |
self()
|
|
T |
setAsClientMode(boolean isAsClientMode)
|
|
T |
withBeanLibrary(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
Class<?>... beanClasses)
Add bean library that consists of defined bean classes; automatically include empty beans.xml and if any of
defined classes implements Extension add corresponding service provider. |
|
T |
withBeanLibrary(Class<?>... beanClasses)
Add bean library that consists of defined bean classes; automatically include empty beans.xml and if any of
defined classes implements Extension add corresponding service provider. |
|
T |
withBeanLibrary(String name,
org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
Class<?>... beanClasses)
Add bean library that consists of defined bean classes; automatically include empty beans.xml and if any of
defined classes implements Extension add corresponding service provider. |
|
T |
withBeanLibrary(String name,
Class<?>... beanClasses)
Add bean library that consists of defined bean classes; automatically include empty beans.xml and if any of
defined classes implements Extension add corresponding service provider. |
|
T |
withBeansXml(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor)
Add beans.xml descriptor created with shrinkwrap-descriptors. |
|
T |
withBeansXml(String beansXml)
Add beans.xml located in src/main/resource/{testPackagePath}. |
|
T |
withClass(Class<?> clazz)
Add class to archive. |
|
T |
withClasses(Class<?>... classes)
Add classes to archive. |
|
T |
withDefaultPersistenceXml()
Add default persistence.xml. |
|
T |
withEjbJarXml(org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor descriptor)
Add ejb-jar.xml descriptor created with shrinkwrap-descriptors. |
|
T |
withEjbJarXml(String ejbJarXml)
Add ejb-jar.xml located in src/main/resource/{testPackagePath}. |
|
T |
withExcludedClass(String clazz)
Specified class must be excluded from final archive unless also added via withClass(Class) or
withClasses(Class...). |
|
T |
withExcludedClasses(String... classes)
Specified classes must be excluded from final archive unless also added via withClass(Class) or
withClasses(Class...). |
|
T |
withExtension(Class<? extends javax.enterprise.inject.spi.Extension> extensionClass)
Add CDI extension. |
|
T |
withExtensions(Class<? extends javax.enterprise.inject.spi.Extension>... extensionClasses)
Add CDI extensions. |
|
T |
withLibraries(org.jboss.shrinkwrap.api.spec.JavaArchive... libraries)
Add specified ShrinkWrap libraries. |
|
T |
withLibrary(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
boolean includeEmptyBeanXml,
Class<?>... classes)
Add library that consists of defined classes. |
|
T |
withLibrary(Class<?>... classes)
Add library that consists of defined classes. |
|
T |
withLibrary(File library)
Add library. |
|
T |
withLibrary(org.jboss.shrinkwrap.api.spec.JavaArchive library)
Add the specified ShrinkWrap library. |
|
T |
withLibrary(String name,
org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
boolean includeEmptyBeanXml,
Class<?>... classes)
Add library that consists of defined classes. |
|
T |
withManifestResource(String source)
Add resource to META-INF. |
|
T |
withManifestResource(String source,
boolean useTestPackageToLocateSource)
Add resource to META-INF. |
|
T |
withManifestResource(String source,
String target,
boolean useTestPackageToLocateSource)
Add resource to META-INF. |
|
T |
withName(String name)
Set the name of the archive. |
|
T |
withPackage(Package pack)
Add package (that is its content). |
|
T |
withPersistenceXml(org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor persistenceDescriptor)
Add persistence.xml descriptor created with shrinkwrap-descriptors. |
|
T |
withResource(String source)
Add resource. |
|
T |
withResource(String source,
boolean useTestPackageToLocateSource)
Add resource. |
|
T |
withResource(String source,
String target,
boolean useTestPackageToLocateSource)
Add resource. |
|
T |
withServiceProvider(ArchiveBuilder.ServiceProviderDescriptor serviceProvider)
Add service provider. |
|
T |
withTestClass(Class<?> testClazz)
Add test class to archive and set test class definition for configuration purpose. |
|
T |
withTestClassDefinition(Class<?> testClazz)
Set test class definition for configuration purpose. |
|
T |
withTestClassPackage(Class<?> testClazz)
Add all classes in the test class package to archive and set test class definition for configuration purpose. |
|
T |
withWebResource(String source)
Add web resource. |
|
T |
withWebResource(String source,
boolean useTestPackageToLocateSource)
Add web resource. |
|
T |
withWebResource(String source,
String target)
Add web resource. |
|
T |
withWebResource(String source,
String target,
boolean useTestPackageToLocateSource)
Add web resource. |
|
T |
withWebXml(String webXml)
Add web.xml located in src/main/resource/{testPackagePath}. |
|
T |
withWebXml(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor webXml)
Add web.xml descriptor created with shrinkwrap-descriptors. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_EJB_VERSION
protected ArchiveBuilder.ResourceDescriptor beansXml
protected org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor
protected ArchiveBuilder.ResourceDescriptor webXml
protected org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor webXmlDescriptor
protected org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor persistenceDescriptor
protected org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor ejbJarDescriptor
protected ArchiveBuilder.ResourceDescriptor ejbJarXml
protected List<ArchiveBuilder.ResourceDescriptor> manifestResources
protected List<ArchiveBuilder.ResourceDescriptor> resources
protected List<ArchiveBuilder.ResourceDescriptor> webResources
protected Set<Package> packages
protected Set<Class<?>> classes
protected Set<String> excludedClasses
protected List<ArchiveBuilder.LibraryDescriptor> libraries
protected List<org.jboss.shrinkwrap.api.spec.JavaArchive> shrinkWrapLibraries
protected List<ArchiveBuilder.ServiceProviderDescriptor> serviceProviders
| Constructor Detail |
|---|
public ArchiveBuilder()
| Method Detail |
|---|
public T withName(String name)
name -
public T withBeansXml(String beansXml)
beans.xml located in src/main/resource/{testPackagePath}.
Do not use this in new tests - use withBeansXml(BeansDescriptor) instead.
beansXml -
public T withBeansXml(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor)
beans.xml descriptor created with shrinkwrap-descriptors.
beansDescriptor -
public T withExtension(Class<? extends javax.enterprise.inject.spi.Extension> extensionClass)
extensionClass -
public T withExtensions(Class<? extends javax.enterprise.inject.spi.Extension>... extensionClasses)
extensionClasses -
public T withServiceProvider(ArchiveBuilder.ServiceProviderDescriptor serviceProvider)
serviceProvider -
public T withClass(Class<?> clazz)
clazz -
public T withClasses(Class<?>... classes)
classes -
public T withExcludedClass(String clazz)
withClass(Class) or
withClasses(Class...). Useful for exluding some classes from package added via withPackage(Package).
Avoid using this feature if possible - the implementation has negative performance effects.
clazz - Fully qualified class name
public T withExcludedClasses(String... classes)
withClass(Class) or
withClasses(Class...). Useful for exluding some classes from package added via withPackage(Package).
Avoid using this feature if possible - the implementation has negative performance effects.
classes - Fully qualified class names
public T withTestClassPackage(Class<?> testClazz)
testClazz -
public T withTestClass(Class<?> testClazz)
testClazz -
public T withTestClassDefinition(Class<?> testClazz)
ShouldThrowException.
test -
public T withPackage(Package pack)
pack -
public T withManifestResource(String source)
source -
public T withManifestResource(String source,
boolean useTestPackageToLocateSource)
source - useTestPackageToLocateSource -
public T withManifestResource(String source,
String target,
boolean useTestPackageToLocateSource)
source - target - useTestPackageToLocateSource -
public T withResource(String source)
source -
public T withResource(String source,
boolean useTestPackageToLocateSource)
source - useTestPackageToLocateSource -
public T withResource(String source,
String target,
boolean useTestPackageToLocateSource)
source - target - useTestPackageToLocateSource -
public T withWebResource(String source)
source -
public T withWebResource(String source,
String target)
source - target -
public T withWebResource(String source,
boolean useTestPackageToLocateSource)
source - useTestPackageToLocateSource -
public T withWebResource(String source,
String target,
boolean useTestPackageToLocateSource)
source -
public T withEjbJarXml(String ejbJarXml)
ejbJarXml -
public T withEjbJarXml(org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarDescriptor descriptor)
ejbJarXml -
public T withWebXml(String webXml)
Do not use this in new tests - use withWebXml(WebAppDescriptor) instead.
webXml -
public T withWebXml(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor webXml)
web.xml descriptor created with shrinkwrap-descriptors.
webXml -
public T withDefaultPersistenceXml()
public T withPersistenceXml(org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor persistenceDescriptor)
persistenceXml -
public T withLibrary(File library)
library -
public T withBeanLibrary(Class<?>... beanClasses)
beans.xml and if any of
defined classes implements Extension add corresponding service provider.
beanClasses -
public T withBeanLibrary(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
Class<?>... beanClasses)
beans.xml and if any of
defined classes implements Extension add corresponding service provider.
beanClasses -
public T withBeanLibrary(String name,
Class<?>... beanClasses)
beans.xml and if any of
defined classes implements Extension add corresponding service provider.
beanClasses -
public T withBeanLibrary(String name,
org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
Class<?>... beanClasses)
beans.xml and if any of
defined classes implements Extension add corresponding service provider.
beanClasses -
public T withLibrary(Class<?>... classes)
classes -
public T withLibrary(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
boolean includeEmptyBeanXml,
Class<?>... classes)
serviceProvider - omitBeansXml - classes -
public T withLibrary(String name,
org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor beansDescriptor,
boolean includeEmptyBeanXml,
Class<?>... classes)
serviceProvider - omitBeansXml - classes -
public T withLibrary(org.jboss.shrinkwrap.api.spec.JavaArchive library)
library -
public T withLibraries(org.jboss.shrinkwrap.api.spec.JavaArchive... libraries)
libraries -
public Boolean isAsClientMode()
true if building as-client mode archive, false otherwisepublic T setAsClientMode(boolean isAsClientMode)
isAsClientMode - resolveAsClientMode()public boolean isTestArchive()
true if TCK specific infrastructure (porting package, utils, etc.) should be automatically added,
false otherwiseresolveAsClientMode()public T notTestArchive()
public T debugMode()
public String getName()
public abstract T self()
public A build()
protected abstract A buildInternal()
protected <P extends org.jboss.shrinkwrap.api.Archive<?> & org.jboss.shrinkwrap.api.container.ClassContainer<?>> void processPackages(P archive)
#withExcludedClass(Class). If in as-client mode, filter test
class.
archive - protected <P extends org.jboss.shrinkwrap.api.Archive<?> & org.jboss.shrinkwrap.api.container.ClassContainer<?>> void processClasses(P archive)
archive - protected void processLibraries(org.jboss.shrinkwrap.api.container.LibraryContainer<?> archive)
archive - protected void processResources(org.jboss.shrinkwrap.api.container.ResourceContainer<?> archive)
archive - protected void processManifestResources(org.jboss.shrinkwrap.api.container.ManifestContainer<?> archive)
archive - protected org.jboss.shrinkwrap.api.asset.Asset getBeansDescriptorAsset()
protected String getBeansDescriptorTarget()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||