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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidprotected final voidprotected voidassertGetTraceReturns(String traceId, List<Span> trace) protected voidassertGetTraceReturns(Span onlySpan) protected voidassertGetTraceReturnsEmpty(String traceId) protected voidassertGetTracesReturns(List<String> traceIds, List<Span>... traces) protected voidassertGetTracesReturns(QueryRequest request, List<Span>... traces) protected voidassertGetTracesReturnsCount(QueryRequest request, int traceCount) protected voidassertGetTracesReturnsEmpty(List<String> traceIds) protected voidassertGetTracesReturnsEmpty(QueryRequest request) protected voidprotected voidprotected abstract voidclear()Clears store between tests.protected abstract voidConfigures aStorageComponent.Builderwith parameters for the test being executed.protected booleanSets the test to initialise theStorageComponentbefore each test rather than the test class.protected ServiceAndSpanNamesnames()protected abstract StorageComponent.BuildernewStorageBuilder(org.junit.jupiter.api.TestInfo testInfo) Returns a newStorageComponent.Builderfor connecting to the backend for the test.protected static QueryRequest.Builderprotected booleanOverride for storage that does upserts and cannot return the original spans.protected SpanStorestore()protected static StringtestSuffix(org.junit.jupiter.api.TestInfo testInfo) Used to help tests from colliding too muchprotected Tracestraces()
-
Field Details
-
storage
-
-
Constructor Details
-
ITStorage
public ITStorage()
-
-
Method Details
-
checkStorage
protected void checkStorage() -
initializeStoragePerTest
protected boolean initializeStoragePerTest()Sets the test to initialise theStorageComponentbefore 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.Builderfor connecting to the backend for the test. -
configureStorageForTest
Configures aStorageComponent.Builderwith 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
-