jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1572523 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/
Date Thu, 27 Feb 2014 11:30:00 GMT
Author: angela
Date: Thu Feb 27 11:29:59 2014
New Revision: 1572523

URL: http://svn.apache.org/r1572523
Log:
minor improvement

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java?rev=1572523&r1=1572522&r2=1572523&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SecureNodeState.java
Thu Feb 27 11:29:59 2014
@@ -35,12 +35,6 @@ import static com.google.common.collect.
 import static com.google.common.collect.Iterables.transform;
 import static java.util.Collections.emptyList;
 
-/**
- * SecureNodeState...
- *
- * TODO: clarify if HIDDEN items should be filtered by this NodeState implementation
- * TODO: clarify usage of ReadStatus in getChildNodeEntries
- */
 class SecureNodeState extends AbstractNodeState {
 
     /**
@@ -147,7 +141,7 @@ class SecureNodeState extends AbstractNo
         if (treePermission.canReadAll()) {
             // everything is readable including ac-content -> no secure wrapper needed
             return state.getChildNodeEntries();
-        } else if (treePermission.canRead()) {// TODO: check DENY_CHILDREN?
+        } else if (treePermission.canRead()) {
             Iterable<ChildNodeEntry> readable = transform(
                     state.getChildNodeEntries(),
                     new WrapChildEntryFunction());

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java?rev=1572523&r1=1572522&r2=1572523&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
Thu Feb 27 11:29:59 2014
@@ -25,9 +25,6 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.junit.Test;
 
-/**
- * MoveTest... TODO
- */
 public class MoveTest extends AbstractJCRTest {
 
     private void move(String src, String dest, boolean save) throws Exception {

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java?rev=1572523&r1=1572522&r2=1572523&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
Thu Feb 27 11:29:59 2014
@@ -24,10 +24,13 @@ import java.util.Calendar;
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.PropertyType;
+import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.retention.RetentionPolicy;
 import javax.jcr.security.Privilege;
 
 import com.google.common.base.Charsets;
@@ -55,17 +58,17 @@ public class TestContentLoader {
         addPropertyTestData(getOrAddNode(data, "property"));
         addQueryTestData(getOrAddNode(data, "query"));
         addNodeTestData(getOrAddNode(data, "node"));
-        // TODO add lifecycle test data
-        // addLifecycleTestData(getOrAddNode(data, "lifecycle"));
+        if (session.getRepository().getDescriptorValue(Repository.OPTION_LIFECYCLE_SUPPORTED).getBoolean())
{
+            addLifecycleTestData(getOrAddNode(data, "lifecycle"));
+        }
         addExportTestData(getOrAddNode(data, "docViewTest"));
 
-        // TODO add retention test data
-        // Node conf = getOrAddNode(session.getRootNode(), "testconf");
-        // addRetentionTestData(getOrAddNode(conf, "retentionTest"));
+        if (session.getRepository().getDescriptorValue(Repository.OPTION_RETENTION_SUPPORTED).getBoolean())
{
+            Node conf = getOrAddNode(session.getRootNode(), "testconf");
+            addRetentionTestData(getOrAddNode(conf, "retentionTest"));
+        }
 
-        // TODO add proper configuration for security setup
         AccessControlUtils.addAccessControlEntry(session, "/", EveryonePrincipal.getInstance(),
new String[]{Privilege.JCR_READ}, true);
-
         session.save();
     }
 
@@ -103,14 +106,17 @@ public class TestContentLoader {
         node.setProperty("multi", new String[] { "one", "two", "three" });
     }
 
-    // TODO add retention test data
     /**
      * Creates a node with a RetentionPolicy
      */
-    // private  void addRetentionTestData(Node node) throws RepositoryException {
-    //    RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy",
node.getSession());
-    //    node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
-    // }
+    private  void addRetentionTestData(Node node) throws RepositoryException {
+        RetentionPolicy rp = createRetentionPolicy("testRetentionPolicy", node.getSession());
+        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
+    }
+
+    private RetentionPolicy createRetentionPolicy(String testRetentionPolicy, Session session)
{
+        throw new UnsupportedOperationException("Retention Management not yet implemented");
+    }
 
     /**
      * Creates four nodes under the given node. Each node has a String property
@@ -165,21 +171,25 @@ public class TestContentLoader {
         JcrUtils.putFile(node, "testFile", "text/plain", new ByteArrayInputStream("Hello,
World!".getBytes("UTF-8")));
     }
 
-    // TODO add lifecycle test data
     /**
      * Creates a lifecycle policy node and another node with a lifecycle
      * referencing that policy.
      */
-    // private  void addLifecycleTestData(Node node) throws RepositoryException {
-    //    Node policy = getOrAddNode(node, "policy");
-    //    policy.addMixin(NodeType.MIX_REFERENCEABLE);
-    //    Node transitions = getOrAddNode(policy, "transitions");
-    //    Node transition = getOrAddNode(transitions, "identity");
-    //    transition.setProperty("from", "identity");
-    //    transition.setProperty("to", "identity");
-    //    Node lifecycle = getOrAddNode(node, "node");
-    //    ((NodeImpl) lifecycle).assignLifecyclePolicy(policy, "identity");
-    //}
+    private  void addLifecycleTestData(Node node) throws RepositoryException {
+        Node policy = getOrAddNode(node, "policy");
+        policy.addMixin(NodeType.MIX_REFERENCEABLE);
+        Node transitions = getOrAddNode(policy, "transitions");
+        Node transition = getOrAddNode(transitions, "identity");
+        transition.setProperty("from", "identity");
+        transition.setProperty("to", "identity");
+        Node lifecycle = getOrAddNode(node, "node");
+        assignLifecyclePolicy(lifecycle, policy, "identity");
+    }
+
+    private void assignLifecyclePolicy(Node lifecycle, Node policy, String identity) {
+        throw new UnsupportedOperationException("Lifecycle Management is not yet implemented");
+
+    }
 
     private static void addExportTestData(Node node) throws RepositoryException, IOException
{
         getOrAddNode(node, "invalidXmlName").setProperty("propName", "some text");

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java?rev=1572523&r1=1572522&r2=1572523&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
Thu Feb 27 11:29:59 2014
@@ -23,9 +23,6 @@ import javax.jcr.version.VersionManager;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 
-/**
- * VersionablePathsTest... TODO
- */
 public class VersionablePathsTest extends AbstractJCRTest {
 
     private VersionManager getVersionManager() throws RepositoryException {



Mime
View raw message