jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r577852 - /jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java
Date Thu, 20 Sep 2007 18:21:25 GMT
Author: jukka
Date: Thu Sep 20 11:21:25 2007
New Revision: 577852

URL: http://svn.apache.org/viewvc?rev=577852&view=rev
Log:
1.3: Merged revision 568259 (JCR-1068)

Modified:
    jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java

Modified: jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java?rev=577852&r1=577851&r2=577852&view=diff
==============================================================================
--- jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java
(original)
+++ jackrabbit/branches/1.3/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NamespaceRegistryTest.java
Thu Sep 20 11:21:25 2007
@@ -18,6 +18,7 @@
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 
+import javax.jcr.Item;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 import javax.jcr.NamespaceException;
@@ -136,11 +137,21 @@
         assertEquals("Namespace prefix was not registered.", namespacePrefix, nsp.getPrefix(namespaceUri));
         assertEquals("Namespace URI was not registered.", namespaceUri, nsp.getURI(namespacePrefix));
 
-        testRootNode.addNode(namespacePrefix + ":root");
-        testRootNode.save();
+        Item created;
+        
+        try {
+            created = testRootNode.addNode(namespacePrefix + ":root");
+            testRootNode.save();
+        }
+        catch (RepositoryException ex) {
+            // that didn't work; maybe the repository allows a property here?
+            testRootNode.getSession().refresh(false);
+            created = testRootNode.setProperty(namespacePrefix + ":root", "test");
+            testRootNode.save();
+        }
 
         // Need to remove it here, otherwise teardown can't unregister the NS.
-        testRootNode.getNode(namespacePrefix + ":root").remove();
+        testRootNode.getSession().getItem(created.getPath()).remove();
         testRootNode.save();
     }
 



Mime
View raw message