[jboss-svn-commits] JBoss Common SVN: r3664 - in shrinkwrap/trunk: api/src/main/java/org/jboss/shrinkwrap/api/container and 6 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 11 08:00:38 EST 2009
Author: aslak
Date: 2009-11-11 08:00:38 -0500 (Wed, 11 Nov 2009)
New Revision: 3664
Modified:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveExtensionLoader.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImplTestCase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicContainerTestBase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicEnterpriseContainerTestBase.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicWebContainerTestBase.java
Log:
SHRINKWRAP-61 for consistency, 'Source' was moved to argument 0 and 'Target' to argument 1
ie: add(Source, Target)
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -47,7 +47,7 @@
* @return
* @throws IllegalArgumentException If no target or assets were specified
*/
- T add(Path target, Asset asset) throws IllegalArgumentException;
+ T add(Asset asset, Path target) throws IllegalArgumentException;
/**
* Adds the specified asset under the specified target (directory)
@@ -60,7 +60,7 @@
* @return
* @throws IllegalArgumentException If the target, name, or asset was not specified
*/
- T add(Path target, String name, Asset asset) throws IllegalArgumentException;
+ T add(Asset asset, Path target, String name) throws IllegalArgumentException;
/**
* Adds the specified resource under the context denoted by the specified target
@@ -70,7 +70,7 @@
* @return
* @throws IllegalArgumentException If either the target or asset is not specified
*/
- T add(String target, Asset asset) throws IllegalArgumentException;
+ T add(Asset asset, String target) throws IllegalArgumentException;
/**
* Obtains the asset located at the specified path
@@ -124,7 +124,7 @@
* @return
* @throws IllegalArgumentException If the path or archive are not specified
*/
- T add(Path path, Archive<?> archive) throws IllegalArgumentException;
+ T add(Archive<?> archive, Path path) throws IllegalArgumentException;
/**
* Merge the contents from an existing archive without
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -112,7 +112,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(String target, String resourceName) throws IllegalArgumentException;
+ T addApplicationResource(String resourceName, String target) throws IllegalArgumentException;
/**
*
@@ -122,7 +122,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(String target, File resource) throws IllegalArgumentException;
+ T addApplicationResource(File resource, String target) throws IllegalArgumentException;
/**
*
@@ -132,7 +132,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(String target, URL resource) throws IllegalArgumentException;
+ T addApplicationResource(URL resource, String target) throws IllegalArgumentException;
/**
*
@@ -142,7 +142,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(String target, Asset resource) throws IllegalArgumentException;
+ T addApplicationResource(Asset resource, String target) throws IllegalArgumentException;
/**
* Adds a resource to this {@link Archive}s application context.
@@ -160,7 +160,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
- T addApplicationResource(Path target, String resourceName) throws IllegalArgumentException;
+ T addApplicationResource(String resourceName, Path target) throws IllegalArgumentException;
/**
*
@@ -170,7 +170,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(Path target, File resource) throws IllegalArgumentException;
+ T addApplicationResource(File resource, Path target) throws IllegalArgumentException;
/**
*
@@ -180,7 +180,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(Path target, URL resource) throws IllegalArgumentException;
+ T addApplicationResource(URL resource, Path target) throws IllegalArgumentException;
/**
*
@@ -190,7 +190,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addApplicationResource(Path target, Asset resource) throws IllegalArgumentException;
+ T addApplicationResource(Asset resource, Path target) throws IllegalArgumentException;
/**
* Adds a archive to this {@link Archive}s module context.
@@ -232,7 +232,7 @@
* @return This virtual archive
* @throws IllegalArgumentException if resourceName is null
*/
- T addModule(String targetPath, String resourceName) throws IllegalArgumentException;
+ T addModule(String resourceName, String targetPath) throws IllegalArgumentException;
/**
*
@@ -241,7 +241,7 @@
* @return This virtual archive
* @throws IllegalArgumentException if resource is null
*/
- T addModule(String targetPath, File resource) throws IllegalArgumentException;
+ T addModule(File resource, String targetPath) throws IllegalArgumentException;
/**
*
@@ -250,7 +250,9 @@
* @return This virtual archive
* @throws IllegalArgumentException if resource is null
*/
- T addModule(String targetPath, URL resource) throws IllegalArgumentException;
+ T addModule(URL resource, String targetPath) throws IllegalArgumentException;
+
+ T addModule(Asset resource, String targetPath) throws IllegalArgumentException;
/**
* Adds a resource to this {@link Archive}s module context.
@@ -262,7 +264,7 @@
* @return This virtual archive
* @throws IllegalArgumentException if resourceName is null
*/
- T addModule(Path targetPath, String resourceName) throws IllegalArgumentException;
+ T addModule(String resourceName, Path targetPath) throws IllegalArgumentException;
/**
*
@@ -271,7 +273,7 @@
* @return This virtual archive
* @throws IllegalArgumentException if resource is null
*/
- T addModule(Path targetPath, File resource) throws IllegalArgumentException;
+ T addModule(File resource, Path targetPath) throws IllegalArgumentException;
/**
*
@@ -280,5 +282,7 @@
* @return This virtual archive
* @throws IllegalArgumentException if resource is null
*/
- T addModule(Path targetPath, URL resource) throws IllegalArgumentException;
+ T addModule(URL resource, Path targetPath) throws IllegalArgumentException;
+
+ T addModule(Asset resource, Path targetPath) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -60,10 +60,10 @@
T addLibrary(File resource) throws IllegalArgumentException;
- T addLibrary(String target, String resourceName) throws IllegalArgumentException;
- T addLibrary(String target, File resource) throws IllegalArgumentException;
- T addLibrary(String target, URL resource) throws IllegalArgumentException;
- T addLibrary(String target, Asset resource) throws IllegalArgumentException;
+ T addLibrary(String resourceName, String target) throws IllegalArgumentException;
+ T addLibrary(File resource, String target) throws IllegalArgumentException;
+ T addLibrary(URL resource, String target) throws IllegalArgumentException;
+ T addLibrary(Asset resource, String target) throws IllegalArgumentException;
/**
* Adds the resource with the specified name
@@ -82,11 +82,11 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
- T addLibrary(Path target, String resourceName) throws IllegalArgumentException;
+ T addLibrary(String resourceName, Path target) throws IllegalArgumentException;
- T addLibrary(Path target, File resource) throws IllegalArgumentException;
- T addLibrary(Path target, URL resource) throws IllegalArgumentException;
- T addLibrary(Path target, Asset resource) throws IllegalArgumentException;
+ T addLibrary(File resource, Path target) throws IllegalArgumentException;
+ T addLibrary(URL resource, Path target) throws IllegalArgumentException;
+ T addLibrary(Asset resource, Path target) throws IllegalArgumentException;
/**
* Add another {@link Archive} to this {@link Archive} as a Library.
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -80,10 +80,10 @@
T addManifestResource(File resource) throws IllegalArgumentException;
- T addManifestResource(String target, String resourceName) throws IllegalArgumentException;
- T addManifestResource(String target, File resource) throws IllegalArgumentException;
- T addManifestResource(String target, URL resource) throws IllegalArgumentException;
- T addManifestResource(String target, Asset resource) throws IllegalArgumentException;
+ T addManifestResource(String resourceName, String target) throws IllegalArgumentException;
+ T addManifestResource(File resource, String target) throws IllegalArgumentException;
+ T addManifestResource(URL resource, String target) throws IllegalArgumentException;
+ T addManifestResource(Asset resource, String target) throws IllegalArgumentException;
/**
* Adds the resource with the specified name
@@ -101,8 +101,8 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
- T addManifestResource(Path target, String resourceName) throws IllegalArgumentException;
- T addManifestResource(Path target, File resource) throws IllegalArgumentException;
- T addManifestResource(Path target, URL resource) throws IllegalArgumentException;
- T addManifestResource(Path target, Asset resource) throws IllegalArgumentException;
+ T addManifestResource(String resourceName, Path target) throws IllegalArgumentException;
+ T addManifestResource(File resource, Path target) throws IllegalArgumentException;
+ T addManifestResource(URL resource, Path target) throws IllegalArgumentException;
+ T addManifestResource(Asset resource, Path target) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -82,7 +82,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resourceName is null
*/
- T addResource(String target, String resourceName) throws IllegalArgumentException;
+ T addResource(String resourceName, String target) throws IllegalArgumentException;
/**
*
@@ -92,7 +92,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(String target, File resource) throws IllegalArgumentException;
+ T addResource(File resource, String target) throws IllegalArgumentException;
/**
*
@@ -102,7 +102,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(String target, URL resource) throws IllegalArgumentException;
+ T addResource(URL resource, String target) throws IllegalArgumentException;
/**
*
@@ -112,7 +112,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(String target, Asset resource) throws IllegalArgumentException;
+ T addResource(Asset resource, String target) throws IllegalArgumentException;
/**
* Adds the resource with the specified name
@@ -129,7 +129,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resourceName is null
*/
- T addResource(Path target, String resourceName) throws IllegalArgumentException;
+ T addResource(String resourceName, Path target) throws IllegalArgumentException;
/**
* Adds the specified resource to the {@link Archive}, using the specified {@link ClassLoader}
@@ -143,7 +143,7 @@
* @throws IllegalArgumentException If the resourceName is null
* @throws IllegalArgumentException If the classLoader is null
*/
- T addResource(Path target, String resourceName, ClassLoader classLoader) throws IllegalArgumentException;
+ T addResource(String resourceName, Path target, ClassLoader classLoader) throws IllegalArgumentException;
/**
@@ -154,7 +154,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(Path target, File resource) throws IllegalArgumentException;
+ T addResource(File resource, Path target) throws IllegalArgumentException;
/**
* Adds the resource located at the specified {@link URL} to
@@ -166,7 +166,7 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(Path target, URL resource) throws IllegalArgumentException;
+ T addResource(URL resource, Path target) throws IllegalArgumentException;
/**
*
@@ -176,5 +176,5 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resource is null
*/
- T addResource(Path target, Asset resource) throws IllegalArgumentException;
+ T addResource(Asset resource, Path target) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -116,7 +116,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
- T addWebResource(String target, String resourceName) throws IllegalArgumentException;
+ T addWebResource(String resourceName, String target) throws IllegalArgumentException;
/**
*
@@ -126,7 +126,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(String target, File resource) throws IllegalArgumentException;
+ T addWebResource(File resource, String target) throws IllegalArgumentException;
/**
*
@@ -136,7 +136,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(String target, URL resource) throws IllegalArgumentException;
+ T addWebResource(URL resource, String target) throws IllegalArgumentException;
/**
*
@@ -146,7 +146,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(String target, Asset resource) throws IllegalArgumentException;
+ T addWebResource(Asset resource, String target) throws IllegalArgumentException;
/**
* Adds the resource with the specified name
@@ -164,7 +164,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
- T addWebResource(Path target, String resourceName) throws IllegalArgumentException;
+ T addWebResource(String resourceName, Path target) throws IllegalArgumentException;
/**
*
@@ -174,7 +174,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(Path target, File resource) throws IllegalArgumentException;
+ T addWebResource(File resource, Path target) throws IllegalArgumentException;
/**
*
@@ -184,7 +184,7 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(Path target, URL resource) throws IllegalArgumentException;
+ T addWebResource(URL resource, Path target) throws IllegalArgumentException;
/**
*
@@ -194,5 +194,5 @@
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resource is null
*/
- T addWebResource(Path target, Asset resource) throws IllegalArgumentException;
+ T addWebResource(Asset resource, Path target) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -91,7 +91,7 @@
* @see org.jboss.shrinkwrap.api.Archive#add(java.lang.String, org.jboss.shrinkwrap.api.Asset)
*/
@Override
- public T add(final String target, final Asset asset) throws IllegalArgumentException
+ public T add(final Asset asset, final String target) throws IllegalArgumentException
{
// Precondition checks
Validate.notNullOrEmpty(target, "target must be specified");
@@ -101,7 +101,7 @@
final Path path = new BasicPath(target);
// Delegate
- return this.add(path, asset);
+ return this.add(asset, path);
}
/**
@@ -109,7 +109,7 @@
* @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Path, java.lang.String, org.jboss.shrinkwrap.api.Asset)
*/
@Override
- public T add(final Path path, final String name, final Asset asset)
+ public T add(final Asset asset, final Path path, final String name)
{
// Precondition checks
Validate.notNull(path, "No path was specified");
@@ -120,7 +120,7 @@
final Path resolvedPath = new BasicPath(path, name);
// Delegate
- return this.add(resolvedPath, asset);
+ return this.add(asset, resolvedPath);
}
/**
@@ -145,7 +145,7 @@
* @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Archive)
*/
@Override
- public T add(final Path path, final Archive<?> archive)
+ public T add(final Archive<?> archive, final Path path)
{
// Precondition checks
Validate.notNull(path, "No path was specified");
@@ -159,7 +159,7 @@
ArchiveAsset archiveAsset = new ArchiveAsset(archive);
// Delegate
- return add(contentPath, archiveAsset);
+ return add(archiveAsset, contentPath);
}
/**
@@ -206,7 +206,7 @@
assetPath = new BasicPath(path, assetPath);
}
// Delegate
- add(assetPath, asset);
+ add(asset, assetPath);
}
return covariantReturn();
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveExtensionLoader.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveExtensionLoader.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveExtensionLoader.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -153,7 +153,7 @@
private Constructor<T> findConstructor(Class<T> implClass)
{
- Constructor<T>[] constructors = (Constructor<T>[])implClass.getConstructors();
+ Constructor<T>[] constructors = (Constructor<T>[])implClass.getConstructors();
for(Constructor<T> constructor : constructors) {
Class<?>[] parameters = constructor.getParameterTypes();
if(parameters.length != 1)
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -110,27 +110,27 @@
// Required Implementations - Archive -------------------------------------------------||
//-------------------------------------------------------------------------------------||
- /* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset[])
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T add(Path path, Asset asset)
+ public T add(Asset asset, Path path)
{
+ Validate.notNull(asset, "No asset was specified");
Validate.notNull(path, "No path was specified");
- Validate.notNull(asset, "No asset was specified");
content.put(path, asset);
return covariantReturn();
}
- /* {@inheritDoc}
- * @see org.jboss.shrinkwrap.impl.base.ArchiveBase#add(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Archive)
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.impl.base.ArchiveBase#add(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T add(Path path, Archive<?> archive)
+ public T add(Archive<?> archive, Path path)
{
// Add archive asset
- super.add(path, archive);
+ super.add(archive, path);
// Expected Archive Path
Path archivePath = new BasicPath(path, archive.getName());
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -87,37 +87,37 @@
//-------------------------------------------------------------------------------------||
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Archive)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T add(Path path, Archive<?> archive)
+ public T add(Archive<?> archive, Path path)
{
- this.archive.add(path, archive);
+ this.archive.add(archive, path);
return covarientReturn();
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T add(Path target, Asset asset) throws IllegalArgumentException
+ public T add(Asset asset, Path target) throws IllegalArgumentException
{
- archive.add(target, asset);
+ archive.add(asset, target);
return covarientReturn();
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, java.lang.String, org.jboss.declarchive.api.Asset)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path, java.lang.String)
*/
@Override
- public T add(Path path, String name, Asset asset)
+ public T add(Asset asset, Path path, String name)
{
- archive.add(path, name, asset);
+ archive.add(asset, path, name);
return covarientReturn();
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#merge(org.jboss.declarchive.api.Archive)
+ * @see org.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.Archive)
*/
@Override
public T merge(Archive<?> source) throws IllegalArgumentException
@@ -126,6 +126,9 @@
return covarientReturn();
}
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Path)
+ */
@Override
public T merge(Archive<?> source, Path path) throws IllegalArgumentException
{
@@ -134,12 +137,12 @@
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#add(java.lang.String, org.jboss.declarchive.api.Asset)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T add(String name, Asset asset)
+ public T add(Asset asset, String name)
{
- archive.add(name, asset);
+ archive.add(asset, name);
return covarientReturn();
}
@@ -268,7 +271,7 @@
public T setManifest(Asset resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource should be specified");
- return addManifestResource("MANIFEST.FM", resource);
+ return addManifestResource(resource, "MANIFEST.FM");
}
/* (non-Javadoc)
@@ -278,7 +281,7 @@
public final T addManifestResource(String resourceName)
{
Validate.notNull(resourceName, "ResourceName should be specified");
- return addManifestResource(resourceName, new ClassLoaderAsset(resourceName));
+ return addManifestResource(new ClassLoaderAsset(resourceName), resourceName);
}
/* (non-Javadoc)
@@ -288,104 +291,104 @@
public T addManifestResource(File resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(resource.getName(), new FileAsset(resource));
+ return addManifestResource(new FileAsset(resource), resource.getName());
}
/* (non-Javadoc)
* @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.lang.String, java.lang.String)
*/
@Override
- public T addManifestResource(String target, String resourceName) throws IllegalArgumentException
+ public T addManifestResource(String resourceName, String target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
- return addManifestResource(target, new ClassLoaderAsset(resourceName));
+ return addManifestResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.io.File, java.lang.String)
*/
@Override
- public T addManifestResource(String target, File resource) throws IllegalArgumentException
+ public T addManifestResource(File resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(target, new FileAsset(resource));
+ return addManifestResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.net.URL, java.lang.String)
*/
@Override
- public T addManifestResource(String target, URL resource) throws IllegalArgumentException
+ public T addManifestResource(URL resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(target, new UrlAsset(resource));
+ return addManifestResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T addManifestResource(String target, Asset resource) throws IllegalArgumentException
+ public T addManifestResource(Asset resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(new BasicPath(target), resource);
+ return addManifestResource(resource, new BasicPath(target));
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.ManifestContainer#addManifestResource(org.jboss.declarchive.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addManifestResource(Path target, String resourceName) throws IllegalArgumentException
+ public T addManifestResource(String resourceName, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
- return addManifestResource(target, new ClassLoaderAsset(resourceName));
+ return addManifestResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addManifestResource(Path target, File resource) throws IllegalArgumentException
+ public T addManifestResource(File resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(target, new FileAsset(resource));
+ return addManifestResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(org.jboss.shrinkwrap.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addManifestResource(Path target, URL resource) throws IllegalArgumentException
+ public T addManifestResource(URL resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addManifestResource(target, new UrlAsset(resource));
+ return addManifestResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.ManifestContainer#addManifestResource(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addManifestResource(Path target, Asset resource) throws IllegalArgumentException
+ public T addManifestResource(Asset resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
Path location = new BasicPath(getManinfestPath(), target);
- return add(location, resource);
+ return add(resource, location);
}
//-------------------------------------------------------------------------------------||
@@ -407,7 +410,7 @@
public final T addResource(String resourceName) throws IllegalArgumentException
{
Validate.notNull(resourceName, "ResourceName should be specified");
- return addResource(resourceName, new ClassLoaderAsset(resourceName));
+ return addResource(new ClassLoaderAsset(resourceName), resourceName);
}
/* (non-Javadoc)
@@ -417,11 +420,11 @@
public final T addResource(File resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource should be specified");
- return addResource(resource.getName(), new FileAsset(resource));
+ return addResource(new FileAsset(resource), resource.getName());
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(java.lang.String, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, java.lang.String)
*/
@Override
public final T addResource(String target, String resourceName) throws IllegalArgumentException
@@ -429,105 +432,105 @@
Validate.notNull(target, "Target should be specified");
Validate.notNull(resourceName, "ResourceName should be specified");
- return addResource(target, new ClassLoaderAsset(resourceName));
+ return addResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.io.File, java.lang.String)
*/
@Override
- public T addResource(String target, File resource) throws IllegalArgumentException
+ public T addResource(File resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addResource(target, new FileAsset(resource));
+ return addResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.net.URL, java.lang.String)
*/
@Override
- public T addResource(String target, URL resource) throws IllegalArgumentException
+ public T addResource(URL resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addResource(target, new UrlAsset(resource));
+ return addResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T addResource(String target, Asset resource) throws IllegalArgumentException
+ public T addResource(Asset resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addResource(new BasicPath(target), resource);
+ return addResource(resource, new BasicPath(target));
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addResource(Path target, String resourceName) throws IllegalArgumentException
+ public T addResource(String resourceName, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
- return addResource(target, new ClassLoaderAsset(resourceName));
+ return addResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.lang.String, java.lang.ClassLoader)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.lang.String, org.jboss.shrinkwrap.api.Path, java.lang.ClassLoader)
*/
@Override
- public T addResource(Path target, String resourceName, ClassLoader classLoader) throws IllegalArgumentException
+ public T addResource(String resourceName, Path target, ClassLoader classLoader) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(classLoader, "ClassLoader should be specified");
- return addResource(target, new ClassLoaderAsset(resourceName, classLoader));
+ return addResource(new ClassLoaderAsset(resourceName, classLoader), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addResource(Path target, File resource) throws IllegalArgumentException
+ public T addResource(File resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addResource(target, new FileAsset(resource));
+ return addResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addResource(Path target, URL resource) throws IllegalArgumentException
+ public T addResource(URL resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addResource(target, new UrlAsset(resource));
+ return addResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.ResourceContainer#addResource(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addResource(Path target, Asset resource) throws IllegalArgumentException
+ public T addResource(Asset resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
Path location = new BasicPath(getResourcePath(), target);
- return add(location, resource);
+ return add(resource, location);
}
//-------------------------------------------------------------------------------------||
@@ -564,7 +567,7 @@
{
Asset resource = new ClassAsset(clazz);
Path location = new BasicPath(getClassesPath(), AssetUtil.getFullPathForClassResource(clazz));
- add(location, resource);
+ add(resource, location);
}
return covarientReturn();
};
@@ -597,7 +600,7 @@
{
Asset asset = new ClassAsset(clazz);
Path location = new BasicPath(getClassesPath(), AssetUtil.getFullPathForClassResource(clazz));
- add(location, asset);
+ add(asset, location);
}
}
return covarientReturn();
@@ -621,7 +624,7 @@
public T addLibrary(Archive<?> archive) throws IllegalArgumentException
{
Validate.notNull(archive, "Archive must be specified");
- return add(getLibraryPath(), archive);
+ return add(archive, getLibraryPath());
};
/* (non-Javadoc)
@@ -631,7 +634,7 @@
public T addLibrary(String resourceName) throws IllegalArgumentException
{
Validate.notNull(resourceName, "ResourceName must be specified");
- return addLibrary(resourceName, new ClassLoaderAsset(resourceName));
+ return addLibrary(new ClassLoaderAsset(resourceName), resourceName);
}
/* (non-Javadoc)
@@ -641,104 +644,104 @@
public T addLibrary(File resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource must be specified");
- return addLibrary(resource.getName(), new FileAsset(resource));
+ return addLibrary(new FileAsset(resource), resource.getName());
}
/* (non-Javadoc)
* @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.lang.String, java.lang.String)
*/
@Override
- public T addLibrary(String target, String resourceName) throws IllegalArgumentException
+ public T addLibrary(String resourceName, String target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resourceName, "ResourceName must be specified");
- return addLibrary(target, new ClassLoaderAsset(resourceName));
+ return addLibrary(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.io.File, java.lang.String)
*/
@Override
- public T addLibrary(String target, File resource) throws IllegalArgumentException
+ public T addLibrary(File resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addLibrary(target, new FileAsset(resource));
+ return addLibrary(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.net.URL, java.lang.String)
*/
@Override
- public T addLibrary(String target, URL resource) throws IllegalArgumentException
+ public T addLibrary(URL resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addLibrary(target, new UrlAsset(resource));
+ return addLibrary(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T addLibrary(String target, Asset resource) throws IllegalArgumentException
+ public T addLibrary(Asset resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addLibrary(new BasicPath(target), resource);
+ return addLibrary(resource, new BasicPath(target));
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.LibraryContainer#addLibrary(org.jboss.declarchive.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addLibrary(Path target, String resourceName) throws IllegalArgumentException
+ public T addLibrary(String resourceName, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resourceName, "ResourceName must be specified");
- return addLibrary(target, new ClassLoaderAsset(resourceName));
+ return addLibrary(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addLibrary(Path target, File resource) throws IllegalArgumentException
+ public T addLibrary(File resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addLibrary(target, new FileAsset(resource));
+ return addLibrary(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(org.jboss.shrinkwrap.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addLibrary(Path target, URL resource) throws IllegalArgumentException
+ public T addLibrary(URL resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addLibrary(target, new UrlAsset(resource));
+ return addLibrary(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.LibraryContainer#addLibrary(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addLibrary(Path target, Asset resource) throws IllegalArgumentException
+ public T addLibrary(Asset resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
Path location = new BasicPath(getLibraryPath(), target);
- return add(location, resource);
+ return add(resource, location);
}
/* (non-Javadoc)
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -106,7 +106,7 @@
public T setApplicationXML(Asset resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource("application.xml", resource);
+ return addApplicationResource(resource, "application.xml");
}
/* (non-Javadoc)
@@ -117,7 +117,7 @@
{
Validate.notNull(resourceName, "ResourceName must be specified");
- return addApplicationResource(resourceName, new ClassLoaderAsset(resourceName));
+ return addApplicationResource(new ClassLoaderAsset(resourceName), resourceName);
}
/* (non-Javadoc)
@@ -128,107 +128,104 @@
{
Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(resource.getName(), new FileAsset(resource));
+ return addApplicationResource(new FileAsset(resource), resource.getName());
}
/* (non-Javadoc)
* @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.lang.String, java.lang.String)
*/
@Override
- public T addApplicationResource(String target, String resourceName) throws IllegalArgumentException
+ public T addApplicationResource(String resourceName, String target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resourceName, "ResourceName must be specified");
- return addApplicationResource(target, new ClassLoaderAsset(resourceName));
+ return addApplicationResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.io.File, java.lang.String)
*/
@Override
- public T addApplicationResource(String target, File resource) throws IllegalArgumentException
+ public T addApplicationResource(File resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(target, new FileAsset(resource));
+ return addApplicationResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.net.URL, java.lang.String)
*/
@Override
- public T addApplicationResource(String target, URL resource) throws IllegalArgumentException
+ public T addApplicationResource(URL resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(target, new UrlAsset(resource));
+ return addApplicationResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T addApplicationResource(String target, Asset resource) throws IllegalArgumentException
+ public T addApplicationResource(Asset resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(new BasicPath(target), resource);
+ return addApplicationResource(resource, new BasicPath(target));
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.EnterpriseContainer#addApplicationResource(org.jboss.declarchive.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addApplicationResource(Path target, String resourceName) throws IllegalArgumentException
+ public T addApplicationResource(String resourceName, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resourceName, "ResourceName must be specified");
- return addApplicationResource(target, new ClassLoaderAsset(resourceName));
+ return addApplicationResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addApplicationResource(Path target, File resource) throws IllegalArgumentException
+ public T addApplicationResource(File resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(target, new FileAsset(resource));
+ return addApplicationResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
- /* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Path, java.net.URL)
- */
@Override
- public T addApplicationResource(Path target, URL resource) throws IllegalArgumentException
+ public T addApplicationResource(URL resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addApplicationResource(target, new UrlAsset(resource));
+ return addApplicationResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addApplicationResource(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addApplicationResource(Path target, Asset resource) throws IllegalArgumentException
+ public T addApplicationResource(Asset resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(target, "Target must be specified");
- Validate.notNull(resource, "Resource must be specified");
Path location = new BasicPath(getApplicationPath(), target);
- return add(location, resource);
+ return add(resource, location);
}
//-------------------------------------------------------------------------------------||
@@ -251,7 +248,7 @@
{
Validate.notNull(archive, "Archive must be specified");
- return add(getModulePath(), archive);
+ return add(archive, getModulePath());
}
/* (non-Javadoc)
@@ -263,7 +260,7 @@
Validate.notNull(resourceName, "ResourceName must be specified");
Path location = new BasicPath(AssetUtil.getNameForClassloaderResource(resourceName));
- return addModule(location, resourceName);
+ return addModule(resourceName, location);
}
/* (non-Javadoc)
@@ -274,85 +271,105 @@
{
Validate.notNull(resource, "Resource must be specified");
- Path location = new BasicPath(resource.getName());
- return addModule(location, resource);
+ return addModule(resource, resource.getName());
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addModule(final Path targetPath, final File resource) throws IllegalArgumentException
+ public T addModule(final File resource, final Path targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resource, "Resource must be specified");
final Asset asset = new FileAsset(resource);
- final Path location = new BasicPath(getModulePath(), targetPath);
- return add(location, asset);
+ return addModule(asset, targetPath);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(org.jboss.shrinkwrap.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addModule(final Path targetPath, final String resourceName) throws IllegalArgumentException
+ public T addModule(final String resourceName, final Path targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resourceName, "ResourceName must be specified");
final Asset asset = new ClassLoaderAsset(resourceName);
- final Path location = new BasicPath(getModulePath(), targetPath);
- return add(location, asset);
+ return addModule(asset, targetPath);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(org.jboss.shrinkwrap.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addModule(final Path targetPath, final URL resource) throws IllegalArgumentException
+ public T addModule(final URL resource, final Path targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resource, "Resource must be specified");
Asset asset = new UrlAsset(resource);
- Path location = new BasicPath(getModulePath(),targetPath);
- return add(location, asset);
+ return addModule(asset, targetPath);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.io.File, java.lang.String)
*/
@Override
- public T addModule(final String targetPath, final File resource) throws IllegalArgumentException
+ public T addModule(final File resource, final String targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addModule(new BasicPath(targetPath), resource);
+ return addModule(resource, new BasicPath(targetPath));
}
/* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(org.jboss.shrinkwrap.api.Asset, java.lang.String)
+ */
+ @Override
+ public T addModule(Asset resource, String targetPath) throws IllegalArgumentException
+ {
+ Validate.notNull(resource, "Resource must be specified");
+ Validate.notNull(targetPath, "Target Path must be specified");
+
+ return addModule(resource, new BasicPath(targetPath));
+ }
+
+ /* (non-Javadoc)
* @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.lang.String, java.lang.String)
*/
@Override
- public T addModule(final String targetPath, final String resourceName) throws IllegalArgumentException
+ public T addModule(final String resourceName, final String targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "Resource must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resourceName, "Resource must be specified");
- return addModule(new BasicPath(targetPath), resourceName);
+ return addModule(resourceName, new BasicPath(targetPath));
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(java.net.URL, java.lang.String)
*/
@Override
- public T addModule(final String targetPath, final URL resource) throws IllegalArgumentException
+ public T addModule(final URL resource, final String targetPath) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource must be specified");
Validate.notNull(targetPath, "Target Path must be specified");
- Validate.notNull(resource, "Resource must be specified");
- return addModule(new BasicPath(targetPath), resource);
+ return addModule(resource, new BasicPath(targetPath));
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.container.EnterpriseContainer#addModule(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
+ */
+ @Override
+ public T addModule(Asset resource, Path targetPath) throws IllegalArgumentException
+ {
+ Validate.notNull(resource, "Resource must be specified");
+ Validate.notNull(targetPath, "Target Path must be specified");
+
+ return add(resource, new BasicPath(getModulePath(), targetPath));
+ }
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -67,6 +67,9 @@
}
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.container.ResourceAdapterContainer#setResourceAdapterXML(java.io.File)
+ */
@Override
public T setResourceAdapterXML(File resource) throws IllegalArgumentException
{
@@ -74,6 +77,9 @@
return setResourceAdapterXML(new FileAsset(resource));
}
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.container.ResourceAdapterContainer#setResourceAdapterXML(java.net.URL)
+ */
@Override
public T setResourceAdapterXML(URL resource) throws IllegalArgumentException
{
@@ -81,11 +87,14 @@
return setResourceAdapterXML(new UrlAsset(resource));
}
+ /* (non-Javadoc)
+ * @see org.jboss.shrinkwrap.api.container.ResourceAdapterContainer#setResourceAdapterXML(org.jboss.shrinkwrap.api.Asset)
+ */
@Override
public T setResourceAdapterXML(Asset resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource must be specified");
- return addResource(new BasicPath(getResourcePath(), "ra.xml"), resource);
+ return addResource(resource, new BasicPath(getResourcePath(), "ra.xml"));
}
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -110,7 +110,7 @@
public T setWebXML(Asset resource) throws IllegalArgumentException
{
Validate.notNull(resource, "Resource should be specified");
- return addWebResource("web.xml", resource);
+ return addWebResource(resource, "web.xml");
}
/* (non-Javadoc)
@@ -121,7 +121,7 @@
{
Validate.notNull(resourceName, "ResourceName should be specified");
- return addWebResource(AssetUtil.getNameForClassloaderResource(resourceName), new ClassLoaderAsset(resourceName));
+ return addWebResource(new ClassLoaderAsset(resourceName), AssetUtil.getNameForClassloaderResource(resourceName));
}
/* (non-Javadoc)
@@ -132,103 +132,103 @@
{
Validate.notNull(resource, "Resource should be specified");
- return addWebResource(resource.getName(), new FileAsset(resource));
+ return addWebResource(new FileAsset(resource), resource.getName());
}
/* (non-Javadoc)
* @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.String, java.lang.String)
*/
@Override
- public T addWebResource(String target, String resourceName) throws IllegalArgumentException
+ public T addWebResource(String resourceName, String target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
- return addWebResource(new BasicPath(target), new ClassLoaderAsset(resourceName));
+ return addWebResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.String, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.io.File, java.lang.String)
*/
@Override
- public T addWebResource(String target, File resource) throws IllegalArgumentException
+ public T addWebResource(File resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addWebResource(new BasicPath(target), new FileAsset(resource));
+ return addWebResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.String, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.net.URL, java.lang.String)
*/
@Override
- public T addWebResource(String target, URL resource) throws IllegalArgumentException
+ public T addWebResource(URL resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addWebResource(new BasicPath(target), new UrlAsset(resource));
+ return addWebResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(org.jboss.shrinkwrap.api.Asset, java.lang.String)
*/
@Override
- public T addWebResource(String target, Asset resource) throws IllegalArgumentException
+ public T addWebResource(Asset resource, String target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addWebResource(new BasicPath(target), resource);
+ return addWebResource(resource, new BasicPath(target));
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.container.WebContainer#addWebResource(org.jboss.declarchive.api.Path, java.lang.String)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.String, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addWebResource(Path target, String resourceName) throws IllegalArgumentException
+ public T addWebResource(String resourceName, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resourceName, "ResourceName should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resourceName, "ResourceName should be specified");
- return addWebResource(target, new ClassLoaderAsset(resourceName));
+ return addWebResource(new ClassLoaderAsset(resourceName), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(org.jboss.shrinkwrap.api.Path, java.io.File)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.io.File, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addWebResource(Path target, File resource) throws IllegalArgumentException
+ public T addWebResource(File resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addWebResource(target, new FileAsset(resource));
+ return addWebResource(new FileAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(org.jboss.shrinkwrap.api.Path, java.net.URL)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.net.URL, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addWebResource(Path target, URL resource) throws IllegalArgumentException
+ public T addWebResource(URL resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
- return addWebResource(target, new UrlAsset(resource));
+ return addWebResource(new UrlAsset(resource), target);
}
/* (non-Javadoc)
- * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
+ * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(org.jboss.shrinkwrap.api.Asset, org.jboss.shrinkwrap.api.Path)
*/
@Override
- public T addWebResource(Path target, Asset resource) throws IllegalArgumentException
+ public T addWebResource(Asset resource, Path target) throws IllegalArgumentException
{
+ Validate.notNull(resource, "Resource should be specified");
Validate.notNull(target, "Target should be specified");
- Validate.notNull(resource, "Resource should be specified");
Path location = new BasicPath(getWebPath(), target);
- return add(location, resource);
+ return add(resource, location);
}
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -115,7 +115,7 @@
doImport(root, file.listFiles());
} else
{
- archive.add(calculatePath(root, file), new FileAsset(file));
+ archive.add(new FileAsset(file), calculatePath(root, file));
}
}
}
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -102,7 +102,7 @@
{
output.write(content, 0, readBytes);
}
- archive.add(entryName, new ByteArrayAsset(output.toByteArray()));
+ archive.add(new ByteArrayAsset(output.toByteArray()), entryName);
stream.closeEntry();
}
}
@@ -144,7 +144,7 @@
}
String entryName = entry.getName();
- archive.add(new BasicPath(entryName), new ZipFileEntryAsset(file, entry));
+ archive.add(new ZipFileEntryAsset(file, entry), new BasicPath(entryName));
}
return this;
}
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -258,7 +258,7 @@
try
{
Archive<?> archive = createArchiveWithAssets();
- archive.add(new BasicPath("badAsset"), new Asset()
+ archive.add(new Asset()
{
@Override
@@ -267,7 +267,7 @@
throw new RuntimeException("Mock Esception getting Stream");
}
- });
+ }, new BasicPath("badAsset"));
final File directory = createTempDirectory("testExportExplodedThrowsExceptionOnAssetWrite");
ExplodedExporter.exportExploded(archive, directory);
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -167,7 +167,7 @@
addContent(nestedArchive);
// Add nested archive
- archive.add(new BasicPath(), nestedArchive);
+ archive.add(nestedArchive, new BasicPath());
// Add an archive nested in a directory
MemoryMapArchive nestedArchiveTwo = new MemoryMapArchiveImpl(NAME_NESTED_ARCHIVE_2);
@@ -176,7 +176,7 @@
addContent(nestedArchiveTwo);
// Add the archive under a nested path
- archive.add(NESTED_PATH, nestedArchiveTwo);
+ archive.add(nestedArchiveTwo, NESTED_PATH);
// Return archive
return archive;
@@ -189,8 +189,8 @@
*/
protected void addContent(Archive<?> archive)
{
- archive.add(PATH_ONE, ASSET_ONE);
- archive.add(PATH_TWO, ASSET_TWO);
+ archive.add(ASSET_ONE, PATH_ONE);
+ archive.add(ASSET_TWO, PATH_TWO);
}
}
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -175,7 +175,7 @@
{
Archive<?> archive = createArchiveWithAssets();
- archive.add(PATH_ONE, new Asset()
+ archive.add(new Asset()
{
@Override
@@ -184,7 +184,7 @@
throw new RuntimeException("Mock Exception from an Asset write");
}
- });
+ }, PATH_ONE);
ZipExporter.exportZip(archive);
Assert.fail("Should have thrown ArchiveExportException");
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImplTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImplTestCase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImplTestCase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -100,7 +100,7 @@
Assert.assertNotNull("Should not return a null archive", archive);
- archive.add(new BasicPath("test.properties"), new ClassLoaderAsset(EXISTING_RESOURCE));
+ archive.add(new ClassLoaderAsset(EXISTING_RESOURCE), new BasicPath("test.properties"));
File tempFile = new File("target/test.zip");
tempFile.deleteOnExit();
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -104,7 +104,7 @@
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path location = new BasicPath("/", "test.properties");
- archive.add(location, asset);
+ archive.add(asset, location);
Assert.assertTrue("Asset should be placed on " + location.get(), archive.contains(location));
}
@@ -121,7 +121,7 @@
try
{
- archive.add((Path) null, asset);
+ archive.add(asset, (Path) null);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -139,7 +139,7 @@
Archive<T> archive = getArchive();
try
{
- archive.add(new BasicPath("/", "Test.properties"), (Asset) null);
+ archive.add((Asset) null, new BasicPath("/", "Test.properties"));
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -158,7 +158,7 @@
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path location = new BasicPath("/", "test.properties");
- archive.add(location.get(), asset);
+ archive.add(asset, location.get());
Assert.assertTrue("Asset should be placed on " + new BasicPath("/", "test.properties"), archive
.contains(location));
@@ -176,7 +176,7 @@
try
{
- archive.add((String) null, asset);
+ archive.add(asset, (String) null);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -194,7 +194,7 @@
Archive<T> archive = getArchive();
try
{
- archive.add("/Test.properties", (Asset) null);
+ archive.add((Asset) null, "/Test.properties");
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -214,7 +214,7 @@
final Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path location = new BasicPath("/");
- archive.add(location, name, asset);
+ archive.add(asset, location, name);
Path expectedPath = new BasicPath("/", "test.properties");
@@ -233,7 +233,7 @@
final Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
try
{
- archive.add(null, name, asset);
+ archive.add(asset, null, name);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -253,7 +253,7 @@
final String resource = NAME_TEST_PROPERTIES;
try
{
- archive.add(path, null, new ClassLoaderAsset(resource));
+ archive.add(new ClassLoaderAsset(resource), path, null);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -273,7 +273,7 @@
final Path path = new BasicPath("/", "Test.properties");
try
{
- archive.add(path, name, null);
+ archive.add(null, path, name);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -291,7 +291,7 @@
Archive<T> archive = getArchive();
String resource = NAME_TEST_PROPERTIES;
Path location = new BasicPath("/", "test.properties");
- archive.add(location, new ClassLoaderAsset(resource));
+ archive.add(new ClassLoaderAsset(resource), location);
Assert.assertTrue(archive.contains(location)); // Sanity check
Assert.assertTrue("Successfully deleting an Asset should return true", archive.delete(location));
@@ -341,7 +341,7 @@
Archive<T> archive = getArchive();
Path location = new BasicPath("/", "test.properties");
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
- archive.add(location, asset);
+ archive.add(asset, location);
Asset fetchedAsset = archive.get(location);
@@ -376,7 +376,7 @@
Archive<T> archive = getArchive();
Path location = new BasicPath("/", "test.properties");
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
- archive.add(location, asset);
+ archive.add(asset, location);
Asset fetchedAsset = archive.get(location.get());
@@ -414,7 +414,7 @@
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
- archive.add(location, asset).add(locationTwo, assetTwo);
+ archive.add(asset, location).add(assetTwo, locationTwo);
Map<Path, Asset> content = archive.getContent();
@@ -438,7 +438,7 @@
Archive<T> archive = getArchive();
try
{
- archive.add(null, new MemoryMapArchiveImpl());
+ archive.add(new MemoryMapArchiveImpl(), null);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -456,7 +456,7 @@
Archive<T> archive = getArchive();
try
{
- archive.add(new BasicPath("/"), (Archive<?>) null);
+ archive.add((Archive<?>) null, new BasicPath("/"));
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -496,7 +496,7 @@
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
- sourceArchive.add(location, asset).add(locationTwo, assetTwo);
+ sourceArchive.add(asset, location).add(assetTwo, locationTwo);
archive.merge(sourceArchive);
Assert.assertTrue("Asset should have been added to path: " + location.get(), this.compareAssets(archive
@@ -520,7 +520,7 @@
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
- sourceArchive.add(location, asset).add(locationTwo, assetTwo);
+ sourceArchive.add(asset, location).add(assetTwo, locationTwo);
Path baseLocation = new BasicPath("somewhere");
@@ -566,7 +566,7 @@
Path baseLocation = new BasicPath("somewhere");
- archive.add(baseLocation, sourceArchive);
+ archive.add(sourceArchive, baseLocation);
Path expectedPath = new BasicPath(baseLocation, sourceArchive.getName());
@@ -596,11 +596,11 @@
Path nestedAssetPath = new BasicPath("/", "test.properties");
- sourceArchive.add(nestedAssetPath, asset);
+ sourceArchive.add(asset, nestedAssetPath);
Path baseLocation = new BasicPath("somewhere");
- archive.add(baseLocation, sourceArchive);
+ archive.add(sourceArchive, baseLocation);
Path archivePath = new BasicPath(baseLocation, sourceArchive.getName());
@@ -623,17 +623,17 @@
Path baseLocation = new BasicPath("somewhere");
- archive.add(baseLocation, nestedArchive);
+ archive.add(nestedArchive, baseLocation);
Archive<T> nestedNestedArchive = createNewArchive();
- nestedArchive.add(new BasicPath("/"), nestedNestedArchive);
+ nestedArchive.add(nestedNestedArchive, new BasicPath("/"));
Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path nestedAssetPath = new BasicPath("/", "test.properties");
- nestedNestedArchive.add(nestedAssetPath, asset);
+ nestedNestedArchive.add(asset, nestedAssetPath);
Path nestedArchivePath = new BasicPath(baseLocation, nestedArchive.getName());
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicContainerTestBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicContainerTestBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicContainerTestBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -141,7 +141,7 @@
@ArchiveType(ManifestContainer.class)
public void testAddManifestURL() throws Exception {
Path targetPath = new BasicPath("Test.properties");
- getManifestContainer().addManifestResource(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path testPath = new BasicPath(getManifestPath(), targetPath);
Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}
@@ -149,7 +149,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestStringTargetResource() throws Exception {
- getManifestContainer().addManifestResource("Test.txt", NAME_TEST_PROPERTIES);
+ getManifestContainer().addManifestResource(NAME_TEST_PROPERTIES, "Test.txt");
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -160,7 +160,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestStringTargetFile() throws Exception {
- getManifestContainer().addManifestResource("Test.txt", getFileForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -171,7 +171,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestStringTargetURL() throws Exception {
- getManifestContainer().addManifestResource("Test.txt", getURLForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -182,7 +182,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestStringTargetAsset() throws Exception {
- getManifestContainer().addManifestResource("Test.txt", getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -193,7 +193,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPathTargetResource() throws Exception {
- getManifestContainer().addManifestResource(new BasicPath("Test.txt"), NAME_TEST_PROPERTIES);
+ getManifestContainer().addManifestResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -204,7 +204,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPathTargetFile() throws Exception {
- getManifestContainer().addManifestResource(new BasicPath("Test.txt"), getFileForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -215,7 +215,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPathTargetURL() throws Exception {
- getManifestContainer().addManifestResource(new BasicPath("Test.txt"), getURLForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -226,7 +226,7 @@
@Test
@ArchiveType(ManifestContainer.class)
public void testAddManifestPathTargetAsset() throws Exception {
- getManifestContainer().addManifestResource(new BasicPath("Test.txt"), getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getManifestContainer().addManifestResource(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getManifestPath(), "Test.txt");
Assert.assertTrue(
@@ -264,7 +264,7 @@
@ArchiveType(ResourceContainer.class)
public void testAddResourceURL() throws Exception {
Path targetPath = new BasicPath("Test.properties");
- getResourceContainer().addResource(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path testPath = new BasicPath(getResourcePath(), targetPath);
Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}
@@ -283,7 +283,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourceStringTargetFile() throws Exception {
- getResourceContainer().addResource("Test.txt", getFileForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -295,7 +295,7 @@
@ArchiveType(ResourceContainer.class)
public void testAddResourceStringTargetURL() throws Exception {
- getResourceContainer().addResource("Test.txt", getURLForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -306,7 +306,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourceStringTargetAsset() throws Exception {
- getResourceContainer().addResource("Test.txt", getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -317,7 +317,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePathTargetResource() throws Exception {
- getResourceContainer().addResource(new BasicPath("Test.txt"), NAME_TEST_PROPERTIES);
+ getResourceContainer().addResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -328,7 +328,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePathTargetFile() throws Exception {
- getResourceContainer().addResource(new BasicPath("Test.txt"), getFileForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -339,7 +339,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePathTargetURL() throws Exception {
- getResourceContainer().addResource(new BasicPath("Test.txt"), getURLForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -350,7 +350,7 @@
@Test
@ArchiveType(ResourceContainer.class)
public void testAddResourcePathTargetAsset() throws Exception {
- getResourceContainer().addResource(new BasicPath("Test.txt"), getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getResourceContainer().addResource(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getResourcePath(), "Test.txt");
Assert.assertTrue(
@@ -468,7 +468,7 @@
@ArchiveType(LibraryContainer.class)
public void testAddLibraryURL() throws Exception {
final Path targetPath = new BasicPath("Test.properties");
- getLibraryContainer().addLibrary(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path testPath = new BasicPath(getLibraryPath(), targetPath);
Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}
@@ -476,7 +476,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryStringTargetResource() throws Exception {
- getLibraryContainer().addLibrary("Test.txt", NAME_TEST_PROPERTIES);
+ getLibraryContainer().addLibrary(NAME_TEST_PROPERTIES, "Test.txt");
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -487,7 +487,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryStringTargetFile() throws Exception {
- getLibraryContainer().addLibrary("Test.txt", getFileForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -498,7 +498,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryStringTargetURL() throws Exception {
- getLibraryContainer().addLibrary("Test.txt", getURLForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -509,7 +509,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryStringTargetAsset() throws Exception {
- getLibraryContainer().addLibrary("Test.txt", getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -520,7 +520,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryPathTargetResource() throws Exception {
- getLibraryContainer().addLibrary(new BasicPath("Test.txt"), NAME_TEST_PROPERTIES);
+ getLibraryContainer().addLibrary(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -531,7 +531,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryPathTargetFile() throws Exception {
- getLibraryContainer().addLibrary(new BasicPath("Test.txt"), getFileForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -542,7 +542,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryPathTargetURL() throws Exception {
- getLibraryContainer().addLibrary(new BasicPath("Test.txt"), getURLForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
@@ -553,7 +553,7 @@
@Test
@ArchiveType(LibraryContainer.class)
public void testAddLibraryPathTargetAsset() throws Exception {
- getLibraryContainer().addLibrary(new BasicPath("Test.txt"), getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getLibraryContainer().addLibrary(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getLibraryPath(), "Test.txt");
Assert.assertTrue(
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicEnterpriseContainerTestBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicEnterpriseContainerTestBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicEnterpriseContainerTestBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -112,7 +112,7 @@
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationURL() throws Exception {
final Path targetPath = new BasicPath("Test.properties");;
- getEnterpriseContainer().addApplicationResource(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path expectedPath = new BasicPath(getApplicationPath(), targetPath);
Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
}
@@ -120,7 +120,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationStringTargetResource() throws Exception {
- getEnterpriseContainer().addApplicationResource("Test.txt", NAME_TEST_PROPERTIES);
+ getEnterpriseContainer().addApplicationResource(NAME_TEST_PROPERTIES, "Test.txt");
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -131,7 +131,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationStringTargetFile() throws Exception {
- getEnterpriseContainer().addApplicationResource("Test.txt", getFileForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -142,7 +142,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationStringTargetURL() throws Exception {
- getEnterpriseContainer().addApplicationResource("Test.txt", getURLForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -153,7 +153,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationStringTargetAsset() throws Exception {
- getEnterpriseContainer().addApplicationResource("Test.txt", getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -164,7 +164,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationPathTargetResource() throws Exception {
- getEnterpriseContainer().addApplicationResource(new BasicPath("Test.txt"), NAME_TEST_PROPERTIES);
+ getEnterpriseContainer().addApplicationResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -175,7 +175,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationPathTargetFile() throws Exception {
- getEnterpriseContainer().addApplicationResource(new BasicPath("Test.txt"), getFileForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -186,7 +186,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationPathTargetURL() throws Exception {
- getEnterpriseContainer().addApplicationResource(new BasicPath("Test.txt"), getURLForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -197,7 +197,7 @@
@Test
@ArchiveType(EnterpriseContainer.class)
public void testAddApplicationPathTargetAsset() throws Exception {
- getEnterpriseContainer().addApplicationResource(new BasicPath("Test.txt"), getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addApplicationResource(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path expectedPath = new BasicPath(getApplicationPath(), "Test.txt");
Assert.assertTrue(
@@ -231,13 +231,77 @@
@ArchiveType(EnterpriseContainer.class)
public void testAddModuleURL() throws Exception {
final Path targetPath = new BasicPath("Test.properties");
- getEnterpriseContainer().addModule(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getEnterpriseContainer().addModule(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path expectedPath = new BasicPath(getModulePath(), targetPath);
Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
}
@Test
@ArchiveType(EnterpriseContainer.class)
+ public void testAddModuleStringTargetResource() throws Exception {
+ getEnterpriseContainer().addModule(NAME_TEST_PROPERTIES, "Test.properties");
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModuleStringTargetFile() throws Exception {
+ getEnterpriseContainer().addModule(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.properties");
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModuleStringTargetURL() throws Exception {
+ getEnterpriseContainer().addModule(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.properties");
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModuleStringTargetAsset() throws Exception {
+ getEnterpriseContainer().addModule(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.properties");
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModulePathTargetResource() throws Exception {
+ getEnterpriseContainer().addModule(NAME_TEST_PROPERTIES, new BasicPath("Test.properties"));
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModulePathTargetFile() throws Exception {
+ getEnterpriseContainer().addModule(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.properties"));
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModulePathTargetURL() throws Exception {
+ getEnterpriseContainer().addModule(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.properties"));
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
+ public void testAddModulePathTargetAsset() throws Exception {
+ getEnterpriseContainer().addModule(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.properties"));
+ Path expectedPath = new BasicPath(getModulePath(), "Test.properties");
+ Assert.assertTrue("Archive should contain " + expectedPath, getArchive().contains(expectedPath));
+ }
+
+ @Test
+ @ArchiveType(EnterpriseContainer.class)
public void testAddModuleArchive() throws Exception {
Archive<?> archive = createNewArchive();
getEnterpriseContainer().addModule(archive);
Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicWebContainerTestBase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicWebContainerTestBase.java 2009-11-11 11:05:39 UTC (rev 3663)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/DynamicWebContainerTestBase.java 2009-11-11 13:00:38 UTC (rev 3664)
@@ -110,7 +110,7 @@
@ArchiveType(WebContainer.class)
public void testAddWebResourceURL() throws Exception {
Path targetPath = new BasicPath("Test.properties");
- getWebContainer().addWebResource(targetPath, getURLForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getURLForClassResource(NAME_TEST_PROPERTIES), targetPath);
Path testPath = new BasicPath(getWebPath(), targetPath);
Assert.assertTrue("Archive should contain " + testPath, getArchive().contains(testPath));
}
@@ -118,7 +118,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourceStringTargetResource() throws Exception {
- getWebContainer().addWebResource("Test.txt", NAME_TEST_PROPERTIES);
+ getWebContainer().addWebResource(NAME_TEST_PROPERTIES, "Test.txt");
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -129,7 +129,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourceStringTargetFile() throws Exception {
- getWebContainer().addWebResource("Test.txt", getFileForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getFileForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -140,7 +140,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourceStringTargetURL() throws Exception {
- getWebContainer().addWebResource("Test.txt", getURLForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getURLForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -151,7 +151,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourceStringTargetAsset() throws Exception {
- getWebContainer().addWebResource("Test.txt", getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getAssetForClassResource(NAME_TEST_PROPERTIES), "Test.txt");
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -162,7 +162,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePathTargetResource() throws Exception {
- getWebContainer().addWebResource(new BasicPath("Test.txt"), NAME_TEST_PROPERTIES);
+ getWebContainer().addWebResource(NAME_TEST_PROPERTIES, new BasicPath("Test.txt"));
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -173,7 +173,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePathTargetFile() throws Exception {
- getWebContainer().addWebResource(new BasicPath("Test.txt"), getFileForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getFileForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -184,7 +184,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePathTargetURL() throws Exception {
- getWebContainer().addWebResource(new BasicPath("Test.txt"), getURLForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getURLForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
@@ -195,7 +195,7 @@
@Test
@ArchiveType(WebContainer.class)
public void testAddWebResourcePathTargetAsset() throws Exception {
- getWebContainer().addWebResource(new BasicPath("Test.txt"), getAssetForClassResource(NAME_TEST_PROPERTIES));
+ getWebContainer().addWebResource(getAssetForClassResource(NAME_TEST_PROPERTIES), new BasicPath("Test.txt"));
Path testPath = new BasicPath(getWebPath(), "Test.txt");
Assert.assertTrue(
More information about the jboss-svn-commits
mailing list