[jboss-svn-commits] JBoss Common SVN: r3507 - in declarchive/trunk: impl-base/src/main/java/org/jboss/declarchive/impl/base and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 2 14:39:29 EDT 2009
Author: johnbailey
Date: 2009-09-02 14:39:28 -0400 (Wed, 02 Sep 2009)
New Revision: 3507
Modified:
declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Archive.java
declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ArchiveBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ContainerBase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java
Log:
[TMPARCH-28] - updated Archive.addContents to Archive.merge
Modified: declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Archive.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Archive.java 2009-09-02 18:25:49 UTC (rev 3506)
+++ declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Archive.java 2009-09-02 18:39:28 UTC (rev 3507)
@@ -131,17 +131,17 @@
T add(Path path, Archive<?> archive) throws IllegalArgumentException;
/**
- * Add the contents from an existing archive without
+ * Merge the contents from an existing archive without
* maintaining the archive name in the context path.
*
* @param source Archive to add contents from
* @return
* @throws IllegalArgumentException If the existing archive is not specified
*/
- T addContents(Archive<?> source) throws IllegalArgumentException;
+ T merge(Archive<?> source) throws IllegalArgumentException;
/**
- * Add the contents from an existing archive in a specific path
+ * Merge the contents from an existing archive in a specific path
* without maintaining the archive name in the context path.
*
* @param path Path to add contents to
@@ -149,7 +149,7 @@
* @return
* @throws IllegalArgumentException If the path or existing archive is not specified
*/
- T addContents(Path path, Archive<?> source) throws IllegalArgumentException;
+ T merge(Path path, Archive<?> source) throws IllegalArgumentException;
/**
* Returns a multiline "ls -l"-equse output of the contents of
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ArchiveBase.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ArchiveBase.java 2009-09-02 18:25:49 UTC (rev 3506)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ArchiveBase.java 2009-09-02 18:39:28 UTC (rev 3507)
@@ -182,20 +182,20 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#addContents(org.jboss.declarchive.api.Archive)
+ * @see org.jboss.declarchive.api.Archive#merge(org.jboss.declarchive.api.Archive)
*/
@Override
- public T addContents(final Archive<?> source) throws IllegalArgumentException
+ public T merge(final Archive<?> source) throws IllegalArgumentException
{
- return addContents(new BasicPath(), source);
+ return merge(new BasicPath(), source);
}
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#addContents(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Archive)
+ * @see org.jboss.declarchive.api.Archive#merge(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Archive)
*/
@Override
- public T addContents(final Path path, final Archive<?> source) throws IllegalArgumentException
+ public T merge(final Path path, final Archive<?> source) throws IllegalArgumentException
{
// Precondition checks
Validate.notNull(path, "No path was specified");
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ContainerBase.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ContainerBase.java 2009-09-02 18:25:49 UTC (rev 3506)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ContainerBase.java 2009-09-02 18:39:28 UTC (rev 3507)
@@ -133,19 +133,19 @@
}
/* (non-Javadoc)
- * @see org.jboss.declarchive.api.Archive#addContents(org.jboss.declarchive.api.Archive)
+ * @see org.jboss.declarchive.api.Archive#merge(org.jboss.declarchive.api.Archive)
*/
@Override
- public T addContents(Archive<?> source) throws IllegalArgumentException
+ public T merge(Archive<?> source) throws IllegalArgumentException
{
- archive.addContents(source);
+ archive.merge(source);
return covarientReturn();
}
@Override
- public T addContents(Path path, Archive<?> source) throws IllegalArgumentException
+ public T merge(Path path, Archive<?> source) throws IllegalArgumentException
{
- archive.addContents(path, source);
+ archive.merge(path, source);
return covarientReturn();
}
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java 2009-09-02 18:25:49 UTC (rev 3506)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java 2009-09-02 18:39:28 UTC (rev 3507)
@@ -353,16 +353,16 @@
}
/**
- * Ensure adding content requires a source archive
+ * Ensure merging content requires a source archive
* @throws Exception
*/
@Test
- public void testAddContentsRequiresSource() throws Exception
+ public void testMergeRequiresSource() throws Exception
{
Archive<T> archive = getArchive();
try
{
- archive.addContents(null);
+ archive.merge(null);
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
@@ -371,11 +371,11 @@
}
/**
- * Ensure adding content from another archive successfully stores all assets
+ * Ensure merging content from another archive successfully stores all assets
* @throws Exception
*/
@Test
- public void testAddContents() throws Exception
+ public void testMerge() throws Exception
{
Archive<T> archive = getArchive();
Archive<T> sourceArchive = createNewArchive();
@@ -386,7 +386,7 @@
Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
sourceArchive.add(location, asset).add(locationTwo, assetTwo);
- archive.addContents(sourceArchive);
+ archive.merge(sourceArchive);
Assert.assertTrue("Asset should have been added to path: " + location.get(), this.compareAssets(archive
.get(location), asset));
@@ -395,11 +395,11 @@
}
/**
- * Ensure adding content from another archive to a path successfully stores all assets to specific path
+ * Ensure merging content from another archive to a path successfully stores all assets to specific path
* @throws Exception
*/
@Test
- public void testAddContentsToPath() throws Exception
+ public void testMergeToPath() throws Exception
{
Archive<T> archive = getArchive();
Archive<T> sourceArchive = createNewArchive();
@@ -412,7 +412,7 @@
Path baseLocation = new BasicPath("somewhere");
- archive.addContents(baseLocation, sourceArchive);
+ archive.merge(baseLocation, sourceArchive);
Path expectedPath = new BasicPath(baseLocation, location);
Path expectedPathTwo = new BasicPath(baseLocation, locationTwo);
@@ -425,16 +425,16 @@
}
/**
- * Ensure adding content from another archive requires a path
+ * Ensure merging content from another archive requires a path
* @throws Exception
*/
@Test
- public void testAddContentsToPathRequiresPath() throws Exception
+ public void testMergeToPathRequiresPath() throws Exception
{
Archive<T> archive = getArchive();
try
{
- archive.addContents(null, createNewArchive());
+ archive.merge(null, createNewArchive());
Assert.fail("Should have throw an IllegalArgumentException");
}
catch (IllegalArgumentException expectedException)
More information about the jboss-svn-commits
mailing list