incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r950956 - in /sling/trunk/launchpad: integration-tests/ integration-tests/README.txt integration-tests/pom.xml testing/README.txt
Date Thu, 03 Jun 2010 11:10:13 GMT
Author: bdelacretaz
Date: Thu Jun  3 11:10:13 2010
New Revision: 950956

URL: http://svn.apache.org/viewvc?rev=950956&view=rev
Log:
SLING-1543 - allow for running single tests from the integration-tests module

Added:
    sling/trunk/launchpad/integration-tests/README.txt   (with props)
Modified:
    sling/trunk/launchpad/integration-tests/   (props changed)
    sling/trunk/launchpad/integration-tests/pom.xml
    sling/trunk/launchpad/testing/README.txt

Propchange: sling/trunk/launchpad/integration-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun  3 11:10:13 2010
@@ -0,0 +1,12 @@
+target
+bin
+logs
+derby.log
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml

Added: sling/trunk/launchpad/integration-tests/README.txt
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/README.txt?rev=950956&view=auto
==============================================================================
--- sling/trunk/launchpad/integration-tests/README.txt (added)
+++ sling/trunk/launchpad/integration-tests/README.txt Thu Jun  3 11:10:13 2010
@@ -0,0 +1,27 @@
+Apache Sling integration-tests module
+-------------------------------------
+This module contains test classes used by the launchpad/testing module,
+separated in their own jar to be reusable.
+
+To run a single test or a specific set of tests against a running Sling
+instance, use for example:
+
+    mvn test -Dtest=UploadFileTest
+    
+Where UploadFileTest is the test to run. Wildcards are allowed, and test
+classes are found in the src/main folder (not a typo - that's not src/test
+as we want to pack the tests in the jar file that we build).
+
+See the <properties> section in pom.xml for additional parameters that the
+tests use.
+
+Here's another example, running the tests against a Sling instance running 
+on host xyzzy, port 1234, with the Sling main servlet mounted under /foo:
+
+   mvn -o -s /dev/null test \
+    -Dhttp.port=1234 \
+    -Dtest.host=xyzzy \
+    -Dhttp.base.path=foo \
+    -Dwebdav.workspace.path=foo \
+    -Dtest=**/integrationtest/**/*Test.java
+

Propchange: sling/trunk/launchpad/integration-tests/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: sling/trunk/launchpad/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/pom.xml?rev=950956&r1=950955&r2=950956&view=diff
==============================================================================
--- sling/trunk/launchpad/integration-tests/pom.xml (original)
+++ sling/trunk/launchpad/integration-tests/pom.xml Thu Jun  3 11:10:13 2010
@@ -33,7 +33,24 @@
   <description>
         Sling Integration Tests, contains integration tests that
         are used by the testing project and other upstream testing projects.
-    </description>
+  </description>
+  
+  <properties>
+    <!-- HTTP port of Sling instance to test -->
+    <http.port>8888</http.port>
+    
+    <!-- path suffix for HTTP access to Sling test instance -->
+    <http.base.path/>
+    
+    <!-- path suffix for WebDAV access to Sling test instance -->
+    <webdav.workspace.path/>
+    
+    <!-- hostname of Sling instance to test -->
+    <test.host>localhost</test.host>
+    
+    <!-- Timeout when checking for Sling readyness before starting tests -->
+    <HttpTestBase.readyTimeoutSeconds>62</HttpTestBase.readyTimeoutSeconds>
+  </properties>
 
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests</connection>
@@ -41,6 +58,55 @@
     <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests</url>
   </scm>
 
+  <profiles>
+    <profile>
+      <!--
+        SLING-1543, setup for running single integration tests with
+        -Dtest
+      -->
+      <id>runTests</id>
+      <activation>
+        <property>
+          <name>test</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <testClassesDirectory>${project.build.outputDirectory}</testClassesDirectory>
+              <systemProperties>
+                <!--
+                    Settings for running the integration against a specific Sling instance
+                -->
+                <property>
+                    <name>launchpad.http.server.url</name>
+                    <value>
+                        http://${test.host}:${http.port}/${http.base.path}
+                    </value>
+                </property>
+                <property>
+                    <name>launchpad.webdav.server.url</name>
+                    <value>
+                        http://${test.host}:${http.port}/${webdav.workspace.path}
+                    </value>
+                </property>
+                <property>
+                    <name>HttpTestBase.readyTimeoutSeconds</name>
+                    <value>
+                        ${HttpTestBase.readyTimeoutSeconds}
+                     </value>
+                 </property>
+              </systemProperties>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
   <dependencies>
 
 
