Hi Bertrand, I'm excited to get started with using this framework for CQ 5.4 applications. I thought I'd jump in with the Scriptable Tests Provider, but I ran into a snag, identified by the following stack trace snippet:
27.04.2011 13:14:54.397 *ERROR* [0:0:0:0:0:0:0:1 [1303935294394] POST /system/sling/junit/org.apache.sling.junit.scriptable.ScriptableTestsProvider.json HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable java.lang.NullPointerException at org.apache.sling.engine.impl.parameters.ParameterSupport.getContainerParameters(ParameterSupport.java:154) at org.apache.sling.engine.impl.parameters.ParameterSupport.getRequestParameterMapInternal(ParameterSupport.java:119) at org.apache.sling.engine.impl.parameters.ParameterSupport.getParameter(ParameterSupport.java:85) at org.apache.sling.engine.impl.SlingHttpServletRequestImpl.getParameter(SlingHttpServletRequestImpl.java:143) at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServletStarterFilter.java:105) at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60) at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:161) at org.apache.sling.junit.scriptable.TestAllPaths.verifyContent(TestAllPaths.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... Here's what I did to get to this point: 1. Installed the following bundles, which are currently active: /apps/bundles/install/org.apache.sling.junit.core-1.0.6.jar /apps/bundles/install/org.apache.sling.junit.scriptable-1.0.6.jar /apps/bundles/install/org.apache.sling.junit.remote-1.0.6.jar 2. Created a simple test script JSP (prints "TEST_PASSED") at /apps/geometrixx/test-components/test-title/test.txt.jsp 3. Created an associated content node at /apps/geometrixx/test-content/example: jcr:primaryType="sling:Folder" jcr:mixinTypes="[sling:Test]" sling:resourceType="geometrixx/test-components/test-title" 4. Executed cURL: `curl -u admin:admin -X POST http://localhost:4502/system/sling/junit/org.apache.sling.junit.scriptable.ScriptableTestsProvider.json` 5. Got this response: [{ "INFO_TYPE": "test", "description": "verifyContent[0](org.apache.sling.junit.scriptable.TestAllPaths)", "failure": "verifyContent[0](org.apache.sling.junit.scriptable.TestAllPaths): Expecting HTTP status 200 for path /apps/geometrixx/test-content/example.test.txt expected:<200> but was:<500>" } ] 6. Looked for a cause for the 500 in error.log; Found the stacktrace I pasted above. Is there some other detail I'm missing? Mark Adamcin Acquity Group On Wed, Apr 27, 2011 at 5:30 AM, Bertrand Delacretaz <[email protected] > wrote: > The Apache Sling team is pleased to announce the release of the > following testing tools: > > Apache Sling Test Tools 1.0.2 > Apache Sling JUnit Core 1.0.6 > Apache Sling JUnit Remote Tests Runners 1.0.6 > Apache Sling JUnit Scriptable Tests Provider 1.0.6 > Apache Sling Sample Integration Tests 1.0.6 > Apache Sling Sample Server-Side Tests 1.0.6 > Apache Sling Failing Server-Side Tests 1.0.6 > > Apache Sling is a web framework that uses a Java Content Repository, > such as Apache Jackrabbit, to store and manage content. Sling > applications use either scripts or Java servlets, selected based on > simple name conventions, to process HTTP requests in a RESTful way. > > These modules provide a number of tools and libraries for unit and > integration testing of OSGi- based and RESTful application servers, > see http://sling.apache.org/site/sling-testing-tools.html for more > details. > > These releases are available from > http://sling.apache.org/site/downloads.cgi and from Maven: > > <dependency> > <groupId>org.apache.sling</groupId> > <artifactId>org.apache.sling.testing.tools</artifactId> > <version>1.0.2</version> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > <artifactId>org.apache.sling.junit.core</artifactId> > <version>1.0.6</version> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > <version>1.0.6</version> > <artifactId>org.apache.sling.junit.remote</artifactId> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > <artifactId>org.apache.sling.junit.scriptable</artifactId> > <version>1.0.6</version> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > > <artifactId>org.apache.sling.testing.samples.integrationtests</artifactId> > <version>1.0.6</version> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > > <artifactId>org.apache.sling.testing.samples.sampletests</artifactId> > <version>1.0.6</version> > </dependency> > <dependency> > <groupId>org.apache.sling</groupId> > > <artifactId>org.apache.sling.testing.samples.failingtests</artifactId> > <version>1.0.6</version> > </dependency> > > This is the first release of those modules. > > Enjoy! > > -The Sling team >
