You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2008/10/28 13:52:38 UTC
svn commit: r708557 -
/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/verify/src/test/java/org/apache/jackrabbit/harness/compatibility/VerifyRepositoryTest.java
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));
}
}