@@ -81,5 +147,10 @@
       <version>4.8.1</version>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
-</project>
+</project>
\ No newline at end of file

Modified: sling/trunk/launchpad/testing/README.txt
URL: http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/README.txt?rev=950956&r1=950955&r2=950956&view=diff
==============================================================================
--- sling/trunk/launchpad/testing/README.txt (original)
+++ sling/trunk/launchpad/testing/README.txt Thu Jun  3 11:10:13 2010
@@ -1,8 +1,7 @@
 Apache Sling Launchpad Testing module
 
-This module builds a Sling webapp using bundles from the trunk, and
-runs integration tests (that were previously in the launchpad/webapp
-module) on them.  
+This module builds a Sling instance using bundles from the trunk, and
+runs integration tests against it, via HTTP.
 
 
 Getting Started
@@ -28,97 +27,9 @@ you can checkout the latest source using
 
 See the Subversion documentation for other source control features.
 
-
-How to run this
----------------
-  NOTE: "mvn clean" does not delete the "sling" work directory - make sure to 
-  delete it manually if you want to start from a clean state.
-
-1) Build all Sling bundles
-
-  cd <top of the Sling source code tree>
-  mvn clean install
-  
-2) Build and run this
-
-  cd launchpad/testing
-  mvn clean package jetty:run
-  
-Once the webapp starts, http://localhost:8888/system/console should display the Felix
-OSGi console.
-
-4) Test node creation and display
-To create a node with curl:
-
-	 curl -D - -Ftitle=something http://admin:admin@localhost:8888/testing/this
-	 
-Then, http://admin:admin@localhost:8888/testing/this should display a default HTML
-representation, including the value of the "title" property.
-
-Add a txt or json extension to see other output formats.
-
 Integration tests
 -----------------
-This module provides a number of integration tests, that run automatically when
-doing a full build, and test Sling via its client HTTP interfaces.
-
-These tests can also be run against another instance of Sling, for example to
-test it in another web container than the embedded Jetty that is used during the
-Maven build.
-
-See pom.xml for the parameters that control these integration tests. Here's an
-example of running them against a Sling instance running on host xyzzy, port 1234,
-with the Sling webapp mounted under /foo:
-
-   mvn -o -s /dev/null test \
-    -Dhttp.port=1234 \
-    -Dtest.host=xyzzy \
-    -Dhttp.base.path=foo \
-    -Dwebdav.workspace.path=foo/dav/default \
-    -Dtest=**/integrationtest/**/*Test.java
-
-The  -s /dev/null parameter disables all your local Maven settings, to make sure
-they don't interfere (and it's different under Windows). Feel free to remove that 
-if you know what you're doing.
-
-To run a single test, other values can be used for the "-Dtest" parameter. To
-leave this launchpad/testing instance running and run individual tests again
-it, for example, use:
-
-  mvn launchpad:run
-
-and in another terminal:
-
-  mvn test -Dhttp.port=8888 -Dtest=TestClassSelectionNamePattern
-
-This is very useful during development: you can leave a Sling instance
-running, update bundles in it using the mvn autoInstallBundle profile, and run
-specific integration tests quickly from another terminal.
-
-JCR Install Integration tests
------------------------------
-
-This module also contains integration tests for the JCR Install module. These
-tests are disabled by default, since they may not be of general interest. To
-include the JCR Install tests in the integration tests run enable the
-jcrinstall-tests profile such as in
-
-   mvn -P jcrinstall-tests integration-test
-   
-*** WARNING: the jcrinstall-tests do not work in revision 741168, due to changes
-in the start levels. They can be run according to the scenario below, if you 
-change the default bundles start level to 30, after starting the Sling instance
-with mvn jetty:run, from http://localhost:8888/system/console/vmstat. ***     
-
-To run the jcrinstall integration tests quickly, without having to start the
-webapp first:
-
-1. Run mvn clean package jetty:run -P jcrinstall-tests in a first console
-
-(1.5 see WARNING above - adjust the default bundles start level)
-
-2. In another console run
+This module runs number of integration tests provided by the sibling 
+integration-tests module.
 
-  mvn test -Pjcrinstall-tests  -Dtest=**/integrationtest/jcrinstall/**/*Test.java
-  
-       
+To run individual tests, see the README.txt in that module.
\ No newline at end of file



Mime
View raw message