Package ru.vyarus.dropwizard.guice.test
Class TestCommand<C extends io.dropwizard.core.Configuration>
java.lang.Object
io.dropwizard.core.cli.Command
io.dropwizard.core.cli.ConfiguredCommand<T>
io.dropwizard.core.cli.EnvironmentCommand<C>
ru.vyarus.dropwizard.guice.test.TestCommand<C>
- Type Parameters:
C- configuration type
public class TestCommand<C extends io.dropwizard.core.Configuration>
extends io.dropwizard.core.cli.EnvironmentCommand<C>
Lightweight variation of server command for testing purposes.
Handles managed objects lifecycle.
- Since:
- 23.10.2014
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom container lifecycle with additional objects ignorance. -
Constructor Summary
ConstructorsConstructorDescriptionTestCommand(io.dropwizard.core.Application<C> application) Create command.TestCommand(io.dropwizard.core.Application<C> application, boolean simulateManaged) Create command.TestCommand(io.dropwizard.core.Application<C> application, boolean simulateManaged, List<ConfigModifier<C>> modifiers) Create command. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidrun(io.dropwizard.core.setup.Bootstrap<C> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, C configuration) protected voidrun(io.dropwizard.core.setup.Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, C configuration) voidstop()Stop lifecycle.Methods inherited from class io.dropwizard.core.cli.EnvironmentCommand
getEnvironmentMethods inherited from class io.dropwizard.core.cli.ConfiguredCommand
addFileArgument, cleanup, cleanupAsynchronously, configure, getConfiguration, runMethods inherited from class io.dropwizard.core.cli.Command
getDescription, getName, onError
-
Constructor Details
-
TestCommand
Create command.- Parameters:
application- application instance
-
TestCommand
Create command.- Parameters:
application- application instancesimulateManaged- true to simulate managed lifecycle
-
TestCommand
public TestCommand(io.dropwizard.core.Application<C> application, boolean simulateManaged, List<ConfigModifier<C>> modifiers) Create command.- Parameters:
application- application instancesimulateManaged- true to simulate managed lifecyclemodifiers- configuration modifiers
-
-
Method Details
-
run
-
run
-
stop
public void stop()Stop lifecycle. -
getConfigurationClass
- Overrides:
getConfigurationClassin classio.dropwizard.core.cli.ConfiguredCommand<C extends io.dropwizard.core.Configuration>
-