metadata2, ByteContainer.simple(CUSTOM_METADATA_REPLACE),
true, checker);
_verifyCounts(1L, store);
final Storable oldEntry = resp.getPreviousEntry();
assertNotNull(oldEntry);
assertTrue(oldEntry.hasExternalData());
if (expSuccess) { // yes, ought to overwrite:
assertTrue("Should succeeed with checker "+checker, resp.succeeded());
} else { // nope, original retained
assertFalse("Should fail with checker "+checker, resp.succeeded());
}
// and then verify
Storable entry = store.findEntry(StoreOperationSource.REQUEST, null, KEY1);
assertNotNull(entry);
assertFalse(entry.hasInlineData());
assertTrue(entry.hasExternalData());
assertEquals(Compression.LZF, entry.getCompression());
if (expSuccess) {
assertEquals(START_TIME_0 + 1000L, entry.getLastModified());
assertEquals(DATA_REPLACE.length, entry.getOriginalLength());
assertEquals(DATA_REPLACE.length, entry.getActualUncompressedLength());
_verifyMetadata(entry, CUSTOM_METADATA_REPLACE);
} else {
assertEquals(START_TIME_0, entry.getLastModified());
assertEquals(DATA_ORIG.length, entry.getOriginalLength());
assertEquals(DATA_ORIG.length, entry.getActualUncompressedLength());
_verifyMetadata(entry, CUSTOM_METADATA_ORIG);
}
// and read the contents
File f = entry.getExternalFile(store.getFileManager());
if (!f.exists()) {
fail("File '"+f.getAbsolutePath()+"' (replacement? "+expSuccess+") should exist, does not");
}
byte[] b = readFile(f);
byte[] uncomp = Compressors.lzfUncompress(b);