Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B19BC1022D for ; Fri, 24 Jan 2014 11:11:03 +0000 (UTC) Received: (qmail 4137 invoked by uid 500); 24 Jan 2014 11:11:02 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 4073 invoked by uid 500); 24 Jan 2014 11:11:01 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 4066 invoked by uid 99); 24 Jan 2014 11:11:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2014 11:11:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2014 11:10:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A0FDB2388860; Fri, 24 Jan 2014 11:10:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1560942 - in /sling/trunk/testing/sling-pax-util: pom.xml src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java Date: Fri, 24 Jan 2014 11:10:39 -0000 To: commits@sling.apache.org From: bdelacretaz@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140124111039.A0FDB2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bdelacretaz Date: Fri Jan 24 11:10:39 2014 New Revision: 1560942 URL: http://svn.apache.org/r1560942 Log: SLING-2788 - explain this better Modified: sling/trunk/testing/sling-pax-util/pom.xml sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java Modified: sling/trunk/testing/sling-pax-util/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/testing/sling-pax-util/pom.xml?rev=1560942&r1=1560941&r2=1560942&view=diff ============================================================================== --- sling/trunk/testing/sling-pax-util/pom.xml (original) +++ sling/trunk/testing/sling-pax-util/pom.xml Fri Jan 24 11:10:39 2014 @@ -27,6 +27,11 @@ jar Apache Sling Pax Exam Utilities + + + Utilities that make it easier to test Sling code with Pax Exam. + See this module's tests for usage examples. + UTF-8 Modified: sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java?rev=1560942&r1=1560941&r2=1560942&view=diff ============================================================================== --- sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java (original) +++ sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingRepositoryTest.java Fri Jan 24 11:10:39 2014 @@ -34,11 +34,10 @@ import org.ops4j.pax.exam.spi.reactors.P /** Verify that our tests have access to a functional Sling instance, * and demonstrate how a simple test is setup. * - * To create a test like this that runs against a full Sling launchpad - * instance, one only needs the pax exam setup in the pom and a test - * like this one that runs with @RunWith PaxExam, that provides a - * Configuration method and can access services or the BundleContext - * using @Inject. + * Note how little boilerplate this example test has. You basically just + * define which version of the Sling launchpad bundle list you want to use, + * and you can then @Inject any OSGi services to be tested, along with the + * BundleContext. */ @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) @@ -46,9 +45,12 @@ public class SlingRepositoryTest { @Inject private SlingRepository repository; + /** Use a released launchpad for this example */ + public static final String SLING_LAUNCHPAD_VERSION = "6"; + @org.ops4j.pax.exam.Configuration public Option[] config() { - return SlingPaxOptions.defaultLaunchpadOptions("6").getOptions(); + return SlingPaxOptions.defaultLaunchpadOptions(SLING_LAUNCHPAD_VERSION).getOptions(); } @Test Modified: sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java?rev=1560942&r1=1560941&r2=1560942&view=diff ============================================================================== --- sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java (original) +++ sling/trunk/testing/sling-pax-util/src/test/java/org/apache/sling/paxexam/util/SlingSetupTest.java Fri Jan 24 11:10:39 2014 @@ -40,12 +40,15 @@ import org.osgi.framework.ServiceReferen @ExamReactorStrategy(PerClass.class) public class SlingSetupTest { + /** Use a released launchpad for this example */ + public static final String SLING_LAUNCHPAD_VERSION = "6"; + @Inject private BundleContext bundleContext; @org.ops4j.pax.exam.Configuration public Option[] config() { - return SlingPaxOptions.defaultLaunchpadOptions("6").getOptions(); + return SlingPaxOptions.defaultLaunchpadOptions(SLING_LAUNCHPAD_VERSION).getOptions(); } private void assertBundleActive(String symbolicName) {