[
https://issues.apache.org/jira/browse/SLING-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990586#comment-12990586
]
Bertrand Delacretaz commented on SLING-1963:
--------------------------------------------
Added basic HTML rendering and test selection in revision 1067200.
I think tests should only executed on POST, as they might be costly. Right now
GET both lists and executes the tests.
Example URLs for test selection:
http://localhost:8080/system/sling/junit/
http://localhost:8080/system/sling/junit/org.apache.sling.junit.scriptable.html
http://localhost:8080/system/sling/junit/org.apache.sling.junit.scriptable.txt
> Support for server-side JUnit tests, injected in a running Sling instance
> -------------------------------------------------------------------------
>
> Key: SLING-1963
> URL: https://issues.apache.org/jira/browse/SLING-1963
> Project: Sling
> Issue Type: Improvement
> Reporter: Bertrand Delacretaz
> Assignee: Bertrand Delacretaz
>
> I've been working on a prototype JUnit extension framework [1] that allows
> JUnit tests to be injected in a Sling instance, and executed via a test
> runner servlet.
> Tests are not yet OSGi-aware in the first prototype, but they are dynamically
> injected as exported classes in a bundle that points to them with a
> Test-Package header. Apart from that they are 100% normal JUnit3 or 4 tests.
> Next step is to use annotations to inject services in the tests, I'm thinking
> of something like
> @TestReference
> SlingRepository repository
> And maybe
> @Test
> @OptionalTest(requiredService=repository)
> public void someTest()...
> which would ignore the test if the repository service is not present.
> The prototype consists of two bundles: "extension" which is the test
> detection and runner services, and "testbundle" which provides a few example
> tests. To play with it, install the two bundles and access the test servlet
> at /system/sling/junit/
> [1] http://svn.apache.org/repos/asf/sling/whiteboard/bdelacretaz/junit
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira