Package org.silverpeas.core.test
Interface CommonArchive<T extends CommonArchive<T>>
-
- All Known Subinterfaces:
CommonWebArchive<T>
- All Known Implementing Classes:
BasicCoreWarBuilder
,BasicWarBuilder
,WarBuilder
public interface CommonArchive<T extends CommonArchive<T>>
- Author:
- Yohann Chastagnier
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CommonArchive.OnShrinkWrapWar
In order to add configuration on WAR test archive.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addAsResource(String resourceName)
Adds the resource as a resource to the container, returning the container itself.T
addAsResource(String resourceName, String target)
Adds the resource as a resource to the container, returning the container itself.T
addClasses(Class<?>... classes)
T
addPackages(boolean recursive, String... packages)
Adds all classes in the specifiedPackage
s to theArchive
.T
applyManually(CommonArchive.OnShrinkWrapWar onShrinkWrapWar)
Applies a configuration by using directly theWebArchive
instance provided by the ShrinkWrap API.boolean
contains(Class<?> aClass)
Denotes whether this archive contains a classboolean
contains(String path)
Denotes whether this archive contains a resource at the specified pathT
deleteClasses(Class<?>... classes)
Deletes theClass
es in theArchive
.
-
-
-
Method Detail
-
contains
boolean contains(String path) throws IllegalArgumentException
Denotes whether this archive contains a resource at the specified path- Parameters:
path
- the path of the resource- Returns:
- true if the archive contains the resource, false otherwise
- Throws:
IllegalArgumentException
- If the path is not specified
-
contains
boolean contains(Class<?> aClass) throws IllegalArgumentException
Denotes whether this archive contains a class- Parameters:
aClass
- a class- Returns:
- true if the archive contains the class, false otherwise.
- Throws:
IllegalArgumentException
- If the path is not specified
-
addClasses
T addClasses(Class<?>... classes) throws IllegalArgumentException
- Parameters:
classes
- The classes to add to the Archive- Returns:
- This archive
- Throws:
IllegalArgumentException
- If no classes were specified
-
deleteClasses
T deleteClasses(Class<?>... classes)
Deletes theClass
es in theArchive
.- Parameters:
classes
- the classes to delete in the archive.- Returns:
- this archive.
- Throws:
IllegalArgumentException
- If no classes were specified
-
addPackages
T addPackages(boolean recursive, String... packages) throws IllegalArgumentException
Adds all classes in the specifiedPackage
s to theArchive
.- Parameters:
recursive
- Should the sub packages be addedpackages
- All the packages to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- If no packages were specified- See Also:
ClassContainer.addPackages(boolean, Filter, Package...)
-
addAsResource
T addAsResource(String resourceName) throws IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
The resource will be placed into the Container Resource path under the same context from which it was retrieved.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- If the resourceName is null- See Also:
ResourceContainer.addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(String resourceName, String target) throws IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is null or if target is null- See Also:
ResourceContainer.addAsResource(Asset, ArchivePath)
-
applyManually
T applyManually(CommonArchive.OnShrinkWrapWar onShrinkWrapWar)
Applies a configuration by using directly theWebArchive
instance provided by the ShrinkWrap API.- Parameters:
onShrinkWrapWar
- the instance of an anonymous implementation ofCommonArchive.OnShrinkWrapWar
interface.- Returns:
- the instance of the war builder.
-
-