jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1517471 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java
Date Mon, 26 Aug 2013 09:03:40 GMT
Author: mduerig
Date: Mon Aug 26 09:03:40 2013
New Revision: 1517471

URL: http://svn.apache.org/r1517471
Log:
OAK-974: Adding same name sibling throws ItemExistsException
Test case demonstrating the backward compatibility issue

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java?rev=1517471&r1=1517470&r2=1517471&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CompatibilityIssuesTest.java
Mon Aug 26 09:03:40 2013
@@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit;
 
 import javax.jcr.Credentials;
 import javax.jcr.InvalidItemStateException;
+import javax.jcr.ItemExistsException;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -43,12 +44,15 @@ import javax.jcr.observation.Observation
 import org.apache.jackrabbit.api.JackrabbitRepository;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
 /**
  * This class contains test cases which demonstrate changes in behaviour wrt. to Jackrabbit
2.
  * 
  * @see <a href="https://issues.apache.org/jira/browse/OAK-14">OAK-14: Identify and
document changes in behaviour wrt. Jackrabbit 2</a>
  */
+@RunWith(Parameterized.class)
 public class CompatibilityIssuesTest extends AbstractRepositoryTest {
 
     public CompatibilityIssuesTest(NodeStoreFixture fixture) {
@@ -222,5 +226,29 @@ public class CompatibilityIssuesTest ext
             observingSession.logout();
         }
     }
+    
+    @Test
+    public void noSNSSupport() throws RepositoryException{
+        Session session = getAdminSession();
+        Node testNode = session.getRootNode().addNode("test", "nt:unstructured");
+        session.save();
+
+        testNode.addNode("foo");
+        try {
+            testNode.addNode("foo");
+            // This would fail on JR2 since there SNSs are supported
+            fail("Expected ItemExistsException");
+        } catch (ItemExistsException e){
+            //ItemExistsException is expected to be thrown
+        }
+        session.save();
+        try {
+            testNode.addNode("foo");
+            // This would fail on JR2 since there SNSs are supported
+            fail("Expected ItemExistsException");
+        } catch (ItemExistsException e){
+            //ItemExistsException is expected to be thrown
+        }
+    }
 
 }



Mime
View raw message