Package zipkin2.storage
Class ITStorage<T extends StorageComponent>
- java.lang.Object
-
- zipkin2.storage.ITStorage<T>
-
- Direct Known Subclasses:
ITAutocompleteTags
,ITDependencies
,ITSearchEnabledFalse
,ITServiceAndSpanNames
,ITSpanStore
,ITStrictTraceIdFalse
,ITTraces
@TestInstance(PER_CLASS) public abstract class ITStorage<T extends StorageComponent> extends Object
Base class for allStorageComponent
integration tests.
-
-
Constructor Summary
Constructors Constructor Description ITStorage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
accept(List<Span> spans)
protected void
accept(Span... spans)
protected void
blockWhileInFlight()
protected abstract void
clear()
Clears store between tests.protected abstract void
configureStorageForTest(StorageComponent.Builder storage)
Configures aStorageComponent.Builder
with parameters for the test being executed.protected boolean
initializeStoragePerTest()
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 SpanStore
store()
protected Traces
traces()
-
-
-
Field Detail
-
storage
protected T extends StorageComponent storage
-
-
Method Detail
-
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
protected abstract void configureStorageForTest(StorageComponent.Builder storage)
Configures aStorageComponent.Builder
with parameters for the test being executed.
-
traces
protected Traces traces()
-
store
protected SpanStore store()
-
names
protected ServiceAndSpanNames names()
-
accept
protected final void accept(Span... spans) throws IOException
- Throws:
IOException
-
accept
protected final void accept(List<Span> spans) throws IOException
- Throws:
IOException
-
blockWhileInFlight
protected void blockWhileInFlight()
-
-