Package io.permazen.kv.test
Class KVTestSupport
java.lang.Object
io.permazen.test.TestSupport
io.permazen.kv.test.KVTestSupport
- Direct Known Subclasses:
AtomicKVStoreTest,KVDatabaseTest
Base class for key/value unit tests.
-
Field Summary
FieldsFields inherited from class io.permazen.test.TestSupport
log, random, validator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ByteDataprotected KVTransactionprotected KVTransactionprotected intprotected static KVPairprotected StringmapRetryExceptionMessage(String message) protected static Stringprotected static Stringvoidprotected RuntimeExceptionDump KV contents to the log.protected RuntimeExceptionDump KV portion to the log.static NavigableMap<String,String> stringView(NavigableMap<ByteData, ByteData> byteMap) static NavigableSet<String>stringView(NavigableSet<ByteData> byteSet) voidprotected StringtoXmlString(KVStore kv) protected StringtoXmlString(KVStore kv, ByteData minKey, ByteData maxKey) protected voidtryNtimes(KVDatabase kvdb, Consumer<KVTransaction> consumer) protected <R> RtryNtimesWithResult(KVDatabase kvdb, Function<KVTransaction, R> function) protected voidMethods inherited from class io.permazen.test.TestSupport
assertEquals, assertEquals, assertSameOrDiff, buildList, buildMap, buildSet, buildSortedMap, buildSortedSet, checkMap, checkSet, checkValid, createTempDirectory, deleteDirectoryHierarchy, diff, getRandom, readResource, readResource, readResource, seedRandom, setUpValidator, show
-
Field Details
-
numTransactionAttempts
-
numTransactionRetries
-
-
Constructor Details
-
KVTestSupport
public KVTestSupport()
-
-
Method Details
-
setupTransactionAttemptCounters
- Throws:
Exception
-
teardownTransactionAttemptCounters
- Throws:
Exception
-
showKV
Dump KV contents to the log.- Parameters:
kv- k/v storelabel- descriptive label- Returns:
- exception thrown during query, or null if successful
-
showKV
Dump KV portion to the log.- Parameters:
kv- k/v storelabel- descriptive labelminKey- minimum keymaxKey- maximum key- Returns:
- exception thrown during query, or null if successful
-
toXmlString
-
toXmlString
-
s
-
b
-
s
-
kv
-
tryNtimes
-
tryNtimesWithResult
-
getNumTries
protected int getNumTries() -
createKVTransaction
-
doCreateTransaction
-
updateRetryStats
-
mapRetryExceptionMessage
-