Package cloud.localstack
Class LocalstackTestRunner
java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
cloud.localstack.LocalstackTestRunner
- All Implemented Interfaces:
org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Orderable,org.junit.runner.manipulation.Sortable
public class LocalstackTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner
JUnit test runner that automatically pulls and runs the latest localstack docker image
and then terminates when tests are complete.
Having docker installed is a prerequisite for this test runner to execute. If docker
is not installed in one of the default locations (C:\program files\docker\docker\resources\bin\docker.exe,
C:\program files\docker\docker\resources\docker.exe, usr/local/bin/docker or usr/bin/docker)
then use the DOCKER_LOCATION environment variable to specify the location.
Since ports are dynamically allocated, the external port needs to be resolved based on the default localstack port.
The hostname defaults to localhost, but in some environments that is not sufficient, so the HostName can be specified
by using the LocalstackDockerProperties annotation with an IHostNameResolver.
- Author:
- Alan Bevier, Patrick Allain, Waldemar Hummer
-
Constructor Summary
Constructors Constructor Description LocalstackTestRunner(java.lang.Class<?> klass) -
Method Summary
Modifier and Type Method Description voidrun(org.junit.runner.notification.RunNotifier notifier)Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, createTest, describeChild, getChildren, getTestRules, isIgnored, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeoutMethods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, order, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
-
Constructor Details
-
LocalstackTestRunner
public LocalstackTestRunner(java.lang.Class<?> klass) throws org.junit.runners.model.InitializationError- Throws:
org.junit.runners.model.InitializationError
-
-
Method Details
-
run
public void run(org.junit.runner.notification.RunNotifier notifier)- Overrides:
runin classorg.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
-