jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r421894 - in /jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit: core/ test/ test/api/ test/api/lock/ test/api/query/ test/api/version/
Date Fri, 14 Jul 2006 12:38:26 GMT
Author: mreutegg
Date: Fri Jul 14 05:38:25 2006
New Revision: 421894

URL: http://svn.apache.org/viewvc?rev=421894&view=rev
Log:
JCR-481: Checks for optional features in test cases are wrong

Modified:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/XATest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeCanAddMixinTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SerializationTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SessionTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyBetweenWorkspacesTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/LockTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/SetValueLockExceptionTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SaveTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/TextNodeTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/XATest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/XATest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/XATest.java (original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/XATest.java Fri Jul
14 05:38:25 2006
@@ -70,7 +70,7 @@
      */
     protected void runTest() throws Throwable {
         Repository rep = helper.getRepository();
-        if (rep.getDescriptor(Repository.OPTION_TRANSACTIONS_SUPPORTED) != null) {
+        if (isSupported(Repository.OPTION_TRANSACTIONS_SUPPORTED)) {
             super.runTest();
         }
     }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/AbstractJCRTest.java
Fri Jul 14 05:38:25 2006
@@ -310,7 +310,7 @@
         ntQuery = superuser.getNamespacePrefix(NS_NT_URI) + ":query";
 
         // setup custom namespaces
-        if (helper.getRepository().getDescriptor(Repository.LEVEL_2_SUPPORTED) != null) {
+        if (isSupported(Repository.LEVEL_2_SUPPORTED)) {
             NamespaceRegistry nsReg = superuser.getWorkspace().getNamespaceRegistry();
             String namespaces = getProperty(RepositoryStub.PROP_NAMESPACES);
             if (namespaces != null) {
@@ -513,4 +513,17 @@
         return tmp.toString();
     }
 
+    /**
+     * Returns <code>true</code> if this repository support a certain optional
+     * feature; otherwise <code>false</code> is returned. If there is no
+     * such <code>descriptorKey</code> present in the repository, this method
+     * also returns false.
+     *
+     * @param descriptorKey the descriptor key.
+     * @return <code>true</code> if the option is supported.
+     * @throws RepositoryException if an error occurs.
+     */
+    protected boolean isSupported(String descriptorKey) throws RepositoryException {
+        return "true".equals(helper.getRepository().getDescriptor(descriptorKey));
+    }
 }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeAddMixinTest.java
Fri Jul 14 05:38:25 2006
@@ -119,7 +119,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 
@@ -178,7 +178,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Versioning is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeCanAddMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeCanAddMixinTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeCanAddMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeCanAddMixinTest.java
Fri Jul 14 05:38:25 2006
@@ -46,7 +46,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 
@@ -96,7 +96,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Versioning is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeRemoveMixinTest.java
Fri Jul 14 05:38:25 2006
@@ -141,7 +141,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 
@@ -203,7 +203,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Versioning is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/NodeTest.java
Fri Jul 14 05:38:25 2006
@@ -636,7 +636,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 
@@ -684,7 +684,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/RepositoryDescriptorTest.java
Fri Jul 14 05:38:25 2006
@@ -39,13 +39,21 @@
     private static final Set requiredDescriptorKeys = new HashSet();
 
     static {
-        requiredDescriptorKeys.add(Repository.SPEC_VERSION_DESC);
         requiredDescriptorKeys.add(Repository.LEVEL_1_SUPPORTED);
-        requiredDescriptorKeys.add(Repository.SPEC_NAME_DESC);
+        requiredDescriptorKeys.add(Repository.LEVEL_2_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.OPTION_LOCKING_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.OPTION_OBSERVATION_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.OPTION_QUERY_SQL_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.OPTION_TRANSACTIONS_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.OPTION_VERSIONING_SUPPORTED);
+        requiredDescriptorKeys.add(Repository.QUERY_XPATH_DOC_ORDER);
+        requiredDescriptorKeys.add(Repository.QUERY_XPATH_POS_INDEX);
+        requiredDescriptorKeys.add(Repository.REP_NAME_DESC);
         requiredDescriptorKeys.add(Repository.REP_VENDOR_DESC);
         requiredDescriptorKeys.add(Repository.REP_VENDOR_URL_DESC);
         requiredDescriptorKeys.add(Repository.REP_VERSION_DESC);
-        requiredDescriptorKeys.add(Repository.REP_NAME_DESC);
+        requiredDescriptorKeys.add(Repository.SPEC_NAME_DESC);
+        requiredDescriptorKeys.add(Repository.SPEC_VERSION_DESC);
     }
 
     /** The session for the tests */

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SerializationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SerializationTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SerializationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SerializationTest.java
Fri Jul 14 05:38:25 2006
@@ -199,7 +199,7 @@
             throws RepositoryException, IOException, SAXException {
         Repository repository = session.getRepository();
         exportRepository(SKIPBINARY, RECURSE);
-        if (repository.getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) != null) {
+        if (isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             //A LockException is thrown if a lock prevents the addition of the subtree.
             Node lNode = testRootNode.addNode(nodeName1);
             lNode.addMixin(mixLockable);

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SessionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SessionTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SessionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SessionTest.java
Fri Jul 14 05:38:25 2006
@@ -239,7 +239,7 @@
 
         Session session = superuser;
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/SetValueVersionExceptionTest.java
Fri Jul 14 05:38:25 2006
@@ -63,7 +63,7 @@
         value = session.getValueFactory().createValue("abc");
         values = new Value[] {value};
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Versioning is not supported.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyBetweenWorkspacesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyBetweenWorkspacesTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyBetweenWorkspacesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/WorkspaceCopyBetweenWorkspacesTest.java
Fri Jul 14 05:38:25 2006
@@ -155,7 +155,7 @@
      * A LockException is thrown if a lock prevents the copy.
      */
     public void testCopyNodesLocked() throws RepositoryException, NotExecutableException
{
-        if (superuser.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED)
== null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Repository does not support locking.");
         }
         // we assume repository supports locking

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/LockTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/LockTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/LockTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/LockTest.java
Fri Jul 14 05:38:25 2006
@@ -233,7 +233,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Versioning is not supported.");
         }
 
@@ -549,7 +549,7 @@
      * Tests if a locked, checked-in node can be unlocked
      */
     public void testCheckedInUnlock() throws Exception {
-        if (superuser.getRepository().getDescriptor(Repository.OPTION_VERSIONING_SUPPORTED)
== null) {
+        if (!isSupported(Repository.OPTION_VERSIONING_SUPPORTED)) {
             throw new NotExecutableException("Repository does not support versioning.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/SetValueLockExceptionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/SetValueLockExceptionTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/SetValueLockExceptionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/lock/SetValueLockExceptionTest.java
Fri Jul 14 05:38:25 2006
@@ -85,7 +85,7 @@
     public void setUp() throws Exception {
         super.setUp();
         Repository repo = helper.getRepository();
-        if (repo.getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) == null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("SetValueLockExceptionTest "
                     + "not executable: Locking not supported");
         }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractOrderByTest.java
Fri Jul 14 05:38:25 2006
@@ -40,11 +40,7 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        if (superuser.getRepository().getDescriptor(Repository.OPTION_QUERY_SQL_SUPPORTED)
== null) {
-            checkSQL = false;
-        } else {
-            checkSQL = true;
-        }
+        checkSQL = isSupported(Repository.OPTION_QUERY_SQL_SUPPORTED);
         nodeNames = new String[]{nodeName1, nodeName2, nodeName3, nodeName4};
     }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
Fri Jul 14 05:38:25 2006
@@ -285,15 +285,6 @@
             assertTrue(path + " is not expected to be part of the result set", expectedPaths.contains(path));
         }
     }
-    /**
-     * Test if the requested Descriptor is registred at repository
-     *
-     * @param descriptor to be searched.
-     * @return true if descriptor is contained in the repository
-     */
-    protected boolean hasDescriptor(String descriptor) {
-        return superuser.getRepository().getDescriptor(descriptor) != null;
-    }
 
     /**
      * Returns the nodes in <code>it</code> as an array of Nodes.

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/GetSupportedQueryLanguagesTest.java
Fri Jul 14 05:38:25 2006
@@ -69,7 +69,7 @@
                 langs.contains(Query.XPATH));
 
         // if repository descriptor for sql is present also sql must be returned
-        if (session.getRepository().getDescriptor(Repository.OPTION_QUERY_SQL_SUPPORTED)
!= null) {
+        if (isSupported(Repository.OPTION_QUERY_SQL_SUPPORTED)) {
             assertTrue("SQL not returned with QueryManager.getSupportedQueryLanguages()",
                     langs.contains(Query.SQL));
         }

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SaveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SaveTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SaveTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/SaveTest.java
Fri Jul 14 05:38:25 2006
@@ -116,7 +116,7 @@
      */
     public void testVersionException() throws RepositoryException, NotExecutableException
{
         // check if repository supports versioning
-        if (superuser.getRepository().getDescriptor(Repository.OPTION_VERSIONING_SUPPORTED)
== null) {
+        if (!isSupported(Repository.OPTION_VERSIONING_SUPPORTED)) {
             throw new NotExecutableException();
         }
 
@@ -173,7 +173,7 @@
      */
     public void testLockException() throws RepositoryException, NotExecutableException {
         // check if repository supports locking
-        if (superuser.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED)
== null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException();
         }
         // create a node that is lockable

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/TextNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/TextNodeTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/TextNodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/TextNodeTest.java
Fri Jul 14 05:38:25 2006
@@ -101,7 +101,7 @@
      */
     public void testTextNodeTestWithPosition()
             throws RepositoryException, NotExecutableException {
-        if (superuser.getRepository().getDescriptor(Repository.QUERY_XPATH_POS_INDEX) ==
null) {
+        if (!isSupported(Repository.QUERY_XPATH_POS_INDEX)) {
             throw new NotExecutableException("Repository does not support position index");
         }
         Node text1 = testRootNode.addNode(jcrXMLText);

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathDocOrderTest.java
Fri Jul 14 05:38:25 2006
@@ -120,7 +120,7 @@
      */
     private void docOrderTest(Statement stmt, String path)
             throws RepositoryException, NotExecutableException {
-        if (!hasDescriptor(Repository.QUERY_XPATH_DOC_ORDER)) {
+        if (!isSupported(Repository.QUERY_XPATH_DOC_ORDER)) {
             throw new NotExecutableException("Repository does not support document order
on result set.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/query/XPathPosIndexTest.java
Fri Jul 14 05:38:25 2006
@@ -71,7 +71,7 @@
      */
     private void docOrderTest(Statement stmt, String path)
             throws RepositoryException, NotExecutableException {
-        if (!hasDescriptor(Repository.QUERY_XPATH_POS_INDEX)) {
+        if (!isSupported(Repository.QUERY_XPATH_POS_INDEX)) {
             throw new NotExecutableException("Repository does not support document order
on result set.");
         }
 

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java?rev=421894&r1=421893&r2=421894&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java
Fri Jul 14 05:38:25 2006
@@ -256,7 +256,7 @@
 
         Session session = testRootNode.getSession();
 
-        if (session.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED) ==
null) {
+        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
             throw new NotExecutableException("Locking is not supported.");
         }
 



Mime
View raw message