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 Classes Modifier and Type Class Description static classTestCommand.NoManagedContainerLifeCycleCustom container lifecycle with additional objects ignorance.
-
Constructor Summary
Constructors Constructor Description TestCommand(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, java.util.List<ConfigModifier<C>> modifiers)Create command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<C>getConfigurationClass()protected 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.
-
-
-
Constructor Detail
-
TestCommand
public TestCommand(io.dropwizard.core.Application<C> application)
Create command.- Parameters:
application- application instance
-
TestCommand
public TestCommand(io.dropwizard.core.Application<C> application, boolean simulateManaged)
Create command.- Parameters:
application- application instancesimulateManaged- true to simulate managed lifecycle
-
TestCommand
public TestCommand(io.dropwizard.core.Application<C> application, boolean simulateManaged, java.util.List<ConfigModifier<C>> modifiers)
Create command.- Parameters:
application- application instancesimulateManaged- true to simulate managed lifecyclemodifiers- configuration modifiers
-
-
Method Detail
-
run
protected void run(io.dropwizard.core.setup.Bootstrap<C> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, C configuration) throws java.lang.Exception
- Overrides:
runin classio.dropwizard.core.cli.EnvironmentCommand<C extends io.dropwizard.core.Configuration>- Throws:
java.lang.Exception
-
run
protected void run(io.dropwizard.core.setup.Environment environment, net.sourceforge.argparse4j.inf.Namespace namespace, C configuration) throws java.lang.Exception- Specified by:
runin classio.dropwizard.core.cli.EnvironmentCommand<C extends io.dropwizard.core.Configuration>- Throws:
java.lang.Exception
-
stop
public void stop()
Stop lifecycle.
-
-