jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r704426 - in /jackrabbit/sandbox/jackrabbit-test-harness/compatibility: ./ base/src/main/java/org/apache/jackrabbit/harness/compatibility/ create10/src/test/java/org/apache/jackrabbit/harness/compatibility/ create11/src/test/java/org/apache...
Date Tue, 14 Oct 2008 09:59:39 GMT
Author: jukka
Date: Tue Oct 14 02:59:38 2008
New Revision: 704426

URL: http://svn.apache.org/viewvc?rev=704426&view=rev
Log:
test-harness: Make it possible for each create project to create multiple named repositories.

Modified:
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/assembly.xml
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/src/main/java/org/apache/jackrabbit/harness/compatibility/AbstractRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create10/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create11/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create12/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create13/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create14/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/assembly.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/assembly.xml?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/assembly.xml (original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/assembly.xml Tue Oct 14 02:59:38
2008
@@ -22,7 +22,7 @@
   <formats>
     <format>jar</format>
   </formats>
-  <baseDirectory>${project.artifactId}</baseDirectory>
+  <includeBaseDirectory>false</includeBaseDirectory>
   <fileSets>
     <fileSet>
       <directory>target/repository</directory>

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/src/main/java/org/apache/jackrabbit/harness/compatibility/AbstractRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/src/main/java/org/apache/jackrabbit/harness/compatibility/AbstractRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/src/main/java/org/apache/jackrabbit/harness/compatibility/AbstractRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/src/main/java/org/apache/jackrabbit/harness/compatibility/AbstractRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -36,10 +36,19 @@
 
 public class AbstractRepositoryTest {
 
-    protected void doCreateRepository(InputStream xml) throws Exception {
-        File directory = new File("target/repository");
+    /**
+     * Creates a named test repository with the given configuration file.
+     *
+     * @param name name of the repository
+     * @param xml input stream for reading the repository configuration
+     * @throws Exception if the repository could not be created
+     */
+    protected void doCreateRepository(String name, InputStream xml)
+            throws Exception {
+        File directory = new File(new File("target", "repository"), name);
         File configuration = new File(directory, "repository.xml");
 
+        // Copy the configuration file into the repository directory
         try {
             OutputStream output = FileUtils.openOutputStream(configuration);
             try {
@@ -51,6 +60,7 @@
             xml.close();
         }
 
+        // Create the repository
         RepositoryConfig config = RepositoryConfig.create(
                 configuration.getPath(), directory.getPath());
         RepositoryImpl repository = RepositoryImpl.create(config);
@@ -68,8 +78,13 @@
         }
     }
 
-    protected void doVerifyRepository(String name) throws Exception {
-        File directory = new File("target/dependency", name);
+    /**
+     * Verifies that the given test repository can be opened and accessed.
+     *
+     * @param directory the repository directory
+     * @throws Exception if the repository could not be created
+     */
+    protected void doVerifyRepository(File directory) throws Exception {
         File configuration = new File(directory, "repository.xml");
 
         RepositoryConfig config = RepositoryConfig.create(

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create10/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create10/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create10/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create10/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -22,6 +22,7 @@
 
     public void testCreateRepository() throws Exception {
         doCreateRepository(
+                "jackrabbit-1.0",
                 RepositoryImpl.class.getResourceAsStream("repository.xml"));
     }
 

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create11/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create11/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create11/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create11/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -22,6 +22,7 @@
 
     public void testCreateRepository() throws Exception {
         doCreateRepository(
+                "jackrabbit-1.1",
                 RepositoryImpl.class.getResourceAsStream("repository.xml"));
     }
 

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create12/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create12/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create12/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create12/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -22,6 +22,7 @@
 
     public void testCreateRepository() throws Exception {
         doCreateRepository(
+                "jackrabbit-1.2",
                 RepositoryImpl.class.getResourceAsStream("repository.xml"));
     }
 

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create13/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create13/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create13/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create13/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -22,6 +22,7 @@
 
     public void testCreateRepository() throws Exception {
         doCreateRepository(
+                "jackrabbit-1.3",
                 RepositoryImpl.class.getResourceAsStream("repository.xml"));
     }
 

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create14/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create14/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create14/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/create14/src/test/java/org/apache/jackrabbit/harness/compatibility/CreateRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -22,6 +22,7 @@
 
     public void testCreateRepository() throws Exception {
         doCreateRepository(
+                "jackrabbit-1.4",
                 RepositoryImpl.class.getResourceAsStream("repository.xml"));
     }
 

Modified: jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java?rev=704426&r1=704425&r2=704426&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java
Tue Oct 14 02:59:38 2008
@@ -16,26 +16,21 @@
  */
 package org.apache.jackrabbit.harness.compatibility;
 
-public class VerifyRepositoryTest extends AbstractRepositoryTest {
-
-    public void testVerify10Repository() throws Exception {
-        doVerifyRepository("compatibility-create10");
-    }
-
-    public void testVerify11Repository() throws Exception {
-        doVerifyRepository("compatibility-create11");
-    }
+import java.io.File;
+import java.util.Arrays;
 
-    public void testVerify12Repository() throws Exception {
-        doVerifyRepository("compatibility-create12");
-    }
-
-    public void testVerify13Repository() throws Exception {
-        doVerifyRepository("compatibility-create13");
-    }
+public class VerifyRepositoryTest extends AbstractRepositoryTest {
 
-    public void testVerify14Repository() throws Exception {
-        doVerifyRepository("compatibility-create14");
+    public void testVerifyRepositories() throws Exception {
+        File directory = new File("target", "dependency");
+        File[] repositories = directory.listFiles();
+        Arrays.sort(repositories);
+        for (File repository : repositories) {
+            if (repository.isDirectory()
+                    && new File(repository, "repository.xml").exists()) {
+                doVerifyRepository(repository);
+            }
+        }
     }
 
 }



Mime
View raw message