Package zipkin2.storage
Class ITStorage<T extends StorageComponent>
java.lang.Object
zipkin2.storage.ITStorage<T>
- Direct Known Subclasses:
ITAutocompleteTags
,ITDependencies
,ITDependenciesHeavy
,ITSearchEnabledFalse
,ITServiceAndSpanNames
,ITSpanStore
,ITSpanStoreHeavy
,ITStrictTraceIdFalse
,ITTraces
Base class for all
StorageComponent
integration tests.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
protected final void
protected void
assertGetTraceReturns
(String traceId, List<Span> trace) protected void
assertGetTraceReturns
(Span onlySpan) protected void
assertGetTraceReturnsEmpty
(String traceId) protected void
assertGetTracesReturns
(List<String> traceIds, List<Span>... traces) protected void
assertGetTracesReturns
(QueryRequest request, List<Span>... traces) protected void
assertGetTracesReturnsCount
(QueryRequest request, int traceCount) protected void
assertGetTracesReturnsEmpty
(List<String> traceIds) protected void
assertGetTracesReturnsEmpty
(QueryRequest request) protected void
protected void
protected abstract void
clear()
Clears store between tests.protected abstract void
Configures aStorageComponent.Builder
with parameters for the test being executed.protected boolean
Sets the test to initialise theStorageComponent
before each test rather than the test class.protected ServiceAndSpanNames
names()
protected abstract StorageComponent.Builder
newStorageBuilder
(org.junit.jupiter.api.TestInfo testInfo) Returns a newStorageComponent.Builder
for connecting to the backend for the test.protected static QueryRequest.Builder
protected boolean
Override for storage that does upserts and cannot return the original spans.protected SpanStore
store()
protected static String
testSuffix
(org.junit.jupiter.api.TestInfo testInfo) Used to help tests from colliding too muchprotected Traces
traces()
-
Field Details
-
storage
-
-
Constructor Details
-
ITStorage
public ITStorage()
-
-
Method Details
-
checkStorage
protected void checkStorage() -
initializeStoragePerTest
protected boolean initializeStoragePerTest()Sets the test to initialise theStorageComponent
before each test rather than the test class. Generally, tests will run faster if the storage is initialized as infrequently as possibly while clearing data between runs, but for certain backends like Cassandra, it's difficult to reliably clear data between runs and tends to be very slow anyways. -
newStorageBuilder
protected abstract StorageComponent.Builder newStorageBuilder(org.junit.jupiter.api.TestInfo testInfo) Returns a newStorageComponent.Builder
for connecting to the backend for the test. -
configureStorageForTest
Configures aStorageComponent.Builder
with parameters for the test being executed. -
traces
-
store
-
names
-
accept
- Throws:
IOException
-
accept
- Throws:
IOException
-
blockWhileInFlight
protected void blockWhileInFlight() -
clear
Clears store between tests.- Throws:
Exception
-
requestBuilder
-
assertGetTracesReturns
protected void assertGetTracesReturns(QueryRequest request, List<Span>... traces) throws IOException - Throws:
IOException
-
assertGetTraceReturns
- Throws:
IOException
-
assertGetTraceReturns
- Throws:
IOException
-
assertGetTraceReturnsEmpty
- Throws:
IOException
-
assertGetTracesReturns
protected void assertGetTracesReturns(List<String> traceIds, List<Span>... traces) throws IOException - Throws:
IOException
-
assertGetTracesReturnsEmpty
- Throws:
IOException
-
assertGetTracesReturnsCount
- Throws:
IOException
-
assertGetTracesReturnsEmpty
- Throws:
IOException
-
returnsRawSpans
protected boolean returnsRawSpans()Override for storage that does upserts and cannot return the original spans. -
testSuffix
Used to help tests from colliding too much -
sortTrace
-