Author: bdelacretaz Date: Thu Nov 19 02:43:52 2015 New Revision: 1715088 URL: http://svn.apache.org/viewvc?rev=1715088&view=rev Log: SLING-5294 - multiple parameters for withResources(...)
Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter/TeleportedResourcesSingleTest.java sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java Modified: sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter/TeleportedResourcesSingleTest.java URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter/TeleportedResourcesSingleTest.java?rev=1715088&r1=1715087&r2=1715088&view=diff ============================================================================== --- sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter/TeleportedResourcesSingleTest.java (original) +++ sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter/TeleportedResourcesSingleTest.java Thu Nov 19 02:43:52 2015 @@ -38,7 +38,7 @@ public class TeleportedResourcesSingleTe public final TeleporterRule teleporter = TeleporterRule .forClass(getClass(), "Launchpad") - .withResources("/teleporter/file2.txt"); + .withResources("/teleporter/file2.txt","/teleporter/subfolder/thirdfile.txt"); private void assertResource(String path, String expected) throws IOException { final InputStream is = getClass().getResourceAsStream(path); @@ -64,6 +64,6 @@ public class TeleportedResourcesSingleTe @Test public void testFile3() throws IOException { - assertNull(getClass().getResource("/teleporter/subfolder/thirdfile.txt")); + assertResource("/teleporter/subfolder/thirdfile.txt", "The third file"); } } Modified: sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java?rev=1715088&r1=1715087&r2=1715088&view=diff ============================================================================== --- sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java (original) +++ sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java Thu Nov 19 02:43:52 2015 @@ -136,11 +136,14 @@ public abstract class TeleporterRule ext /** Tell the concrete teleporter to embed resources, based on their path, in * the test bundle. - * @param path a path that ends with a / causes all resources found under it + * @param paths 0..N resource paths to add to the current rule. A path that + * ends with a / causes all resources found under it * to be recursively embedded as well. */ - public TeleporterRule withResources(String path) { - embeddedResourcePaths.add(path); + public TeleporterRule withResources(String ...paths) { + for(String path : paths) { + embeddedResourcePaths.add(path); + } return this; } }