[jboss-svn-commits] JBoss Common SVN: r3758 - shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 19 03:37:01 EST 2009


Author: aslak
Date: 2009-11-19 03:37:01 -0500 (Thu, 19 Nov 2009)
New Revision: 3758

Modified:
   shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ExplodedExporterTestCase.java
Log:
SHRINKWRAP-84 TestCase that expose bug

Modified: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ExplodedExporterTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ExplodedExporterTestCase.java	2009-11-18 21:39:02 UTC (rev 3757)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ExplodedExporterTestCase.java	2009-11-19 08:37:01 UTC (rev 3758)
@@ -205,6 +205,35 @@
       archive.as(ExplodedExporter.class).exportExploded(directory);
    }
 
+   /**
+    * https://jira.jboss.org/jira/browse/SHRINKWRAP-84
+    * <br/>
+    * Should be able to use a existing directory as parent directory for ExplodedExports
+    */
+   @Test
+   public void testShouldBeAbleToUseExistingDirectoryAsParent() throws Exception 
+   {
+      Archive<?> archive = createArchiveWithAssets();
+      
+      File existingParentFolder = new File("target/");
+      existingParentFolder.mkdirs();
+      Assert.assertTrue(
+            "Internal error, the directory need to exist for test case to work", 
+            existingParentFolder.exists());
+
+      File archiveFolder = new File(existingParentFolder, archive.getName());
+      archiveFolder.mkdirs();
+      Assert.assertTrue(
+            "Internal error, the directory need to exist for test case to work", 
+            existingParentFolder.exists());
+
+      archive.as(ExplodedExporter.class).exportExploded(existingParentFolder);
+      
+      Assert.assertTrue(
+            "A subfolder with archive name should have been created", 
+            new File(existingParentFolder, archive.getName()).exists());
+   }
+   
    //-------------------------------------------------------------------------------------||
    // Internal Helper Methods ------------------------------------------------------------||
    //-------------------------------------------------------------------------------------||
@@ -242,5 +271,4 @@
       byte[] actualContents = IOUtil.asByteArray(inputStream);
       Assert.assertArrayEquals(expectedContents, actualContents);
    }
-
 }



More information about the jboss-svn-commits mailing list