jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1547813 - in /jackrabbit/oak/trunk: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
Date Wed, 04 Dec 2013 14:51:59 GMT
Author: jukka
Date: Wed Dec  4 14:51:59 2013
New Revision: 1547813

URL: http://svn.apache.org/r1547813
Log:
OAK-1159: Backup and restore

Fix (and @Ignore) the blob duplication test case, it didn't really capture the problem so
far
Improve the tarmk inspection output format.

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java?rev=1547813&r1=1547812&r2=1547813&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupTest.java
Wed Dec  4 14:51:59 2013
@@ -22,16 +22,15 @@ import static org.apache.commons.io.File
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.lang.RandomStringUtils;
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.plugins.memory.StringBasedBlob;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore;
 import org.apache.jackrabbit.oak.plugins.segment.file.FileStore;
@@ -41,6 +40,7 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class FileStoreBackupTest {
@@ -101,14 +101,14 @@ public class FileStoreBackupTest {
                 .with(new InitialContent()).createContentRepository();
     }
 
-    @Test
+    @Test @Ignore("OAK-1159 duplicate content")
     public void testSharedContent() throws Exception {
         FileStore source = new FileStore(src, 256, false);
 
         NodeStore store = new SegmentNodeStore(source);
 
-        // ~60k
-        Blob blob = new StringBasedBlob(RandomStringUtils.random(10240));
+        // ~100k
+        Blob blob = store.createBlob(new ByteArrayInputStream(new byte[100000]));
 
         NodeBuilder builder = store.getRoot().builder();
         NodeBuilder c1 = builder.child("test-backup");
@@ -135,7 +135,7 @@ public class FileStoreBackupTest {
             assertTrue(f.getName() + " is missing from the backup",
                     expected.containsKey(f.getName()));
             assertTrue(
-                    f.getName() + " is expected to have size < "
+                    f.getName() + " is expected to have size <= "
                             + expected.get(f.getName()) + " actually is "
                             + f.length(),
                     f.length() <= expected.get(f.getName()));

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1547813&r1=1547812&r2=1547813&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Wed
Dec  4 14:51:59 2013
@@ -158,8 +158,8 @@ public class Main {
                         }
                         System.out.println("Available for garbage collection:");
                         System.out.format(
-                                "%6dkB in %6d data segments%n",
-                                dataSize / 1024, dataCount);
+                                "%6dMB in %6d data segments%n",
+                                dataSize / (1024 * 1024), dataCount);
                         System.out.format(
                                 "%6dMB in %6d bulk segments%n",
                                 bulkSize / (1024 * 1024), bulkCount);



Mime
View raw message