jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r947996 - /jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
Date Tue, 25 May 2010 10:24:29 GMT
Author: jukka
Date: Tue May 25 10:24:29 2010
New Revision: 947996

URL: http://svn.apache.org/viewvc?rev=947996&view=rev
Log:
JCR-2614: Include the WebDAV litmus tests in the Jackrabbit integration tests

Rearrange the test to improve performance while still running all Litmus parts separately

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java?rev=947996&r1=947995&r2=947996&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/webdav/simple/LitmusTest.java
Tue May 25 10:24:29 2010
@@ -40,37 +40,12 @@ public class LitmusTest extends TestCase
      */
     private static final Logger log = LoggerFactory.getLogger(LitmusTest.class);
 
-    private static String litmus = System.getProperty("litmus", "litmus");
-
-    private static boolean litmusIsAvailable = isLitmusAvailable(litmus);
-
-    public void testBasic() throws Exception {
-        assertLitmus("basic", 0);
-    }
-
-    public void testHttp() throws Exception {
-        assertLitmus("http", 0);
-    }
-
-    public void testProps() throws Exception {
-        assertLitmus("props", 0);
-    }
-
-    public void testCopyMove() throws Exception {
-        // FIXME: JCR-2637: WebDAV shallow copy test failure
-        assertLitmus("copymove", 1);
-    }
-
-    public void testLocks() throws Exception {
-        // FIXME: JCR-2638: Litmus locks test failures
-        assertLitmus("locks", 1);
-    }
-
-    private void assertLitmus(String tests, int exit) throws Exception {
+    public void testLitmus() throws Exception {
         File dir = new File("target", "litmus");
+        String litmus = System.getProperty("litmus", "litmus");
 
         if (Boolean.getBoolean("jackrabbit.test.integration")
-                && litmusIsAvailable) {
+                && isLitmusAvailable(litmus)) {
             final Repository repository = JcrUtils.getRepository(
                     "jcr-jackrabbit://" + dir.getCanonicalPath());
             Session session = repository.login(); // for the TransientRepository
@@ -103,13 +78,20 @@ public class LitmusTest extends TestCase
 
                     ProcessBuilder builder =
                         new ProcessBuilder(litmus, url, "admin", "admin");
-                    builder.environment().put("TESTS", tests);
                     builder.directory(dir);
                     builder.redirectErrorStream();
 
-                    Process process = builder.start();
-                    IOUtils.copy(process.getInputStream(), System.out);
-                    assertEquals(exit, process.waitFor());
+                    assertLitmus(builder, "basic", 0);
+
+                    assertLitmus(builder, "http", 0);
+
+                    assertLitmus(builder, "props", 0);
+
+                    // FIXME: JCR-2637: WebDAV shallow copy test failure
+                    assertLitmus(builder, "copymove", 1);
+
+                    // FIXME: JCR-2638: Litmus locks test failures
+                    assertLitmus(builder, "locks", 1);
                 } finally {
                     server.stop();
                 }
@@ -119,6 +101,14 @@ public class LitmusTest extends TestCase
         }
     }
 
+    private void assertLitmus(
+            ProcessBuilder builder, String tests, int exit) throws Exception {
+        builder.environment().put("TESTS", tests);
+        Process process = builder.start();
+        IOUtils.copy(process.getInputStream(), System.out);
+        assertEquals(exit, process.waitFor());
+    }
+
     private static boolean isLitmusAvailable(String litmus) {
         try {
             ProcessBuilder builder = new ProcessBuilder(litmus, "--version");



Mime
View raw message