jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r575330 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJoinTest.java
Date Thu, 13 Sep 2007 15:15:47 GMT
Author: reschke
Date: Thu Sep 13 08:15:46 2007
New Revision: 575330

URL: http://svn.apache.org/viewvc?rev=575330&view=rev
Log:
JCR-1102: testJoin() and testJoinNtbase() - try both mix:referenceable and mix:versionable.

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJoinTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJoinTest.java?rev=575330&r1=575329&r2=575330&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJoinTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/SQLJoinTest.java
Thu Sep 13 08:15:46 2007
@@ -43,14 +43,24 @@
      */
     public void testJoin() throws RepositoryException {
         Node n1 = testRootNode.addNode(nodeName1, testNodeType);
-        if (needsMixin(n1, mixReferenceable)) {
-            n1.addMixin(mixReferenceable);
+        String testMixin = mixReferenceable;
+        if (needsMixin(n1, testMixin)) {
+            n1.addMixin(testMixin);
         }
-        testRootNode.addNode(nodeName2, testNodeType);
+        else {
+            testMixin = mixVersionable;
+            if (needsMixin(n1, testMixin)) {
+                n1.addMixin(testMixin);
+            }
+        }
+
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.save();
 
+        assertFalse("Node at " + n2.getPath() + " should not have mixin " + testMixin, n2.isNodeType(testMixin));
+
         StringBuffer query = new StringBuffer("SELECT * FROM ");
-        query.append(testNodeType).append(", ").append(mixReferenceable);
+        query.append(testNodeType).append(", ").append(testMixin);
         query.append(" WHERE ");
         query.append(testNodeType).append(".").append(jcrPath);
         query.append(" = ");
@@ -66,14 +76,24 @@
      */
     public void testJoinNtBase() throws RepositoryException {
         Node n1 = testRootNode.addNode(nodeName1, testNodeType);
-        if (needsMixin(n1, mixReferenceable)) {
-            n1.addMixin(mixReferenceable);
+        String testMixin = mixReferenceable;
+        if (needsMixin(n1, testMixin)) {
+            n1.addMixin(testMixin);
         }
-        testRootNode.addNode(nodeName2, testNodeType);
+        else {
+            testMixin = mixVersionable;
+            if (needsMixin(n1, testMixin)) {
+                n1.addMixin(testMixin);
+            }
+        }
+
+        Node n2 = testRootNode.addNode(nodeName2, testNodeType);
         testRootNode.save();
 
+        assertFalse("Node at " + n2.getPath() + " should not have mixin " + testMixin, n2.isNodeType(testMixin));
+
         StringBuffer query = new StringBuffer("SELECT * FROM ");
-        query.append(ntBase).append(", ").append(mixReferenceable);
+        query.append(ntBase).append(", ").append(testMixin);
         query.append(" WHERE ");
         query.append(testNodeType).append(".").append(jcrPath);
         query.append(" = ");



Mime
View raw message