You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2015/11/19 22:24:29 UTC
svn commit: r972992 - in /websites/staging/sling/trunk/content: ./
documentation/bundles/org-apache-sling-junit-bundles.html
Author: buildbot
Date: Thu Nov 19 21:24:29 2015
New Revision: 972992
Log:
Staging update by buildbot for sling
Modified:
websites/staging/sling/trunk/content/ (props changed)
websites/staging/sling/trunk/content/documentation/bundles/org-apache-sling-junit-bundles.html
Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Nov 19 21:24:29 2015
@@ -1 +1 @@
-1714784
+1715283
Modified: websites/staging/sling/trunk/content/documentation/bundles/org-apache-sling-junit-bundles.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/org-apache-sling-junit-bundles.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/org-apache-sling-junit-bundles.html Thu Nov 19 21:24:29 2015
@@ -171,6 +171,17 @@ selection, like for example:</p>
</pre></div>
+<p>And starting with version 1.0.4 of the <code>org.apache.sling.junit.teleporter</code> bundle, you can specify
+resource to embed in the test bundle, as in this example:</p>
+<div class="codehilite"><pre><span class="p">@</span><span class="n">Rule</span>
+<span class="n">public</span> <span class="n">final</span> <span class="n">TeleporterRule</span> <span class="n">teleporter</span> <span class="p">=</span>
+ <span class="n">TeleporterRule</span><span class="p">.</span><span class="n">forClass</span><span class="p">(</span><span class="n">getClass</span><span class="p">(),</span> "<span class="n">Launchpad</span>"<span class="p">)</span>
+ <span class="p">.</span><span class="n">withResources</span><span class="p">(</span>"<span class="o">/</span><span class="n">foo</span><span class="o">/</span>"<span class="p">,</span> "<span class="o">/</span><span class="n">some</span><span class="o">/</span><span class="n">other</span><span class="o">/</span><span class="n">resource</span><span class="p">.</span><span class="n">txt</span>"<span class="p">);</span>
+</pre></div>
+
+
+<p>which will embed all resources found under <code>/foo</code> as well as the <code>resource.txt</code> in the test
+bundle, making them available to the server-side tests.</p>
<p>This teleporter mechanism is used in our integration tests, search for <code>TeleporterRule</code> in there
for examples or look at the
<a href="https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/teleporter"><code>integrationtest.teleporter</code></a>
@@ -253,7 +264,7 @@ same request again. </p>
but using the newer <code>TeleporterRule</code> described above is much simpler. As a result, this bundle
should only be needed for existing tests that were written using its mechanisms. </p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
- Rev. 1704887 by bdelacretaz on Wed, 23 Sep 2015 15:45:54 +0000
+ Rev. 1715283 by bdelacretaz on Thu, 19 Nov 2015 21:24:08 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project