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 2016/03/15 18:02:17 UTC
svn commit: r982865 - in /websites/staging/sling/trunk/content: ./
documentation/bundles/org-apache-sling-junit-bundles.html
documentation/development/sling-testing-tools.html
Author: buildbot
Date: Tue Mar 15 17:02:16 2016
New Revision: 982865
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
websites/staging/sling/trunk/content/documentation/development/sling-testing-tools.html
Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Mar 15 17:02:16 2016
@@ -1 +1 @@
-1734922
+1735142
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 Tue Mar 15 17:02:16 2016
@@ -194,9 +194,8 @@ between things like <code>@AfterClass</c
number of tests in our <code>launchpad/integration-tests</code> module. Moving to JUnit <code>Rules</code> as much as possible,
and combining them using JUnit's <code>RuleChain</code>, should help work around such limitations if they arise.</p>
<h3 id="more-details-on-the-junitservlet">More details on the JUnitServlet<a class="headerlink" href="#more-details-on-the-junitservlet" title="Permanent link">¶</a></h3>
-<p>To try the JUnitServlet interactively, you can install the
-<a href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests">org.apache.sling.testing.samples.sampletests</a>
-bundle, or any other bundle that contains tests and a <code>Sling-Test-Regexp</code> bundle header that points to them, as
+<p>To try the JUnitServlet interactively, you can install a
+bundle that contains tests and a <code>Sling-Test-Regexp</code> bundle header that points to them, as
described above. Or use the <code>TeleporterRule</code> and set a breakpoint in the tests execution, when the test bundle in
installed and listed by the test servlet.</p>
<p>To list the available tests, open <code>/system/sling/junit/</code> in your browser. The servlet shows available tests and allows
@@ -267,7 +266,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. 1718561 by bdelacretaz on Tue, 8 Dec 2015 11:05:58 +0000
+ Rev. 1735142 by bdelacretaz on Tue, 15 Mar 2016 17:02:01 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
Modified: websites/staging/sling/trunk/content/documentation/development/sling-testing-tools.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/development/sling-testing-tools.html (original)
+++ websites/staging/sling/trunk/content/documentation/development/sling-testing-tools.html Tue Mar 15 17:02:16 2016
@@ -143,13 +143,13 @@ Note that the JUnitServlet does not requ
For tighter integration with Sling, the alternate `SlingJUnitServlet` is registered with the `sling/junit/testing` resource type and `.junit` selector, if the bundle is running in a Sling system. Using this servlet instead of the plain JUnitServlet also allows Sling authentication to be used for running the tests, and the standard Sling request processing is used, including servlet filters for example.
</div>
-<p>To try the JUnitServlet interactively, install the <a href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests">org.apache.sling.testing.samples.sampletests</a> bundle.</p>
-<p>This bundle contains a number of test classes, which are registered with the <code>org.apache.sling.junit.core</code> services by way of the <code>Sling-Test-Regexp=.*Test</code> bundle header, defined in the bundle's <code>pom.xml</code>. The JUnit core services use this regular expression to select which classes of the test bundle should be executed as JUnit tests.</p>
+<p>To try the JUnitServlet interactively, install a bundle that contains tests registered via the <code>Sling-Test-Regexp=.*Test</code> bundle header. </p>
+<p>The JUnit core services use this regular expression to select which classes of the test bundle should be executed as JUnit tests.</p>
<p>To list the available tests, open http://localhost:8080/system/sling/junit/ . The servlet shows available tests, and allows you to execute them via a POST request.</p>
<p>Adding a path allows you to select a specific subset of tests, as in http://localhost:8080/system/sling/junit/org.apache.sling.junit.remote.html - the example integration tests described below use this to selectively execute server-side tests. The JUnitServlet provides various output formats, including in particular JSON, see http://localhost:8080/system/sling/junit/.json for example.</p>
<p>To supply tests from your own bundles, simply export the tests classes and add the <code>Sling-Test-Regexp</code> header to the bundle so that the Sling JUnit core services register them as tests.</p>
<h3 id="injection-of-osgi-services">Injection of OSGi services<a class="headerlink" href="#injection-of-osgi-services" title="Permanent link">¶</a></h3>
-<p>The <code>@TestReference</code> annotation is used to inject OSGi services in tests that are executed server side.The <code>BundleContext</code> can also be injected in this way, see the <a href="http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/OsgiAwareTest.java">OsgiAwareTest</a> for an example.</p>
+<p>The <code>@TestReference</code> annotation is used to inject OSGi services in tests that are executed server side.The <code>BundleContext</code> can also be injected in this way.</p>
<h2 id="curl-examples">Curl examples<a class="headerlink" href="#curl-examples" title="Permanent link">¶</a></h2>
<p>Here's an example executing a few tests using curl:</p>
<div class="codehilite"><pre>$ <span class="n">curl</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span>8080<span class="o">/</span><span class="n">system</span><span class="o">/</span><span class="n">sling</span><span class="o">/</span><span class="n">junit</span><span class="o">/</span><span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">sling</span><span class="p">.</span><span class="n">testing</span><span class="p">.</span><span class="n">samples</span><span class="p">.</span><span class="n">sampletests</span><span class="p">.</span><span class="n">JUnit</span><span class="p">.</span><span class="n">json</span>
@@ -250,7 +250,7 @@ for an example of how to do that.</p>
<p>the server start is interrupted until a debugger is connected on port 8000.</p>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
- Rev. 1704503 by bdelacretaz on Tue, 22 Sep 2015 09:58:34 +0000
+ Rev. 1735142 by bdelacretaz on Tue, 15 Mar 2016 17:02:01 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project