This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.testing.paxexam-0.0.2 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-paxexam.git
commit ec9929662d8f75e8bd6ef7a0a405c07cd994cfac Author: Oliver Lietz <[email protected]> AuthorDate: Thu Jul 28 10:27:29 2016 +0000 add Getting Started git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/org.apache.sling.testing.paxexam@1754388 13f79535-47bb-0310-9956-ffa450edef68 --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index 97d829b..5d82d97 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,54 @@ Apache Sling Testing Pax Exam **Test support for use with Pax Exam.** * _Sling's Launchpad Karaf Features_ as `Option`s for Pax Exam (without Karaf) + +Getting Started +--------------- + +Configure the build artifact (*bundle*) to use in integration testing in `pom.xml`: + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.18.1</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + <configuration> + <systemProperties> + <property> + <name>bundle.filename</name> + <value>${basedir}/target/${project.build.finalName}.jar</value> + </property> + </systemProperties> + </configuration> + </plugin> + +Create a test class (extend `TestSupport` to use helper methods and `Option`s) and provide a *Configuration* (`Option[]`) for Pax Exam: + + @Configuration + public Option[] configuration() { + return new Option[]{ + baseConfiguration(), // from TestSupport + launchpad(), + // build artifact + testBundle("bundle.filename"), // from TestSupport + // testing + junitBundles() + }; + } + + protected Option launchpad() { + final String workingDirectory = workingDirectory(); // from TestSupport + final int httpPort = findFreePort(); // from TestSupport + return composite( + slingLaunchpadOakTar(workingDirectory, httpPort), // from SlingOptions + slingExtensionModels(), // from SlingOptions (for illustration) + slingScriptingThymeleaf() // from SlingOptions (for illustration) + ); + } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
