Repository: maven-plugin-testing
Updated Branches:
  refs/heads/master 3cd5f47c5 -> bc3583495


MPLUGINTESTING-43 TestResources#create convenience method

Signed-off-by: Igor Fedorenko <ifedore...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/commit/1f5a4769
Tree: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/tree/1f5a4769
Diff: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/diff/1f5a4769

Branch: refs/heads/master
Commit: 1f5a4769859d20363f0924418017fe92a9bba297
Parents: 3cd5f47
Author: Igor Fedorenko <ifedore...@apache.org>
Authored: Tue Jul 8 12:47:22 2014 +0400
Committer: Igor Fedorenko <ifedore...@apache.org>
Committed: Tue Jul 8 13:48:48 2014 +0400

----------------------------------------------------------------------
 .../plugin/testing/resources/TestResources.java  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/1f5a4769/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java
----------------------------------------------------------------------
diff --git 
a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java
 
b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java
index 378c03e..c3f41e7 100644
--- 
a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java
+++ 
b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/resources/TestResources.java
@@ -171,4 +171,23 @@ public class TestResources
         Assert.assertTrue( "delete " + path, new File( basedir, path 
).delete() );
     }
 
+    /**
+     * @since 3.2.0
+     */
+    public static void create( File basedir, String... paths )
+        throws IOException
+    {
+        if ( paths == null || paths.length == 0 )
+        {
+            throw new IllegalArgumentException();
+        }
+        for ( String path : paths )
+        {
+            File file = new File( basedir, path );
+            Assert.assertTrue( file.getParentFile().mkdirs() );
+            file.createNewFile();
+            Assert.assertTrue( file.isFile() && file.canRead() );
+        }
+    }
+
 }

Reply via email to