incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
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 GMT
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 @@
     <packaging>jar</packaging>
 
     <name>Apache Sling Pax Exam Utilities</name>
+    
+    <description>
+        Utilities that make it easier to test Sling code with Pax Exam.
+        See this module's tests for usage examples.
+    </description>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

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) {



Mime
View raw message