Class TestSystemFactory
- java.lang.Object
-
- liquibase.plugin.AbstractPluginFactory<TestSystem>
-
- liquibase.extension.testing.testsystem.TestSystemFactory
-
- All Implemented Interfaces:
PluginFactory
,SingletonObject
public class TestSystemFactory extends AbstractPluginFactory<TestSystem>
Factory for gettingTestSystem
implementations.
-
-
Constructor Summary
Constructors Constructor Description TestSystemFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<TestSystem>
findAllInstances()
Finds implementations of the given interface or class and returns instances of them.<T extends TestSystem>
List<T>getAvailable(Class<T> testSystemType)
protected Class<TestSystem>
getPluginClass()
protected int
getPriority(TestSystem testSystem, Object... args)
Returns the priority of the given object based on the passed args array.TestSystem
getTestSystem(String definition)
Convenience method forgetTestSystem(TestSystem.Definition)
without having to parse the definition yourself.TestSystem
getTestSystem(TestSystem.Definition definition)
Return theTestSystem
for the givenTestSystem.Definition
.Set<String>
getTestSystemNames()
-
Methods inherited from class liquibase.plugin.AbstractPluginFactory
getPlugin, getPlugins, register, removeInstance
-
-
-
-
Method Detail
-
getPluginClass
protected Class<TestSystem> getPluginClass()
- Specified by:
getPluginClass
in classAbstractPluginFactory<TestSystem>
-
getPriority
protected int getPriority(TestSystem testSystem, Object... args)
Description copied from class:AbstractPluginFactory
Returns the priority of the given object based on the passed args array. The args are created as part of the custom public getPlugin method in implementations are passed throughAbstractPluginFactory.getPlugin(Object...)
- Specified by:
getPriority
in classAbstractPluginFactory<TestSystem>
-
getTestSystem
public TestSystem getTestSystem(TestSystem.Definition definition)
Return theTestSystem
for the givenTestSystem.Definition
. Returns singleton instances for equal definitions.
-
getTestSystem
public TestSystem getTestSystem(String definition)
Convenience method forgetTestSystem(TestSystem.Definition)
without having to parse the definition yourself.
-
findAllInstances
protected Collection<TestSystem> findAllInstances()
Description copied from class:AbstractPluginFactory
Finds implementations of the given interface or class and returns instances of them. Standard implementation usesServiceLoader
to find implementations and caches results inAbstractPluginFactory.allInstances
which means the same objects are always returned. If the instances should not be treated as singletons, clone the objects before returning them fromAbstractPluginFactory.getPlugin(Object...)
.- Overrides:
findAllInstances
in classAbstractPluginFactory<TestSystem>
-
getAvailable
public <T extends TestSystem> List<T> getAvailable(Class<T> testSystemType)
-
-