@ -57,9 +57,9 @@ public class LeafBucketTest {
@Test
public void testEmpty ( ) {
LeafBucket b = new LeafBucket ( 0 ) ;
assertNull ( b . get ( id ( 0x00 ) , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertNull ( b . get ( id ( 0xfe ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x00 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0xfe ) , null ) ) ;
}
@Test
@ -72,13 +72,13 @@ public class LeafBucketTest {
b . parseOneEntry ( id ( 0x44 ) , id ( 0x84 ) ) ;
b . parseOneEntry ( id ( 0x55 ) , id ( 0x85 ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -91,13 +91,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x44 ) , id ( 0x84 ) , null ) ) ;
assertSame ( b , b . set ( id ( 0x55 ) , id ( 0x85 ) , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -110,13 +110,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x22 ) , id ( 0x82 ) , null ) ) ;
assertSame ( b , b . set ( id ( 0x11 ) , id ( 0x81 ) , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -130,13 +130,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x22 ) , id ( 0x82 ) , null ) ) ;
assertSame ( b , b . set ( id ( 0x44 ) , id ( 0x84 ) , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -144,18 +144,18 @@ public class LeafBucketTest {
LeafBucket b = new LeafBucket ( 0 ) ;
assertSame ( b , b . set ( id ( 0x11 ) , id ( 0x81 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertSame ( b , b . set ( id ( 0x11 ) , id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x01 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x01 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
}
@Test
public void testRemoveMissingNote ( ) throws IOException {
LeafBucket b = new LeafBucket ( 0 ) ;
assertNull ( b . get ( id ( 0x11 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x11 ) , null ) ) ;
assertSame ( b , b . set ( id ( 0x11 ) , null , null ) ) ;
assertNull ( b . get ( id ( 0x11 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x11 ) , null ) ) ;
}
@Test
@ -170,13 +170,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x11 ) , null , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertNull ( b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -191,13 +191,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x33 ) , null , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertNull ( b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertEquals ( id ( 0x85 ) , b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x85 ) , b . getNote ( id ( 0x55 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -212,13 +212,13 @@ public class LeafBucketTest {
assertSame ( b , b . set ( id ( 0x55 ) , null , null ) ) ;
assertNull ( b . get ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x82 ) , b . get ( id ( 0x22 ) , null ) ) ;
assertEquals ( id ( 0x83 ) , b . get ( id ( 0x33 ) , null ) ) ;
assertEquals ( id ( 0x84 ) , b . get ( id ( 0x44 ) , null ) ) ;
assertNull ( b . get ( id ( 0x55 ) , null ) ) ;
assertNull ( b . get ( id ( 0x66 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x01 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x82 ) , b . getNote ( id ( 0x22 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x83 ) , b . getNote ( id ( 0x33 ) , null ) . getData ( ) ) ;
assertEquals ( id ( 0x84 ) , b . getNote ( id ( 0x44 ) , null ) . getData ( ) ) ;
assertNull ( b . getNote ( id ( 0x55 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x66 ) , null ) ) ;
}
@Test
@ -226,10 +226,10 @@ public class LeafBucketTest {
LeafBucket b = new LeafBucket ( 0 ) ;
assertSame ( b , b . set ( id ( 0x11 ) , id ( 0x81 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . get ( id ( 0x11 ) , null ) ) ;
assertEquals ( id ( 0x81 ) , b . getNote ( id ( 0x11 ) , null ) . getData ( ) ) ;
assertNull ( b . set ( id ( 0x11 ) , null , null ) ) ;
assertNull ( b . get ( id ( 0x11 ) , null ) ) ;
assertNull ( b . getNote ( id ( 0x11 ) , null ) ) ;
}
private static AnyObjectId id ( int first ) {