use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class AsyncPropertyIndexTest method testAsyncPropertyNoChanges.
@Test
public void testAsyncPropertyNoChanges() throws Exception {
NodeStore store = new MemoryNodeStore();
assertTrue(Iterables.isEmpty(store.checkpoints()));
AsyncIndexUpdate async = new AsyncIndexUpdate(ASYNC_REINDEX_VALUE, store, provider, true);
async.run();
async.run();
async.close();
assertTrue(Iterables.isEmpty(store.checkpoints()));
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class S3DataStoreStatsTest method testIsFileSyncedBinaryNotSyncedAndBinariesSyncedReturnsFalse.
@Test
public void testIsFileSyncedBinaryNotSyncedAndBinariesSyncedReturnsFalse() throws Exception {
Blob mockBlob2 = mock(Blob.class);
final String id2 = getIdForInputStream(getStream("testContents2"));
when(mockBlob2.getContentIdentity()).thenReturn(id2);
Blob mockBlob3 = mock(Blob.class);
final String id3 = getIdForInputStream(getStream("testContents3"));
when(mockBlob2.getContentIdentity()).thenReturn(id3);
List<Blob> blobPropList = Lists.newArrayList(mockBlob2, mockBlob3);
NodeStore nodeStore = initNodeStore(Optional.of(mockBlob), Optional.<Blob>absent(), Optional.<String>absent(), Optional.<Integer>absent(), Optional.of(blobPropList));
stats = new S3DataStoreStats();
stats.nodeStore = nodeStore;
stats.s3ds = autoSyncMockS3ds;
assertSyncedFalse(stats, autoSyncMockS3ds, getStream("testContents2"), getStream("testContents3"));
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class S3DataStoreStatsTest method testIsFileSyncedBinarySyncedAndBinariesNotSyncedReturnsFalse.
@Test
public void testIsFileSyncedBinarySyncedAndBinariesNotSyncedReturnsFalse() throws Exception {
Blob mockBlob2 = mock(Blob.class);
final String id2 = getIdForInputStream(getStream("testContents2"));
when(mockBlob2.getContentIdentity()).thenReturn(id2);
Blob mockBlob3 = mock(Blob.class);
final String id3 = getIdForInputStream(getStream("testContents3"));
when(mockBlob2.getContentIdentity()).thenReturn(id3);
List<Blob> blobPropList = Lists.newArrayList(mockBlob2, mockBlob3);
NodeStore nodeStore = initNodeStore(Optional.of(mockBlob), Optional.<Blob>absent(), Optional.<String>absent(), Optional.<Integer>absent(), Optional.of(blobPropList));
stats = new S3DataStoreStats();
stats.nodeStore = nodeStore;
stats.s3ds = autoSyncMockS3ds;
assertSyncedFalse(stats, autoSyncMockS3ds, new FileInputStream(testFile), getStream("testContents2"));
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class S3DataStoreStatsTest method testIsFileSyncedBinaryAndBinariesSyncedReturnsTrue.
@Test
public void testIsFileSyncedBinaryAndBinariesSyncedReturnsTrue() throws Exception {
Blob mockBlob2 = mock(Blob.class);
final String id2 = getIdForInputStream(getStream("testContents2"));
when(mockBlob2.getContentIdentity()).thenReturn(id2);
Blob mockBlob3 = mock(Blob.class);
final String id3 = getIdForInputStream(getStream("testContents3"));
when(mockBlob2.getContentIdentity()).thenReturn(id3);
List<Blob> blobPropList = Lists.newArrayList(mockBlob2, mockBlob3);
NodeStore nodeStore = initNodeStore(Optional.of(mockBlob), Optional.<Blob>absent(), Optional.<String>absent(), Optional.<Integer>absent(), Optional.of(blobPropList));
stats = new S3DataStoreStats();
stats.nodeStore = nodeStore;
stats.s3ds = autoSyncMockS3ds;
assertSyncedFalse(stats, autoSyncMockS3ds, new FileInputStream(testFile), getStream("testContents2"), getStream("testContents3"));
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class S3DataStoreStatsTest method testIsFileSyncedMultipleBinaryPropertiesNotAllSyncedReturnsFalse.
@Test
public void testIsFileSyncedMultipleBinaryPropertiesNotAllSyncedReturnsFalse() throws Exception {
Blob mockBlob2 = mock(Blob.class);
final String id2 = getIdForInputStream(getStream("testContents2"));
when(mockBlob2.getContentIdentity()).thenReturn(id2);
NodeStore nodeStore = initNodeStore(Optional.of(mockBlob), Optional.of(mockBlob2), Optional.<String>absent(), Optional.<Integer>absent(), Optional.<List<Blob>>absent());
stats = new S3DataStoreStats();
stats.nodeStore = nodeStore;
stats.s3ds = autoSyncMockS3ds;
assertSyncedFalse(stats, autoSyncMockS3ds, new FileInputStream(testFile));
}
Aggregations