mreutegg commented on code in PR #1051:
URL: https://github.com/apache/jackrabbit-oak/pull/1051#discussion_r1328414603


##########
oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionableTest.java:
##########
@@ -362,6 +363,68 @@ public void testIsCheckedOutOnNonAccessibleParent() throws 
Exception {
         assertFalse(guest.getNode(nodePath).isCheckedOut());
     }
 
+    public void testNonVersionableCheckedOut() throws Exception {
+        Node node = testRootNode.addNode(nodeName1, "nt:unstructured");
+        superuser.save();
+
+        assertTrue(node.isCheckedOut());
+
+        node.setProperty("jcr:isCheckedOut", false);
+        superuser.save();
+
+        assertTrue(node.isCheckedOut());
+    }
+
+    public void testModifyNonVersionableNodeWithCheckedOutProperty() throws 
Exception {
+        Node node = testRootNode.addNode(nodeName1, "nt:unstructured");
+        superuser.save();
+
+        assertTrue(node.isCheckedOut());
+
+        node.setProperty("jcr:isCheckedOut", false);
+        superuser.save();
+
+        node.setProperty("test", true);
+        superuser.save();
+
+        assertTrue(node.getProperty("test").getBoolean());
+
+        node.setProperty("test", false);
+        superuser.save();
+
+        assertFalse(node.getProperty("test").getBoolean());
+
+        node.getProperty("test").remove();
+        superuser.save();
+        assertFalse(node.hasProperty("test"));
+
+        node.addNode(nodeName2, "nt:unstructured");
+        superuser.save();
+
+        assertTrue(node.hasNode(nodeName2));
+
+        node.getNode(nodeName2).remove();
+        superuser.save();
+
+        assertFalse(node.hasNode(nodeName2));
+    }
+
+   public void testAddRemoveMixinVersionable() throws Exception {
+        Node node = testRootNode.addNode(nodeName1, "nt:unstructured");
+        node.addMixin(mixVersionable);
+        superuser.save();
+        node.checkin();
+        superuser.save();
+        assertFalse(node.isCheckedOut());
+        node.checkout();
+        superuser.save();
+        assertTrue(node.isCheckedOut());
+        node.removeMixin(mixVersionable);
+        superuser.save();
+        assertTrue(node.isCheckedOut());
+        assertFalse(node.hasProperty(jcrIsCheckedOut));
+    }

Review Comment:
   I think it would be good to extend this test a bit and add mix:versionable 
again at the end, then verify version semantics are still correct. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to