You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2013/04/04 14:33:04 UTC

svn commit: r1464501 - /sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext

Author: bdelacretaz
Date: Thu Apr  4 12:33:04 2013
New Revision: 1464501

URL: http://svn.apache.org/r1464501
Log:
fix http links

Modified:
    sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext

Modified: sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext?rev=1464501&r1=1464500&r2=1464501&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext (original)
+++ sling/site/trunk/content/documentation/development/sling-testing-tools.mdtext Thu Apr  4 12:33:04 2013
@@ -8,14 +8,14 @@ Sling provides a number of testing tools
 
 This page describes those tools, and points to the bundles that implement them.
 
-The [testing/samples/integration-tests]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests.path }}) module demonstrates these tools, and is also meant as a sample project to show how to run integration tests for Sling-based applications.
+The [testing/samples/integration-tests]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests.path }}) module demonstrates these tools, and is also meant as a sample project to show how to run integration tests for Sling-based applications.
 
-The main Sling integration tests at [launchpad/integration-tests]({{ refs.https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests.path }}) were created before this testing framework, and do not use it yet (as of March 2011). The new testing tools are simpler to use, but the "old" tests (all 400 of them as I write this) fulfill their validation role for testing Sling itself, there's no real need to modify them to use the new tools.
+The main Sling integration tests at [launchpad/integration-tests]({{ https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests.path }}) were created before this testing framework, and do not use it yet (as of March 2011). The new testing tools are simpler to use, but the "old" tests (all 400 of them as I write this) fulfill their validation role for testing Sling itself, there's no real need to modify them to use the new tools.
 
 See also [Testing Sling-based applications]({{ refs.testing-sling-based-applications.path }}) which discusses testing in general.
 
 # Server-side JUnit tests contributed by bundles
-The services provided by the [org.apache.sling.junit.core]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/junit/core.path }}) bundle allow bundles to register JUnit tests, which are executed server-side by the JUnitServlet registered by default at `/system/sling/junit`. This bundle is not dependent on Sling, it should work in other OSGi environments.
+The services provided by the [org.apache.sling.junit.core]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/junit/core.path }}) bundle allow bundles to register JUnit tests, which are executed server-side by the JUnitServlet registered by default at `/system/sling/junit`. This bundle is not dependent on Sling, it should work in other OSGi environments.
 
 <div class="warning">
 Note that the JUnitServlet does not require authentication, so it would allow any client to run tests. The servlet can be disabled by configuration if needed, but in general the `/system` path should not be accessible to website visitors anyway.
@@ -25,7 +25,7 @@ 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>
 
-To try the JUnitServlet interactively, install the [org.apache.sling.testing.samples.sampletests]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests.path }}) bundle.
+To try the JUnitServlet interactively, install the [org.apache.sling.testing.samples.sampletests]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests.path }}) bundle.
 
 This bundle contains a number of test classes, which are registered with the `org.apache.sling.junit.core` services by way of the `Sling-Test-Regexp=.*Test` bundle header, defined in the bundle's `pom.xml`. The JUnit core services use this regular expression to select which classes of the test bundle should be executed as JUnit tests.
 
@@ -36,7 +36,7 @@ Adding a path allows you to select a spe
 To supply tests from your own bundles, simply export the tests classes and add the `Sling-Test-Regexp` header to the bundle so that the Sling JUnit core services register them as tests.
 
 ### Injection of OSGi services
-The `@TestReference` annotation is used to inject OSGi services in tests that are executed server side.The `BundleContext` can also be injected in this way, see the [OsgiAwareTest]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/OsgiAwareTest.java.path }}) for an example.
+The `@TestReference` annotation is used to inject OSGi services in tests that are executed server side.The `BundleContext` can also be injected in this way, see the [OsgiAwareTest]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/samples/sample-tests/src/main/java/org/apache/sling/testing/samples/sampletests/OsgiAwareTest.java.path }}) for an example.
 
 ## Curl examples
 Here's an example executing a few tests using curl:
@@ -59,27 +59,27 @@ And another example with a test that fai
     $ curl -X POST http://localhost:8080/system/sling/junit/org.apache.sling.testing.samples.failingtests.JUnit4FailingTest.json
 
 # Scriptable server-side tests
-If the [org.apache.sling.junit.scriptable]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/junit/scriptable.path }}) bundle is active in a Sling system, (in addition to the `org.apache.sling.junit.core` bundle), scriptable tests can be executed by the `JUnitServlet` according to the following rules:
+If the [org.apache.sling.junit.scriptable]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/junit/scriptable.path }}) bundle is active in a Sling system, (in addition to the `org.apache.sling.junit.core` bundle), scriptable tests can be executed by the `JUnitServlet` according to the following rules:
 
 * A node that has the `sling:Test` mixin is a scriptable test node.
 * For security reasons, scriptable test nodes are only executed as tests if they are found under `/libs` or `/apps`, or more precisely under a path that's part of Sling's `ResourceResolver` search path.
 * To execute a test, the scriptable tests provider makes an HTTP requests to the test node's path, with a `.test.txt` selector and extension, and expects the output to contain only the string `TEST_PASSED`. Empty lines and comment lines starting with a hash sign (#) are ignored in the output, and other lines are reported as failures.
 
