jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r704435 - in /jackrabbit/sandbox/jackrabbit-test-harness/compatibility: base/ base/src/main/java/org/apache/jackrabbit/harness/compatibility/ create10/src/test/java/org/apache/jackrabbit/harness/compatibility/ create11/src/test/java/org/apa...
Date Tue, 14 Oct 2008 10:28:13 GMT
Author: jukka
Date: Tue Oct 14 03:28:09 2008
New Revision: 704435

URL: http://svn.apache.org/viewvc?rev=704435&view=rev
Log:
test-harness: Use TestNG so it's easier to run the tests from an IDE.

Modified:
    jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/pom.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/base/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/pom.xml?rev=704435&r1=704434&r2=704435&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/pom.xml (original)
+++ jackrabbit/sandbox/jackrabbit-test-harness/compatibility/base/pom.xml Tue Oct 14 03:28:09
2008
@@ -49,6 +49,12 @@
       <artifactId>commons-io</artifactId>
       <version>1.4</version>
     </dependency>
+    <dependency>
+      <groupId>org.testng</groupId>
+      <artifactId>testng</artifactId>
+      <classifier>jdk15</classifier>
+      <version>5.8</version>
+    </dependency>
   </dependencies>
 
 </project>

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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -34,6 +34,8 @@
 import org.apache.jackrabbit.core.RepositoryImpl;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 
+import static org.testng.AssertJUnit.*;
+
 public class AbstractRepositoryTest {
 
     /**
@@ -141,57 +143,57 @@
     private void verifyTestData(Session session) throws Exception {
         Node root = session.getRootNode();
 
-        assert root.hasNode("test");
+        assertTrue(root.hasNode("test"));
         Node test = root.getNode("test");
 
-        assert test.hasNode("versionable");
+        assertTrue(test.hasNode("versionable"));
         Node versionable = test.getNode("versionable");
-        assert versionable.isNodeType("nt:unstructured");
-        assert versionable.isNodeType("mix:versionable");
-        assert !versionable.isCheckedOut();
+        assertTrue(versionable.isNodeType("nt:unstructured"));
+        assertTrue(versionable.isNodeType("mix:versionable"));
+        assertFalse(versionable.isCheckedOut());
 
         VersionHistory history = versionable.getVersionHistory();
         Version versionB = versionable.getBaseVersion();
         String[] labels = history.getVersionLabels(versionB);
-        assert labels.length == 1;
-        assert labels[0].equals("labelB");
+        assertEquals(1, labels.length);
+        assertEquals("labelB", labels[0]);
         Version versionA = history.getVersionByLabel("labelA");
         versionable.restore(versionA, true);
-        assert versionable.getProperty("foo").getString().equals("A");
+        assertEquals("A", versionable.getProperty("foo").getString());
         versionable.restore(versionB, true);
-        assert versionable.getProperty("foo").getString().equals("B");
+        assertEquals("B", versionable.getProperty("foo").getString());
 
-        assert test.hasNode("properties");
+        assertTrue(test.hasNode("properties"));
         Node properties = test.getNode("properties");
-        assert properties.isNodeType("nt:unstructured");
-        assert properties.getProperty("boolean").getBoolean();
+        assertTrue(properties.isNodeType("nt:unstructured"));
+        assertEquals(true, properties.getProperty("boolean").getBoolean());
         Calendar calendar = properties.getProperty("date").getDate();
-        assert calendar.getTimeInMillis() == 1234567890;
-        assert properties.getProperty("double").getDouble() == 0.123456789;
-        assert properties.getProperty("long").getLong() == 1234567890;
+        assertEquals(1234567890, calendar.getTimeInMillis());
+        assertEquals(0.123456789, properties.getProperty("double").getDouble());
+        assertEquals(1234567890, properties.getProperty("long").getLong());
         Node reference = properties.getProperty("reference").getNode();
-        assert reference.isSame(versionable);
-        assert properties.getProperty("string").getString().equals("test");
+        assertTrue(reference.isSame(versionable));
+        assertEquals("test", properties.getProperty("string").getString());
 
         Value[] multiple = properties.getProperty("multiple").getValues();
-        assert multiple.length == 3;
-        assert multiple[0].getString().equals("a");
-        assert multiple[1].getString().equals("b");
-        assert multiple[2].getString().equals("c");
+        assertEquals(3, multiple.length);
+        assertEquals("a", multiple[0].getString());
+        assertEquals("b", multiple[1].getString());
+        assertEquals("c", multiple[2].getString());
 
         InputStream stream = properties.getProperty("binary").getStream();
         try {
-            assert stream.read() == 0;
-            assert stream.read() == 1;
-            assert stream.read() == 2;
-            assert stream.read() == 3;
-            assert stream.read() == 4;
-            assert stream.read() == 5;
-            assert stream.read() == 6;
-            assert stream.read() == 7;
-            assert stream.read() == 8;
-            assert stream.read() == 9;
-            assert stream.read() == -1;
+            assertEquals(0, stream.read());
+            assertEquals(1, stream.read());
+            assertEquals(2, stream.read());
+            assertEquals(3, stream.read());
+            assertEquals(4, stream.read());
+            assertEquals(5, stream.read());
+            assertEquals(6, stream.read());
+            assertEquals(7, stream.read());
+            assertEquals(8, stream.read());
+            assertEquals(9, stream.read());
+            assertEquals(-1, stream.read());
         } finally {
             stream.close();
         }

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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -17,10 +17,12 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.testng.annotations.Test;
 
 public class CreateRepositoryTest extends AbstractRepositoryTest {
 
-    public void testCreateRepository() throws Exception {
+    @Test
+    public void createRepository() 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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -17,10 +17,12 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.testng.annotations.Test;
 
 public class CreateRepositoryTest extends AbstractRepositoryTest {
 
-    public void testCreateRepository() throws Exception {
+    @Test
+    public void createRepository() 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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -17,10 +17,12 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.testng.annotations.Test;
 
 public class CreateRepositoryTest extends AbstractRepositoryTest {
 
-    public void testCreateRepository() throws Exception {
+    @Test
+    public void createRepository() 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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -17,10 +17,12 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.testng.annotations.Test;
 
 public class CreateRepositoryTest extends AbstractRepositoryTest {
 
-    public void testCreateRepository() throws Exception {
+    @Test
+    public void createRepository() 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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -17,10 +17,12 @@
 package org.apache.jackrabbit.harness.compatibility;
 
 import org.apache.jackrabbit.core.RepositoryImpl;
+import org.testng.annotations.Test;
 
 public class CreateRepositoryTest extends AbstractRepositoryTest {
 
-    public void testCreateRepository() throws Exception {
+    @Test
+    public void createRepository() 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=704435&r1=704434&r2=704435&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 03:28:09 2008
@@ -19,9 +19,12 @@
 import java.io.File;
 import java.util.Arrays;
 
+import org.testng.annotations.Test;
+
 public class VerifyRepositoryTest extends AbstractRepositoryTest {
 
-    public void testVerifyRepositories() throws Exception {
+    @Test
+    public void verifyRepositories() throws Exception {
         File directory = new File("target", "dependency");
         File[] repositories = directory.listFiles();
         Arrays.sort(repositories);



Mime
View raw message