commit 1e2a4e55af3cfdf64621d05e05f5ef16b0902013
Author:     Alexander Lehmann <[email protected]>
AuthorDate: Sat, 22 Dec 2012 23:10:59 +0100
Commit:     Mauro Talevi <[email protected]>
CommitDate: Sun, 23 Dec 2012 00:20:16 +0100

    JBEHAVE-872: StoryFinder.findPaths is missing the parameter (URL, List, 
List)
    
    added method with signature (URL, List, List)
    added unit test to check for nonexistent jar file in JarFileScannerBehaviour

diff --git a/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java 
b/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java
index 0973957..1475503 100755
--- a/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java
+++ b/jbehave-core/src/main/java/org/jbehave/core/io/StoryFinder.java
@@ -76,6 +76,22 @@ public class StoryFinder {
     }
 
     /**
+     * Finds paths from a source URL, allowing for includes/excludes,
+     * pattern. Paths found are normalised by {@link
+     * StoryFinder#normalise(List<String>)}
+     * 
+     * @param searchIn the source URL to search in
+     * @param includes the List of include patterns, or <code>null</code> if
+     *            none
+     * @param excludes the List of exclude patterns, or <code>null</code> if
+     *            none
+     * @return A List of paths found
+     */
+    public List<String> findPaths(URL searchIn, List<String> includes, 
List<String> excludes) {
+        return findPaths(CodeLocations.getPathFromURL(searchIn), includes, 
excludes);
+    }
+
+    /**
      * Finds paths from a source path, allowing for single include/exclude
      * pattern. Paths found are normalised by {@link
      * StoryFinder#normalise(List<String>)}
diff --git 
a/jbehave-core/src/test/java/org/jbehave/core/io/JarFileScannerBehaviour.java 
b/jbehave-core/src/test/java/org/jbehave/core/io/JarFileScannerBehaviour.java
index 43471ea..ee85430 100644
--- 
a/jbehave-core/src/test/java/org/jbehave/core/io/JarFileScannerBehaviour.java
+++ 
b/jbehave-core/src/test/java/org/jbehave/core/io/JarFileScannerBehaviour.java
@@ -47,6 +47,11 @@ public class JarFileScannerBehaviour {
                 hasItems("etsy_browse.story", "etsy_cart.story", 
"etsy_search.story", "etsy-steps.xml"));
     }
 
+    @Test(expected=IllegalStateException.class)
+    public void shouldThrowIllegalArgument() {
+        scan("nonexistent.jar", "", "");
+    }
+
     private List<String> scan(String jarPath, String includes, String 
excludes) {
         return new JarFileScanner(jarPath, includes, excludes).scan();
     }



Reply via email to