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
Fields inherited from class io.permazen.test.TestSupport
log, random, validator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected KVTransaction
protected KVTransaction
protected int
protected static KVPair
protected String
mapRetryExceptionMessage
(String message) protected String
void
protected RuntimeException
Dump KV contents to the log.protected RuntimeException
Dump KV portion to the log.static NavigableMap<String,
String> stringView
(NavigableMap<byte[], byte[]> byteMap) static NavigableSet<String>
stringView
(NavigableSet<byte[]> byteSet) void
protected String
toXmlString
(KVStore kv) protected String
toXmlString
(KVStore kv, byte[] minKey, byte[] maxKey) protected void
tryNtimes
(KVDatabase kvdb, Consumer<KVTransaction> consumer) protected <R> R
tryNtimesWithResult
(KVDatabase kvdb, Function<KVTransaction, R> function) protected void
Methods inherited from class io.permazen.test.TestSupport
assertEquals, assertEquals, assertSameOrDiff, b, ba, buildList, buildMap, buildSet, buildSortedMap, buildSortedSet, checkMap, checkSet, checkValid, createTempDirectory, deleteDirectoryHierarchy, diff, getRandom, randomBytes, randomBytes, readResource, readResource, readResource, s, 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
-
kv
-
tryNtimes
-
tryNtimesWithResult
-
getNumTries
protected int getNumTries() -
createKVTransaction
-
doCreateTransaction
-
updateRetryStats
-
mapRetryExceptionMessage
-