SLING-5294 - TeleporterRule.withResources(...) implemented, with integration tests
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1715072 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 45038e4..7134401 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
<Bundle-Activator>org.apache.sling.junit.Activator</Bundle-Activator>
<Export-Package>
org.apache.sling.junit;version=1.1.0,
- org.apache.sling.junit.rules;version=1.2.0,
+ org.apache.sling.junit.rules;version=1.3.0,
org.apache.sling.junit.annotations;version=1.0.8,
</Export-Package>
<_exportcontents>
diff --git a/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java b/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java
index abf13b1..9660093 100644
--- a/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java
+++ b/src/main/java/org/apache/sling/junit/rules/TeleporterRule.java
@@ -16,6 +16,9 @@
*/
package org.apache.sling.junit.rules;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.sling.junit.Activator;
import org.junit.rules.ExternalResource;
@@ -42,6 +45,7 @@
void customize(TeleporterRule t, String options);
}
private String clientSetupOptions;
+ protected List<String> embeddedResourcePaths = new ArrayList<String>();
/** Meant to be instantiated via {@link #forClass} */
protected TeleporterRule() {
@@ -129,4 +133,14 @@
public <T> T getService (Class<T> serviceClass, String ldapFilter) {
throw new UnsupportedOperationException("This TeleporterRule does not implement getService()");
}
+
+ /** 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
+ * to be recursively embedded as well.
+ */
+ public TeleporterRule withResources(String path) {
+ embeddedResourcePaths.add(path);
+ return this;
+ }
}