jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r156030 - incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
Date Thu, 03 Mar 2005 11:10:07 GMT
Author: mreutegg
Date: Thu Mar  3 03:10:03 2005
New Revision: 156030

URL: http://svn.apache.org/viewcvs?view=rev&rev=156030
Log:
Added test case for Repository.getDescriptorKeys()

Modified:
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java?view=diff&r1=156029&r2=156030
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
Thu Mar  3 03:10:03 2005
@@ -23,6 +23,8 @@
 import java.util.Set;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Arrays;
 
 /**
  * Tests if the required repository descriptors are available.
@@ -59,6 +61,16 @@
     }
 
     /**
+     * Releases the session aquired in {@link #setUp}.
+     */
+    protected void tearDown() throws Exception {
+        if (session != null) {
+            session.logout();
+        }
+        super.tearDown();
+    }
+
+    /**
      * Tests that the required repository descriptors are available.
      */
     public void testRequiredDescriptors() {
@@ -66,6 +78,19 @@
             String descriptor = session.getRepository().getDescriptor((String) it.next());
             assertNotNull("Not all required descriptors are available.",
                     descriptor);
+        }
+    }
+
+    /**
+     * Tests if {@link Repository#getDescriptorKeys()} returns all required
+     * descriptors keys.
+     */
+    public void testGetDescriptorKeys() {
+        List keys = Arrays.asList(session.getRepository().getDescriptorKeys());
+        for (Iterator it = requiredDescriptorKeys.iterator(); it.hasNext();) {
+            String key = (String) it.next();
+            assertTrue(key + " is missing from the required descriptor keys.",
+                    keys.contains(key));
         }
     }
 



Mime
View raw message