use of org.apache.jackrabbit.core.data.DataIdentifier in project jackrabbit-oak by apache.
the class AzureDataStoreTest method testBackendReadRecordNullIdentifier.
// Read (Backend)
@Test
public void testBackendReadRecordNullIdentifier() throws DataStoreException {
DataIdentifier identifier = null;
try {
backend.read(identifier);
fail();
} catch (NullPointerException e) {
assert ("identifier".equals(e.getMessage()));
}
}
use of org.apache.jackrabbit.core.data.DataIdentifier in project jackrabbit-oak by apache.
the class AzureDataStoreTest method testBackendDeleteRecordInvalidIdentifier.
@Test
public void testBackendDeleteRecordInvalidIdentifier() throws DataStoreException {
DataIdentifier identifier = new DataIdentifier("fake");
// We don't care if the identifier is invalid; this is a noop
backend.deleteRecord(identifier);
}
use of org.apache.jackrabbit.core.data.DataIdentifier in project jackrabbit-oak by apache.
the class AzureDataStoreTest method testBackendWriteRecordNullFileThrowsNullPointerException.
@Test
public void testBackendWriteRecordNullFileThrowsNullPointerException() throws DataStoreException {
File testFile = null;
DataIdentifier identifier = new DataIdentifier("fake");
try {
backend.write(identifier, testFile);
fail();
} catch (NullPointerException e) {
assertTrue("file".equals(e.getMessage()));
}
}
use of org.apache.jackrabbit.core.data.DataIdentifier in project jackrabbit-oak by apache.
the class AzureDataStoreTest method testBackendReadRecordInvalidIdentifier.
@Test
public void testBackendReadRecordInvalidIdentifier() {
DataIdentifier identifier = new DataIdentifier("fake");
try {
backend.read(identifier);
fail();
} catch (DataStoreException e) {
}
}
use of org.apache.jackrabbit.core.data.DataIdentifier in project jackrabbit-oak by apache.
the class AzureDataStoreTest method testCreateAndReUploadBlob.
@Test
public void testCreateAndReUploadBlob() throws DataStoreException, IOException {
final DataRecord createdRecord = ds.addRecord(new ByteArrayInputStream(testBuffer));
DataIdentifier identifier1 = createdRecord.getIdentifier();
assertTrue(backend.exists(identifier1));
final DataRecord record1 = ds.getRecord(identifier1);
validateRecord(record1, new String(testBuffer), createdRecord);
try {
Thread.sleep(1001);
} catch (InterruptedException e) {
}
final DataRecord updatedRecord = ds.addRecord(new ByteArrayInputStream(testBuffer));
DataIdentifier identifier2 = updatedRecord.getIdentifier();
assertTrue(backend.exists(identifier2));
assertTrue(identifier1.toString().equals(identifier2.toString()));
validateRecord(record1, new String(testBuffer), createdRecord);
ds.deleteRecord(identifier1);
assertFalse(backend.exists(createdRecord.getIdentifier()));
}
Aggregations