[exo-jcr-commits] exo-jcr SVN: r780 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 19 10:32:10 EST 2009


Author: areshetnyak
Date: 2009-11-19 10:32:09 -0500 (Thu, 19 Nov 2009)
New Revision: 780

Modified:
   jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
Log:
EXOJCR-203 : The test JBossCacheStorageConnectionTest was changed.

Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java	2009-11-19 15:15:17 UTC (rev 779)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java	2009-11-19 15:32:09 UTC (rev 780)
@@ -35,6 +35,7 @@
 import java.io.Serializable;
 import java.util.List;
 
+import javax.jcr.ItemExistsException;
 import javax.jcr.lock.LockException;
 
 /**
@@ -643,8 +644,36 @@
          conn.commit();
          
          fail("The node jcr:system shouldnot be save");
-      } catch (Exception e) {
+      } catch (ItemExistsException e) {
          //ok
       }
    }
+   
+   public void testAddPropertyFail() throws Exception
+   {
+      // add root (/)
+      conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED,
+         new InternalQName[0], 0, null, new AccessControlList()));
+
+      // add property (/jcr:primaryType)
+      String propId1 = "1";
+      QPath propPath1 = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_PRIMARYTYPE);
+      TransientPropertyData propData1 = new TransientPropertyData(propPath1, propId1, 1, 1, Constants.ROOT_UUID, false);
+      String propValue1 = "Property value #1";
+      propData1.setValue(new TransientValueData(propValue1));
+      conn.add(propData1);
+
+      
+      
+      try {
+         // add property (/jcr:primaryType) twice 
+         conn.add(propData1);
+         
+         conn.commit();
+         
+         fail("The property (/jcr:primaryType) shouldnot be save");
+      } catch (ItemExistsException e) {
+         //ok
+      }
+   }
 }



More information about the exo-jcr-commits mailing list