jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r708557 - /jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java
Date Tue, 28 Oct 2008 12:52:38 GMT
Author: jukka
Date: Tue Oct 28 05:52:38 2008
New Revision: 708557

URL: http://svn.apache.org/viewvc?rev=708557&view=rev
Log:
test-harness: Use a TestNG data provider to make the test results over multiple repositories
easier to grasp

Modified:
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java

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=708557&r1=708556&r2=708557&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 28 05:52:38 2008
@@ -17,23 +17,36 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class VerifyRepositoryTest extends AbstractRepositoryTest {
 
-    @Test
-    public void verifyRepositories() throws Exception {
-        File directory = new File("target", "dependency");
-        File[] repositories = directory.listFiles();
+    private static final File BASEDIR = new File("target", "dependency");
+
+    @DataProvider(name = "repository")
+    public Object[][] getRepositories() throws Exception {
+        List<Object[]> tests = new ArrayList<Object[]>();
+
+        File[] repositories = BASEDIR.listFiles();
         Arrays.sort(repositories);
         for (File repository : repositories) {
             if (repository.isDirectory()
                     && new File(repository, "repository.xml").exists()) {
-                doVerifyRepository(repository);
+                tests.add(new Object[] { repository.getName() });
             }
         }
+
+        return tests.toArray(new Object[tests.size()][]);
+    }
+
+    @Test(dataProvider = "repository")
+    public void verifyRepository(String name) throws Exception {
+        doVerifyRepository(new File(BASEDIR, name));
     }
 
 }



Mime
View raw message