jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r771923 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test: AbstractJCRTest.java api/ShareableNodeTest.java
Date Tue, 05 May 2009 16:53:23 GMT
Author: reschke
Date: Tue May  5 16:53:19 2009
New Revision: 771923

URL: http://svn.apache.org/viewvc?rev=771923&view=rev
Log:
JCR-2085: consolidate the existing and the new feature checker method into a single one

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=771923&r1=771922&r2=771923&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Tue May  5 16:53:19 2009
@@ -605,8 +605,10 @@
      * @throws NotExecutableException If the feature is not supported.
      */
     protected void checkSupportedOption(String descriptorKey) throws RepositoryException,
NotExecutableException {
-        if (Boolean.FALSE.toString().equals(helper.getRepository().getDescriptor(descriptorKey)))
{
-            throw new NotExecutableException();
+        String value = helper.getRepository().getDescriptor(descriptorKey);
+        if (value == null || ! Boolean.valueOf(value).booleanValue()) {
+            throw new NotExecutableException (
+                    "Repository feature not supported: " + descriptorKey);
         }
     }
 
@@ -655,24 +657,6 @@
     }
 
     /**
-     * Checks that the repository supports the named feature. The given
-     * feature name must be the key of a boolean-valued repository descriptor.
-     * A {@link NotExecutableException} is thrown if the descriptor does not
-     * exists or is not <code>true</code>.
-     *
-     * @param feature descriptor key
-     * @throws NotExecutableException if the named feature is not supported
-     */
-    protected void ensureSupportsFeature(String feature)
-            throws NotExecutableException {
-        String value = superuser.getRepository().getDescriptor(feature);
-        if (! Boolean.valueOf(value).booleanValue()) {
-            throw new NotExecutableException(
-                    "Repository feature not supported: " + feature);
-        }
-    }
-
-    /**
      * Checks that the repository can set the property to the required type, otherwise aborts
with
      * {@link NotExecutableException}.
      * @throws NotExecutableException when setting the property to the required

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java?rev=771923&r1=771922&r2=771923&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/ShareableNodeTest.java
Tue May  5 16:53:19 2009
@@ -46,7 +46,7 @@
     
     protected void setUp() throws Exception {
         super.setUp();
-        ensureSupportsFeature(Repository.OPTION_SHAREABLE_NODES_SUPPORTED);
+        checkSupportedOption(Repository.OPTION_SHAREABLE_NODES_SUPPORTED);
         ensureKnowsNodeType(superuser, "mix:shareable");
     }
 



Mime
View raw message