SLING-7192 - Move testing/samples to samples/testing
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1811942 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index db13262..23694af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,8 @@
<module>post-servlet-extensions</module>
<module>slingbucks</module>
<module>slingshot</module>
+ <module>testing/bundle-with-it</module>
+ <module>testing/module-with-it</module>
<module>usermanager-ui</module>
<module>webloader/service</module>
<module>webloader/ui</module>
diff --git a/testing/bundle-with-it/.gitignore b/testing/bundle-with-it/.gitignore
new file mode 100644
index 0000000..3a86d90
--- /dev/null
+++ b/testing/bundle-with-it/.gitignore
@@ -0,0 +1 @@
+/sling/
diff --git a/testing/bundle-with-it/README.md b/testing/bundle-with-it/README.md
new file mode 100644
index 0000000..5b84de4
--- /dev/null
+++ b/testing/bundle-with-it/README.md
@@ -0,0 +1,3 @@
+# Apache Sling Testing - sample bundle with integration tests
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
diff --git a/testing/bundle-with-it/pom.xml b/testing/bundle-with-it/pom.xml
new file mode 100644
index 0000000..c1c31bf
--- /dev/null
+++ b/testing/bundle-with-it/pom.xml
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>26</version>
+ <relativePath/>
+ </parent>
+
+ <artifactId>org.apache.sling.samples.testing.bundle-with-it</artifactId>
+ <version>0.0.9-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>Apache Sling Testing - sample bundle with integration tests</name>
+ <description>
+ Sample project that demonstrates a bundle with unit and integration
+ tests in the same Maven module, running against a full Sling instance.
+ Uses both HTTP-based and teleported server-side tests.
+ </description>
+
+ <properties>
+ <!-- Set this to run the server on a specific port
+ <http.port></http.port>
+ -->
+
+ <!-- Set this to run tests against an existing server instance -->
+ <keepJarRunning>false</keepJarRunning>
+
+ <!-- URL of a server against which to run tests -->
+ <test.server.url />
+
+ <!-- Set this to run tests against a specific hostname, if test.server.url is not set-->
+ <test.server.hostname />
+
+ <!-- Set this to use a different username for remote execution of sling junit tests -->
+ <test.server.username />
+
+ <!-- Set this to use a different password for remote execution of sling junit tests -->
+ <test.server.password />
+
+ <!-- Options for the VM that executes our runnable jar -->
+ <jar.executor.vm.options>-Xmx512m</jar.executor.vm.options>
+
+ <!-- Change this to use longer or shorter timeouts for testing -->
+ <sling.testing.timeout.multiplier>1.0</sling.testing.timeout.multiplier>
+
+ <!-- Set this to run the executable jar in a specified filesystem folder -->
+ <jar.executor.work.folder />
+
+ <!-- Options for the jar to execute. $JAREXEC_SERVER_PORT$ is replaced by the
+ selected port number -->
+ <jar.executor.jar.options>-p $JAREXEC_SERVER_PORT$</jar.executor.jar.options>
+
+ <!-- Filter IT -->
+ <sling.it.ignorelist>*.FilterIT#testShouldNotRun:test_filter</sling.it.ignorelist>
+ </properties>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/samples/bundle-with-tests</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/samples/bundle-with-tests</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/samples/bundle-with-tests</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <!-- sling folder is the workdir of the executable jar that we test -->
+ <include>sling/**</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>derby.log</exclude>
+ <exclude>sling/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-runnable-jar</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <includeArtifactIds>org.apache.sling.launchpad</includeArtifactIds>
+ <excludeTransitive>true</excludeTransitive>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>false</overWriteSnapshots>
+ </configuration>
+ </execution>
+ <execution>
+ <!--
+ Consider all dependencies as candidates to be installed
+ as additional bundles. We use system properties to define
+ which bundles to install in which order.
+ -->
+ <id>copy-additional-bundles</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <excludeTransitive>true</excludeTransitive>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>false</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- Find free ports to run our server -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>reserve-server-port</id>
+ <goals>
+ <goal>reserve-network-port</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <portNames>
+ <portName>http.port</portName>
+ </portNames>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <version>2.19.1</version>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <!--
+ TODO this is a fairly complicated setup, we might
+ switch to a Maven plugin using a Sling provisioning
+ model to start the server under test. The slingstart
+ plugin does this but currently requires a launchpad jar,
+ using a pure provisioning model startup would be more
+ flexible.
+ -->
+
+ <!-- if set, this prevents jar executor from starting Sling??
+ <test.server.url>${test.server.url}</test.server.url>
+ -->
+ <test.server.hostname>${test.server.hostname}</test.server.hostname>
+ <test.server.username>${test.server.username}</test.server.username>
+ <test.server.password>${test.server.password}</test.server.password>
+ <jar.executor.server.port>${http.port}</jar.executor.server.port>
+ <jar.executor.vm.options>${jar.executor.vm.options}</jar.executor.vm.options>
+ <jar.executor.jar.folder>${project.basedir}/target/dependency</jar.executor.jar.folder>
+ <jar.executor.jar.name.regexp>org.apache.sling.launchpad.*jar$</jar.executor.jar.name.regexp>
+ <jar.executor.work.folder>${jar.executor.work.folder}</jar.executor.work.folder>
+ <jar.executor.jar.options>${jar.executor.jar.options}</jar.executor.jar.options>
+ <additional.bundles.path>${project.build.directory}</additional.bundles.path>
+ <keepJarRunning>${keepJarRunning}</keepJarRunning>
+ <server.ready.timeout.seconds>60</server.ready.timeout.seconds>
+ <sling.testing.timeout.multiplier>${sling.testing.timeout.multiplier}</sling.testing.timeout.multiplier>
+ <server.ready.path.1>/:script src="system/sling.js"</server.ready.path.1>
+ <server.ready.path.2>/.explorer.html:href="/libs/sling/explorer/css/explorer.css"</server.ready.path.2>
+ <server.ready.path.3>/sling-test/sling/sling-test.html:Sling client library tests</server.ready.path.3>
+ <start.bundles.timeout.seconds>30</start.bundles.timeout.seconds>
+ <bundle.install.timeout.seconds>20</bundle.install.timeout.seconds>
+
+ <!--
+ Define additional bundles to install by specifying the beginning of their artifact name.
+ The bundles are installed in lexical order of these property names.
+ All bundles must be listed as dependencies in this pom, or they won't be installed.
+ -->
+ <sling.additional.bundle.1>org.apache.sling.junit.core</sling.additional.bundle.1>
+
+ <!-- Install this bundle for integration tests -->
+ <sling.additional.bundle.2>${project.artifactId}-${project.version}.jar</sling.additional.bundle.2>
+
+ <!-- Test the Filter rule -->
+ <sling.it.ignorelist>${sling.it.ignorelist}</sling.it.ignorelist>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.4.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.mime</artifactId>
+ <version>2.1.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.junit.core</artifactId>
+ <version>1.0.14</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.rules</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.junit.teleporter</artifactId>
+ <version>1.0.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.launchpad</artifactId>
+ <version>8</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/ResourceMimeTypeDetector.java b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/ResourceMimeTypeDetector.java
new file mode 100644
index 0000000..52f7747
--- /dev/null
+++ b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/ResourceMimeTypeDetector.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit.api;
+
+import org.apache.sling.api.resource.Resource;
+
+/** A simplistic service that computes the mime-type of
+ * a Resource based on its path.
+ */
+public interface ResourceMimeTypeDetector {
+ String getMimeType(Resource r);
+}
diff --git a/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/package-info.java b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/package-info.java
new file mode 100644
index 0000000..8a226db
--- /dev/null
+++ b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/api/package-info.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.testing.samples.bundlewit.api;
+
+import aQute.bnd.annotation.Version;
+
diff --git a/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/MimeTypeServlet.java b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/MimeTypeServlet.java
new file mode 100644
index 0000000..8e3a7b8
--- /dev/null
+++ b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/MimeTypeServlet.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit.impl;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.sling.SlingServlet;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
+import org.apache.sling.testing.samples.bundlewit.api.ResourceMimeTypeDetector;
+
+/** Servlet that uses the ResourceMimeTypeDetector to output
+ * the mime-type of the current Resource.
+ */
+@SlingServlet(
+ resourceTypes="sling/servlet/default",
+ selectors="mimetype",
+ extensions="txt",
+ methods="GET")
+public class MimeTypeServlet extends SlingSafeMethodsServlet {
+ private static final long serialVersionUID = 7373752152329079226L;
+
+ public static final String PREFIX = MimeTypeServlet.class.getSimpleName() + " mime-type is ";
+
+ @Reference
+ ResourceMimeTypeDetector detector;
+
+ @Override
+ protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/plain");
+ response.setCharacterEncoding("UTF-8");
+ final String mimeType = detector.getMimeType(request.getResource());
+ response.getWriter().write(PREFIX);
+ response.getWriter().write(String.valueOf(mimeType));
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/ResourceMimeTypeDetectorImpl.java b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/ResourceMimeTypeDetectorImpl.java
new file mode 100644
index 0000000..c69dd74
--- /dev/null
+++ b/testing/bundle-with-it/src/main/java/org/apache/sling/testing/samples/bundlewit/impl/ResourceMimeTypeDetectorImpl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit.impl;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.commons.mime.MimeTypeService;
+import org.apache.sling.testing.samples.bundlewit.api.ResourceMimeTypeDetector;
+
+/** ResourceMimeTypeDetector that uses the Sling
+ * MimeTypeService.
+ */
+@Component
+@Service(value=ResourceMimeTypeDetector.class)
+public class ResourceMimeTypeDetectorImpl implements ResourceMimeTypeDetector {
+
+ @Reference
+ MimeTypeService mimeTypeService;
+
+ public String getMimeType(Resource r) {
+ return mimeTypeService.getMimeType(r.getPath());
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/junit/teleporter/customizers/BWIT_TeleporterCustomizer.java b/testing/bundle-with-it/src/test/java/org/apache/sling/junit/teleporter/customizers/BWIT_TeleporterCustomizer.java
new file mode 100644
index 0000000..5e4ddd4
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/junit/teleporter/customizers/BWIT_TeleporterCustomizer.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.teleporter.customizers;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.apache.sling.testing.clients.util.TimeoutsProvider;
+import org.apache.sling.testing.serversetup.instance.SlingTestBase;
+import org.apache.sling.testing.teleporter.client.ClientSideTeleporter;
+
+import aQute.bnd.osgi.Constants;
+
+/** This is required by the TeleporterRule, to setup the client-side
+ * teleporter with (at least) the test server URL.
+ */
+public class BWIT_TeleporterCustomizer implements TeleporterRule.Customizer {
+
+ private final static SlingTestBase S = new SlingTestBase();
+
+ @Override
+ public void customize(TeleporterRule t, String options) {
+ final ClientSideTeleporter cst = (ClientSideTeleporter)t;
+ cst.setBaseUrl(S.getServerBaseUrl());
+ cst.setServerCredentials(S.getServerUsername(), S.getServerPassword());
+ cst.setTestReadyTimeoutSeconds(TimeoutsProvider.getInstance().getTimeout(5));
+
+ // Make sure our bundle API is imported instead of embedded
+ final String apiPackage = "org.apache.sling.testing.samples.bundlewit.api";
+ cst.includeDependencyPrefix("org.apache.sling.testing.samples.bundlewit");
+ cst.includeDependencyPrefix("org.apache.http.concurrent");
+ cst.includeDependencyPrefix("org.apache.sling.testing.clients");
+ cst.includeDependencyPrefix("org.apache.sling.testing.junit.rules");
+ cst.includeDependencyPrefix("org.apache.sling.testing.serversetup");
+ cst.excludeDependencyPrefix(apiPackage);
+ cst.getAdditionalBundleHeaders().put(Constants.IMPORT_PACKAGE, apiPackage);
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/BasicTeleportedIT.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/BasicTeleportedIT.java
new file mode 100644
index 0000000..bec55d9
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/BasicTeleportedIT.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.io.IOException;
+import java.util.UUID;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+/** Basic teleported server-side test, demonstrates how
+ * these work.
+ * This is a general Sling test, it does not test anything
+ * from this bundle.
+ */
+public class BasicTeleportedIT {
+ @Rule
+ public final TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "BWIT_Teleporter");
+
+ @Test
+ public void testConfigAdmin() throws IOException {
+ final String pid = "TEST_" + getClass().getName() + UUID.randomUUID();
+
+ // demonstrate that we can access OSGi services from such
+ // teleported tests
+ final ConfigurationAdmin ca = teleporter.getService(ConfigurationAdmin.class);
+ assertNotNull("Teleporter should provide a ConfigurationAdmin", ca);
+
+ final Configuration cfg = ca.getConfiguration(pid);
+ assertNotNull("Expecting to get a Configuration", cfg);
+ assertEquals("Expecting the correct pid", pid, cfg.getPid());
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/FilterIT.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/FilterIT.java
new file mode 100644
index 0000000..b4a20b6
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/FilterIT.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.sling.testing.samples.bundlewit;
+
+import org.junit.Assert;
+import org.apache.sling.testing.junit.rules.SlingClassRule;
+import org.apache.sling.testing.junit.rules.SlingRule;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class FilterIT {
+
+ @ClassRule
+ public static SlingClassRule classRule = new SlingClassRule();
+
+ @Rule
+ public SlingRule methodRule = new SlingRule();
+
+ @Test
+ public void testShouldRun() {
+ System.out.println("test should run");
+ }
+
+ @Test
+ // This test should be skipped by the FilterRule inside the SlingRule
+ // The "sling.it.ignorelist" property should be set to "*.FilterIT#testShouldNotRun"
+ public void testShouldNotRun() {
+ System.out.println("ignorelist: " + System.getProperty("sling.it.ignorelist"));
+ Assert.fail("Test should be filtered out by SlingRule");
+ }
+}
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MimeTypeServletHttpIT.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MimeTypeServletHttpIT.java
new file mode 100644
index 0000000..11f8d50
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MimeTypeServletHttpIT.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import org.apache.sling.testing.clients.SlingClient;
+import org.apache.sling.testing.clients.SlingHttpResponse;
+import org.apache.sling.testing.junit.rules.SlingInstanceRule;
+import org.apache.sling.testing.junit.rules.SlingRule;
+import org.apache.sling.testing.samples.bundlewit.impl.MimeTypeServlet;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+/** HTTP test of the MimeTypeServlet provided
+ * by this bundle.
+ */
+public class MimeTypeServletHttpIT {
+
+ @ClassRule
+ public static SlingInstanceRule slingInstanceRule = new SlingInstanceRule();
+
+ @Rule
+ public SlingRule slingMethodRule = new SlingRule(); // for demo purposes
+
+ private void assertMimeType(String path, String expected) throws Exception {
+ SlingClient client = slingInstanceRule.getAdminClient();
+ SlingHttpResponse response = client.doGet(path + ".mimetype.txt", 200);
+ response.checkContentContains(expected);
+ }
+
+ @Test
+ public void htmlResource() throws Exception {
+ assertMimeType("/index.html", MimeTypeServlet.PREFIX + "text/html");
+ }
+
+ @Test
+ public void noMimeTypeResource() throws Exception {
+ assertMimeType("/tmp", MimeTypeServlet.PREFIX + "text/plain");
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MockResource.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MockResource.java
new file mode 100644
index 0000000..20e200f
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/MockResource.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import java.util.Iterator;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceMetadata;
+import org.apache.sling.api.resource.ResourceResolver;
+
+/** TODO use a mock library - requires making it available server-side. */
+class MockResource implements Resource {
+
+ private final String path;
+
+ MockResource(String path) {
+ this.path = path;
+ }
+
+ @Override
+ public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
+ return null;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+ @Override
+ public Resource getParent() {
+ return null;
+ }
+
+ @Override
+ public Iterator<Resource> listChildren() {
+ return null;
+ }
+
+ @Override
+ public Iterable<Resource> getChildren() {
+ return null;
+ }
+
+ @Override
+ public Resource getChild(String relPath) {
+ return null;
+ }
+
+ @Override
+ public String getResourceType() {
+ return null;
+ }
+
+ @Override
+ public String getResourceSuperType() {
+ return null;
+ }
+
+ @Override
+ public boolean isResourceType(String resourceType) {
+ return false;
+ }
+
+ @Override
+ public ResourceMetadata getResourceMetadata() {
+ return null;
+ }
+
+ @Override
+ public ResourceResolver getResourceResolver() {
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/OsgiConsoleHttpIT.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/OsgiConsoleHttpIT.java
new file mode 100644
index 0000000..e71e562
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/OsgiConsoleHttpIT.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import org.apache.sling.testing.junit.rules.SlingInstanceRule;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+/** Simple HTTP test example, checks the validity of some
+ * OSGi webconsole URLs by GETting them and checking
+ * status code 200.
+ *
+ * This is a general Sling test, it does not test anything
+ * from this bundle.
+ */
+public class OsgiConsoleHttpIT {
+
+ @ClassRule
+ public static SlingInstanceRule slingInstanceRule = new SlingInstanceRule();
+
+ @Test
+ public void testSomeConsolePaths() throws Exception {
+ final String [] subpaths = {
+ "bundles",
+ "components",
+ "configMgr",
+ "config",
+ "licenses",
+ "logs",
+ "memoryusage",
+ "services"
+ };
+
+ for(String subpath : subpaths) {
+ final String path = "/system/console/" + subpath;
+ slingInstanceRule.getAdminClient().doGet(path, 200);
+ }
+ }
+}
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/ResourceMimeTypeDetectorIT.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/ResourceMimeTypeDetectorIT.java
new file mode 100644
index 0000000..1fa613d
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/ResourceMimeTypeDetectorIT.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.apache.sling.testing.samples.bundlewit.api.ResourceMimeTypeDetector;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/** Server-side test of the ResourceMimeTypeDetector
+ * provided by this bundle */
+public class ResourceMimeTypeDetectorIT {
+
+ private ResourceMimeTypeDetector detector;
+
+ @Rule
+ public final TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "BWIT_Teleporter");
+
+ @Before
+ public void setup() {
+ detector = teleporter.getService(ResourceMimeTypeDetector.class);
+ }
+
+ @Test
+ public void textHtml() throws IOException {
+ assertEquals("text/html", detector.getMimeType(new MockResource("/someResource.html")));
+ }
+
+ @Test
+ public void nullMimeType() throws IOException {
+ assertEquals(null, detector.getMimeType(new MockResource("/someResourceWithNoExtension")));
+ }
+}
\ No newline at end of file
diff --git a/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/SampleUnitTest.java b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/SampleUnitTest.java
new file mode 100644
index 0000000..e2245ad
--- /dev/null
+++ b/testing/bundle-with-it/src/test/java/org/apache/sling/testing/samples/bundlewit/SampleUnitTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.bundlewit;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.sling.testing.samples.bundlewit.impl.ResourceMimeTypeDetectorImpl;
+import org.junit.Test;
+
+/** Unit tests can coexist with integration tests, even in
+ * the same package if that makes sense.
+ */
+public class SampleUnitTest {
+ @Test
+ public void testNotMuch() {
+ assertNotNull(new ResourceMimeTypeDetectorImpl());
+ }
+}
\ No newline at end of file
diff --git a/testing/module-with-it/.gitignore b/testing/module-with-it/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/testing/module-with-it/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/testing/module-with-it/README.md b/testing/module-with-it/README.md
new file mode 100644
index 0000000..ff93451
--- /dev/null
+++ b/testing/module-with-it/README.md
@@ -0,0 +1,3 @@
+# Apache Sling Testing - sample module with integration tests
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
diff --git a/testing/module-with-it/pom.xml b/testing/module-with-it/pom.xml
new file mode 100644
index 0000000..6ca2884
--- /dev/null
+++ b/testing/module-with-it/pom.xml
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>26</version>
+ <relativePath/>
+ </parent>
+
+ <artifactId>org.apache.sling.samples.testing.module-with-it</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging> <!-- means the launchpad is configured in /src/main/provisioning, extends classpath -->
+
+ <name>Apache Sling Testing - sample module with integration tests</name>
+ <description>Sample project that demonstrates a module with integration
+ tests, running against a Sling instance being started via slingstart-maven-plugin.
+ Uses teleported server-side tests. It is leveraging the DefaultPropertyBasedCustomizer,
+ i.e. system properties influence the teleporter behaviour instead of code</description>
+
+ <properties>
+ <sling.java.version>7</sling.java.version>
+ <http.host>localhost</http.host>
+ <sling.default.vm.options>-Xmx1024m -XX:MaxPermSize=256m -Djava.awt.headless=true</sling.default.vm.options>
+ <slf4j.version>1.7.6</slf4j.version>
+ </properties>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/samples/module-with-it</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/samples/module-with-it</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/samples/module-with-it</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <!-- Find free ports to run our server -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>reserve-server-port</id>
+ <goals>
+ <goal>reserve-network-port</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <portNames>
+ <!-- used port name must be stored in property because it must be used for the base url -->
+ <portName>http.port</portName>
+ </portNames>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!-- the Sling instance is provisioned from the model in src/main/provisioning/model.txt -->
+ <groupId>org.apache.sling</groupId>
+ <artifactId>slingstart-maven-plugin</artifactId>
+ <version>1.7.0</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>prepare-launchpad-package</id>
+ <goals>
+ <goal>prepare-package</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>build-launchpad-package</id>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>start-container-before-IT</id>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container-after-IT</id>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+
+
+ </executions>
+ <configuration>
+ <servers>
+ <server>
+ <id>singleinstance</id>
+ <port>${http.port}</port>
+ <vmOpts>${sling.vm.options}</vmOpts>
+ </server>
+ </servers>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>verify</id>
+ <goals>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <systemPropertyVariables>
+ <ClientSideTeleporter.baseUrl>http://${http.host}:${http.port}/</ClientSideTeleporter.baseUrl>
+ <ClientSideTeleporter.testReadyTimeoutSeconds>20</ClientSideTeleporter.testReadyTimeoutSeconds>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- the SLF4J version must match the one from the used slingstart model -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.4.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.junit.core</artifactId>
+ <version>1.0.24-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.junit.teleporter</artifactId>
+ <version>1.0.7-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/testing/module-with-it/src/test/java/org/apache/sling/testing/samples/modulewit/BasicTeleportedIT.java b/testing/module-with-it/src/test/java/org/apache/sling/testing/samples/modulewit/BasicTeleportedIT.java
new file mode 100644
index 0000000..e1265dd
--- /dev/null
+++ b/testing/module-with-it/src/test/java/org/apache/sling/testing/samples/modulewit/BasicTeleportedIT.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.testing.samples.modulewit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.util.UUID;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+/** Basic teleported server-side test, demonstrates how
+ * these work.
+ * This is a general Sling test, it does not test anything
+ * from this bundle.
+ */
+public class BasicTeleportedIT {
+
+ @Rule
+ public final TeleporterRule teleporter = TeleporterRule.forClass(getClass());
+
+ @Test
+ public void testConfigAdmin() throws IOException {
+ final String pid = "TEST_" + getClass().getName() + UUID.randomUUID();
+
+ // demonstrate that we can access OSGi services from teleported tests
+ final ConfigurationAdmin ca = teleporter.getService(ConfigurationAdmin.class);
+ assertNotNull("Teleporter should provide a ConfigurationAdmin", ca);
+
+ final Configuration cfg = ca.getConfiguration(pid);
+ assertNotNull("Expecting to get a Configuration", cfg);
+ assertEquals("Expecting the correct pid", pid, cfg.getPid());
+ }
+}
\ No newline at end of file
diff --git a/testing/module-with-it/src/test/provisioning/model.txt b/testing/module-with-it/src/test/provisioning/model.txt
new file mode 100644
index 0000000..0a13e15
--- /dev/null
+++ b/testing/module-with-it/src/test/provisioning/model.txt
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+[feature name=module-with-it]
+# Dependencies
+[artifacts]
+ org.apache.sling/org.apache.sling.launchpad/9/slingstart
+ # this is necessary to execute the tests
+ org.apache.sling/org.apache.sling.junit.core/1.0.24-SNAPSHOT
+
+# additional configuration for testing
+[configurations]
+ integrationTestsConfig
+ message="This test config should be loaded at startup"
+
+ org.apache.sling.servlets.resolver.SlingServletResolver
+ # Set the servlet resolver's cache size to zero for testing
+ servletresolver.cacheSize=I"0"
+
+[settings]
+ org.apache.sling.commons.log.julenabled=true