|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mycila.testing.plugins.jetty.config.DefaultConfig
public class DefaultConfig
The default implementation with default values of RawConfig and provides Configuration extension.
| Constructor Summary | |
|---|---|
DefaultConfig()
Instantiates. |
|
DefaultConfig(Properties config)
Instantiates with a Properties configuration such as keys :
warLocation : String # getWarLocation(), ie : ant:*.war
serverPort : int # getServerPort(), ie : 9090
contextPath : String # getContextPath(), ie : /test
startServer : boolean (true|false) # isStartServer(), ie : true
deployWebapp : boolean (true|false) # isDeployWebapp(), ie : false
skip : boolean (true|false) # isSkip(), ie : true
lifeCycleListenerClass : String classname # getServerLifeCycleListenerClass(), ie :
com.mycila.testing.plugins.jetty.NopServerLifeCycleListener
|
|
DefaultConfig(RawConfig config)
Instantiates with a RawConfiguration; |
|
| Method Summary | |
|---|---|
static Config |
configFrom(Class<?> klass)
Returns the JettyRunWar Configuration for the klass. |
static Config |
configFrom(Method method)
Returns the JettyRunWar Configuration for the method. |
String |
getContextPath()
The web application context path. |
ServerLifeCycleListener |
getServerLifeCycleListener()
The ServerLifeCycleListener instance which allow customization of the server configuration. |
Class<? extends ServerLifeCycleListener> |
getServerLifeCycleListenerClass()
The ServerLifeCycleListener class which allow customization of the server configuration. |
int |
getServerPort()
The web application server port. |
Class<?> |
getSourceClass()
Returns the JettyRunWar source class. |
JettyRunWar |
getSourceConfig()
Returns the JettyRunWar source configuration. |
Method |
getSourceMethod()
Returns the JettyRunWar source configuration. |
String |
getWarLocation()
The location of the WAR file to load. |
URL |
getWarLocationUrl()
The location of the WAR file to load. |
static boolean |
hasJettyPlugin(Class<?> klass)
Returns true if the klass is annotation with JettyRunWar, false else. |
static boolean |
hasJettyPlugin(Method method)
Returns true if the method is annotation with JettyRunWar, false else. |
boolean |
isDeployWebapp()
True to deploy a new webapp (and undeploy the old one), false to deploy a webapp only if there is no deployed one. |
boolean |
isSkip()
True to skip starting server or deploying webapp. |
boolean |
isStartServer()
True to start a new server (and stop the old one), false to start a server only if there is no running one. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Class<? extends RawConfig> DEFAULT_CONFIG_CLASS
JettyRunWar.value() RawConfiguration class.
public static final String DEFAULT_WAR_LOCATION
getWarLocation().
public static final int DEFAULT_SERVER_PORT
getServerPort().
public static final String DEFAULT_SERVER_PORT_AS_STRING
getServerPort() as string.
public static final String DEFAULT_CONTEXT_PATH
getContextPath().
public static final boolean DEFAULT_START_SERVER
isStartServer().
public static final String DEFAULT_START_SERVER_AS_STRING
isStartServer() as string.
public static final boolean DEFAULT_DEPLOY_WEBAPP
isDeployWebapp().
public static final String DEFAULT_DEPLOY_WEBAPP_AS_STRING
isDeployWebapp() as string.
public static final boolean DEFAULT_SKIP
isSkip().
public static final String DEFAULT_SKIP_AS_STRING
isSkip() as string.
public static final Class<? extends ServerLifeCycleListener> DEFAULT_CYCLE_LISTENER_CLASS
getServerLifeCycleListenerClass().
public static final String DEFAULT_CYCLE_LISTENER_CLASS_AS_STRING
getServerLifeCycleListenerClass() as string.
| Constructor Detail |
|---|
public DefaultConfig()
public DefaultConfig(Properties config)
Properties configuration such as keys :
warLocation : String # getWarLocation(), ie : ant:*.warserverPort : int # getServerPort(), ie : 9090contextPath : String # getContextPath(), ie : /teststartServer : boolean (true|false) # isStartServer(), ie : truedeployWebapp : boolean (true|false) # isDeployWebapp(), ie : falseskip : boolean (true|false) # isSkip(), ie : truelifeCycleListenerClass : String classname # getServerLifeCycleListenerClass(), ie :
com.mycila.testing.plugins.jetty.NopServerLifeCycleListener
config - the Properties configuration.
RuntimeException - if the setServerLifeCycleListenerClass(Class) does not exist in the VM.
NumberFormatException - if the setServerPort(int) is not an int.public DefaultConfig(RawConfig config)
RawConfiguration;
config - the raw configuration;| Method Detail |
|---|
public URL getWarLocationUrl()
getWarLocationUrl in interface ConfigConfig.getWarLocationUrl()public String getWarLocation()
Default is . If there is more than one WAR file the test will fail, else the WAR file will be loaded and the test run.
WAR locator strategy :
'path/to/webapp.war';
'reg:\\.\\/webapp-.\*\.war';
'./', which translated in java
pattern is '\\.\\/'
'**/webapp-*.war';
'sys:warPath'.
getWarLocation in interface RawConfigRawConfig.getWarLocation()public int getServerPort()
getServerPort in interface RawConfigRawConfig.getServerPort()public String getContextPath()
getContextPath in interface RawConfigRawConfig.getContextPath()public boolean isStartServer()
true then RawConfig.isDeployWebapp() is logically force to true. Default
.
isStartServer in interface RawConfigRawConfig.isStartServer()public boolean isDeployWebapp()
isDeployWebapp in interface RawConfigRawConfig.isDeployWebapp()public boolean isSkip()
isSkip in interface RawConfigRawConfig.isSkip()public ServerLifeCycleListener getServerLifeCycleListener()
ConfigServerLifeCycleListener instance which allow customization of the server configuration.
getServerLifeCycleListener in interface Configpublic Class<? extends ServerLifeCycleListener> getServerLifeCycleListenerClass()
ServerLifeCycleListener class which allow customization of the server configuration. Default is
.
getServerLifeCycleListenerClass in interface RawConfigRawConfig.getServerLifeCycleListenerClass()public JettyRunWar getSourceConfig()
JettyRunWar source configuration.
getSourceConfig in interface ConfigJettyRunWar source configuration.Config.getSourceConfig()public Method getSourceMethod()
JettyRunWar source configuration.
getSourceMethod in interface ConfigJettyRunWar source configuration.Config.getSourceMethod()public Class<?> getSourceClass()
JettyRunWar source class.
getSourceClass in interface ConfigJettyRunWar source class.Config.getSourceClass()public String toString()
toString in class ObjectObject.toString()public static boolean hasJettyPlugin(Method method)
method is annotation with JettyRunWar, false else.
method - the method to test if annotated with JettyRunWar.
method is annotation with JettyRunWar, false else.public static boolean hasJettyPlugin(Class<?> klass)
klass is annotation with JettyRunWar, false else.
klass - the class to test if annotated with JettyRunWar.
klass is annotation with JettyRunWar, false else.public static Config configFrom(Method method)
JettyRunWar Configuration for the method.
method - the method for which returns the JettyRunWar Configuration.
JettyRunWar Configuration.public static Config configFrom(Class<?> klass)
JettyRunWar Configuration for the klass.
klass - the class for which returns the JettyRunWar Configuration.
JettyRunWar Configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||