-The [ScriptableTestsTest]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/scriptable/ScriptableTestsTest.java.path }}) class, from the integration test samples module described below, sets up such a test node and its accompanying script, and calls the JUnitServlet to execute the test. It can be used as a detailed example of how this works.
+The [ScriptableTestsTest]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/scriptable/ScriptableTestsTest.java.path }}) class, from the integration test samples module described below, sets up such a test node and its accompanying script, and calls the JUnitServlet to execute the test. It can be used as a detailed example of how this works.
 
 # Integration tests example
-The [testing/samples/integration-tests]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests.path }}) module runs some simple integration tests against a Sling Launchpad instance that's setup from scratch before running the tests.
+The [testing/samples/integration-tests]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests.path }}) module runs some simple integration tests against a Sling Launchpad instance that's setup from scratch before running the tests.
 
 This module's pom and Java code can be used as examples to setup your own integration testing modules for Sling-based apps - or for any other runnable jar that provides an http service.
 
 Besides serving as examples, some of the tests in this module are used to validate the testing tools. They run as part of the full Sling [continuous integration]({{ refs.project-information.path }}) build, so they're guaranteed to be correct examples if that build is successful.
 
-The sample uses the [testing/tools]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/tools.path }}) to make the test code simpler. See the [OsgiConsoleTest|https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/http/OsgiConsoleTest.java] class for an example of a test that's very readable and requires no test setup or boilerplate code.
+The sample uses the [testing/tools]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/tools.path }}) to make the test code simpler. See the [OsgiConsoleTest|https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/http/OsgiConsoleTest.java] class for an example of a test that's very readable and requires no test setup or boilerplate code.
 
 The following steps are executed in the `integration-test` phase of this module's Maven  build:
 1. A random port number for the Sling server is selected by the Maven build helper plugin, unless explicitely set (see pom.xml for such options).
 1. Additional bundles, defined in the module's pom, are downloaded from the Maven repository in the `target/sling/additional-bundles` folder.
-1. The first test that inherits from the [SlingTestBase]({{ refs.https://svn.apache.org/repos/asf/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java.path }}) class causes the Sling runnable jar (defined as a dependency in the module's pom) to be started. 
+1. The first test that inherits from the [SlingTestBase]({{ https://svn.apache.org/repos/asf/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/sling/SlingTestBase.java.path }}) class causes the Sling runnable jar (defined as a dependency in the module's pom) to be started. 
 1. # The `SlingTestBase` class waits for the Sling server to be ready, based on URLs and expected responses defined in the pom.
 1. # The `SlingTestBase` class installs and starts the bundles found in the `target/sling/additional-bundles` folder.
 1. The test can now either test Sling directly via its http interface, or use the JUnitServlet to execute server-side tests contributed by bundles or scripts, as described above.
@@ -92,11 +92,11 @@ If `-DkeepJarRunning` is used on the Mav
 The testing tools support two types of remote test execution.
 
 ## SlingRemoteTestRunner
-The [SlingRemoteTestRunner]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java.path }}) is used to run tests using the `JUnitServlet` described above. In this case, the client-side JUnit test only defines which tests to run and some optional assertions. Checking the number of tests executed, for example, can be useful to make sure all test bundles have been activated as expected, to avoid ignoring missing test bundles.
+The [SlingRemoteTestRunner]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java.path }}) is used to run tests using the `JUnitServlet` described above. In this case, the client-side JUnit test only defines which tests to run and some optional assertions. Checking the number of tests executed, for example, can be useful to make sure all test bundles have been activated as expected, to avoid ignoring missing test bundles.
 
-See the [ServerSideSampleTest]({{ refs.https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java.path }}) class for an example.
+See the [ServerSideSampleTest]({{ https://svn.apache.org/repos/asf/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/integrationtests/serverside/ServerSideSampleTest.java.path }}) class for an example.
 
 ## SlingRemoteExecutionRule
-The [SlingRemoteExecutionRule]({{ refs.http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java.path }}) is a JUnit Rule that allows tests to be executed remotely in a Sling instance from an IDE, assuming the test is available on both sides.
+The [SlingRemoteExecutionRule]({{ http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java.path }}) is a JUnit Rule that allows tests to be executed remotely in a Sling instance from an IDE, assuming the test is available on both sides.
 
-The [ExampleRemoteTest]({{ refs.https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java.path }}) class demonstrates this. To run it from your IDE, set the `sling.remote.test.url` in the IDE to the URL of the JUnitServlet, like http://localhost:8080/system/sling/junit for example.
+The [ExampleRemoteTest]({{ https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java.path }}) class demonstrates this. To run it from your IDE, set the `sling.remote.test.url` in the IDE to the URL of the JUnitServlet, like http://localhost:8080/system/sling/junit for example.