jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1448734 - in /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment: CompareAgainstBaseStateTest.java RecordTest.java SegmentSizeTest.java
Date Thu, 21 Feb 2013 17:34:08 GMT
Author: jukka
Date: Thu Feb 21 17:34:08 2013
New Revision: 1448734

URL: http://svn.apache.org/r1448734
Log:
OAK-593: Segment-based MK

Fix test cases

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/CompareAgainstBaseStateTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/RecordTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentSizeTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/CompareAgainstBaseStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/CompareAgainstBaseStateTest.java?rev=1448734&r1=1448733&r2=1448734&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/CompareAgainstBaseStateTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/CompareAgainstBaseStateTest.java
Thu Feb 21 17:34:08 2013
@@ -148,9 +148,9 @@ public class CompareAgainstBaseStateTest
     }
 
     private NodeState persist(NodeBuilder builder) {
-        RecordId id = writer.writeNode(builder.getNodeState());
+        NodeState state = writer.writeNode(builder.getNodeState());
         writer.flush();
-        return new SegmentNodeState(reader, id);
+        return state;
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/RecordTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/RecordTest.java?rev=1448734&r1=1448733&r2=1448734&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/RecordTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/RecordTest.java
Thu Feb 21 17:34:08 2013
@@ -240,9 +240,8 @@ public class RecordTest {
     @Test
     public void testEmptyNode() {
         NodeState before = MemoryNodeState.EMPTY_NODE;
-        RecordId id = writer.writeNode(before);
+        NodeState after = writer.writeNode(before);
         writer.flush();
-        NodeState after = new SegmentNodeState(reader, id);
         assertEquals(before, after);
     }
 
@@ -253,9 +252,8 @@ public class RecordTest {
                 .setProperty("bar", 123)
                 .setProperty("baz", Math.PI)
                 .getNodeState();
-        RecordId id = writer.writeNode(before);
+        NodeState after = writer.writeNode(before);
         writer.flush();
-        NodeState after = new SegmentNodeState(reader, id);
         assertEquals(before, after);
     }
 
@@ -266,10 +264,9 @@ public class RecordTest {
         for (int i = 0; i < 1000; i++) {
             builder = builder.child("test");
         }
-         NodeState before = builder.getNodeState();
-        RecordId id = writer.writeNode(before);
+        NodeState before = builder.getNodeState();
+        NodeState after = writer.writeNode(before);
         writer.flush();
-        NodeState after = new SegmentNodeState(reader, id);
         assertEquals(before, after);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentSizeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentSizeTest.java?rev=1448734&r1=1448733&r2=1448734&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentSizeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentSizeTest.java
Thu Feb 21 17:34:08 2013
@@ -153,23 +153,23 @@ public class SegmentSizeTest {
             builder.child("child" + i);
         }
 
-        RecordId id = writer.writeNode(builder.getNodeState());
+        SegmentNodeState state = writer.writeNode(builder.getNodeState());
         writer.flush();
-        Segment segment = store.readSegment(id.getSegmentId());
+        Segment segment = store.readSegment(state.getRecordId().getSegmentId());
         assertEquals(26040, segment.getData().length);
 
-        builder = new SegmentNodeState(reader, id).builder();
+        builder = state.builder();
         builder.child("child1000");
-        id = writer.writeNode(builder.getNodeState());
+        state = writer.writeNode(builder.getNodeState());
         writer.flush();
-        segment = store.readSegment(id.getSegmentId());
+        segment = store.readSegment(state.getRecordId().getSegmentId());
         assertEquals(576, segment.getData().length);
     }
 
     private int getSize(NodeBuilder builder) {
         SegmentStore store = new MemoryStore();
         SegmentWriter writer = new SegmentWriter(store, new SegmentReader(store));
-        RecordId id = writer.writeNode(builder.getNodeState());
+        RecordId id = writer.writeNode(builder.getNodeState()).getRecordId();
         writer.flush();
         Segment segment = store.readSegment(id.getSegmentId());
         return segment.getData().length;
@@ -181,7 +181,7 @@ public class SegmentSizeTest {
         NodeState state = builder.getNodeState();
         writer.writeNode(state);
         writer.flush();
-        RecordId id = writer.writeNode(state);
+        RecordId id = writer.writeNode(state).getRecordId();
         writer.flush();
         Segment segment = store.readSegment(id.getSegmentId());
         return segment.getData().length;



Mime
View raw message