You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2009/05/05 18:53:23 UTC

svn commit: r771923 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test: AbstractJCRTest.java api/ShareableNodeTest.java

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");
     }
 



Re: svn commit: r771923 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test: AbstractJCRTest.java api/ShareableNodeTest.java

Posted by Julian Reschke <ju...@gmx.de>.
Jukka Zitting wrote:
> Hi,
> 
> On Tue, May 5, 2009 at 6:53 PM,  <re...@apache.org> wrote:
>> JCR-2085: consolidate the existing and the new feature checker method into a single one
> 
> Good point! I didn't notice the existing method.

I just noticed by accident, because the code I was trying to debug 
wasn't even called :-)

Re: svn commit: r771923 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test: AbstractJCRTest.java api/ShareableNodeTest.java

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, May 5, 2009 at 6:53 PM,  <re...@apache.org> wrote:
> JCR-2085: consolidate the existing and the new feature checker method into a single one

Good point! I didn't notice the existing method.

BR,

Jukka Zitting