Author: mreutegg
Date: Tue Jul 18 09:37:35 2017
New Revision: 1802262

URL: http://svn.apache.org/viewvc?rev=1802262&view=rev
Log:
OAK-6462: Incorrect memory calculation for bundled node states

Add ignored test

Modified:
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java?rev=1802262&r1=1802261&r2=1802262&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java
 Tue Jul 18 09:37:35 2017
@@ -29,6 +29,8 @@ import javax.annotation.Nonnull;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+
+import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
@@ -40,6 +42,7 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore;
 import org.apache.jackrabbit.oak.plugins.document.NodeDocument;
 import org.apache.jackrabbit.oak.plugins.document.PathRev;
+import org.apache.jackrabbit.oak.plugins.document.RandomStream;
 import org.apache.jackrabbit.oak.plugins.document.TestNodeObserver;
 import org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore;
 import org.apache.jackrabbit.oak.plugins.document.util.Utils;
@@ -184,6 +187,32 @@ public class DocumentBundlingTest {
         assertThat(bundledMem, is(greaterThan(nonBundledMem)));
     }
 
+    @Ignore("OAK-6462")
+    @Test
+    public void memoryWithBinary() throws Exception {
+        Blob blob = store.createBlob(new RandomStream(1024, 17));
+        NodeBuilder builder = store.getRoot().builder();
+        NodeBuilder bundledFileNode = newNode("nt:file");
+        bundledFileNode.child("jcr:content").setProperty("jcr:data", blob);
+        builder.child("test").setChildNode("book.jpg", 
bundledFileNode.getNodeState());
+
+        //Create a non bundled NodeState structure nt:File vs nt:file
+        NodeBuilder nonBundledFileNode = newNode("nt:File");
+        nonBundledFileNode.child("jcr:content").setProperty("jcr:data", blob);
+        builder.child("test").setChildNode("book2.jpg", 
nonBundledFileNode.getNodeState());
+        merge(builder);
+
+        NodeState root = store.getRoot();
+        DocumentNodeState bundledFile = asDocumentState(getNode(root, 
"/test/book.jpg"));
+        DocumentNodeState nonBundledFile = asDocumentState(getNode(root, 
"/test/book2.jpg"));
+        DocumentNodeState nonBundledContent = asDocumentState(getNode(root, 
"/test/book2.jpg/jcr:content"));
+
+        int nonBundledMem = nonBundledFile.getMemory() + 
nonBundledContent.getMemory();
+        int bundledMem = bundledFile.getMemory();
+
+        assertThat(bundledMem, is(greaterThan(nonBundledMem)));
+    }
+
     @Test
     public void bundlorUtilsIsBundledMethods() throws Exception{
         NodeBuilder builder = store.getRoot().builder();


Reply via email to