jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1506945 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java
Date Thu, 25 Jul 2013 12:56:32 GMT
Author: angela
Date: Thu Jul 25 12:56:32 2013
New Revision: 1506945

URL: http://svn.apache.org/r1506945
Log:
JCR-3631 : SessionTest#hasCapability: missing save call

(in addition changed to test-setup such that any modification is made to the test node that
is properly cleared in the teardown instead of directly modifying the root node)

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java?rev=1506945&r1=1506944&r2=1506945&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/SessionTest.java
Thu Jul 25 12:56:32 2013
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import org.apache.jackrabbit.test.AbstractJCRTest;
-import org.apache.jackrabbit.test.NotExecutableException;
-
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.RepositoryException;
-import javax.jcr.Node;
+import javax.jcr.InvalidItemStateException;
 import javax.jcr.ItemExistsException;
+import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.InvalidItemStateException;
 import javax.jcr.Value;
-import javax.jcr.Repository;
 import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+
+import org.apache.jackrabbit.test.AbstractJCRTest;
+import org.apache.jackrabbit.test.NotExecutableException;
 
 /**
  * <code>SessionTest</code> contains all test cases for the
@@ -678,13 +678,14 @@ public class SessionTest extends Abstrac
     public void testHasCapability() throws RepositoryException {
         Session roSession = getHelper().getReadOnlySession();
         try {
-            Node root = roSession.getRootNode();
+            Node testRoot = roSession.getNode(testRootNode.getPath());
             Object[] args = new Object[] { "foo" };
-            if (!roSession.hasCapability("addNode",  root, args)) {
+            if (!roSession.hasCapability("addNode",  testRoot, args)) {
                 // if hasCapability() returns false, the actual method call
                 // is expected to fail
                 try {
-                    root.addNode("foo");
+                    testRoot.addNode("foo");
+                    roSession.save();
                     fail("Node.addNode() should fail according to Session.hasCapability()");
                 } catch (RepositoryException e) {
                     // expected 



Mime
View raw message