org.mockserver.maven
Class MockServerAbstractMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.mockserver.maven.MockServerAbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
MockServerRunAndWaitMojo, MockServerRunForkedMojo, MockServerStartMojo, MockServerStopForkedMojo, MockServerStopMojo

public abstract class MockServerAbstractMojo
extends org.apache.maven.plugin.AbstractMojo

Author:
jamesdbloom

Field Summary
protected  List<String> compileClasspath
          The main classpath location of the project using this plugin
protected  String initializationClass
          To enable the creation of default expectations that are generic across all tests or mocking scenarios a class can be specified to initialize expectations in the MockServer, this class must implement org.mockserver.initialize.ExpectationInitializer interface, the initializeExpectations(MockServerClient mockServerClient) method will be called once the MockServer has been started (but ONLY if serverPort has been set), however it should be noted that it is generally better practice to create all expectations locally in each test (or test class) for clarity, simplicity and to avoid brittle tests
protected  String logLevel
          Logging level
protected  boolean pipeLogToConsole
          If true the console of the forked JVM will be piped to the Maven console
protected  int proxyPort
          The port to run the proxy on
protected  int proxySecurePort
          The secure port to run the proxy on
protected  int serverPort
          The port to run MockServer on
protected  int serverSecurePort
          The secure port to run MockServer on
protected  boolean skip
          Skip the plugin execution completely
protected  List<String> testClasspath
          The test classpath location of the project using this plugin
protected  int timeout
          Timeout to wait before stopping MockServer, to run MockServer indefinitely do not set a value
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
MockServerAbstractMojo()
           
 
Method Summary
protected  org.mockserver.initialize.ExpectationInitializer createInitializer()
           
protected  InstanceHolder getEmbeddedJettyHolder()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

serverPort

@Parameter(property="mockserver.serverPort",
           defaultValue="-1")
protected int serverPort
The port to run MockServer on


serverSecurePort

@Parameter(property="mockserver.serverSecurePort",
           defaultValue="-1")
protected int serverSecurePort
The secure port to run MockServer on


proxyPort

@Parameter(property="mockserver.proxyPort",
           defaultValue="-1")
protected int proxyPort
The port to run the proxy on


proxySecurePort

@Parameter(property="mockserver.proxySecurePort",
           defaultValue="-1")
protected int proxySecurePort
The secure port to run the proxy on


timeout

@Parameter(property="mockserver.timeout")
protected int timeout
Timeout to wait before stopping MockServer, to run MockServer indefinitely do not set a value


logLevel

@Parameter(property="mockserver.logLevel",
           defaultValue="INFO")
protected String logLevel
Logging level


skip

@Parameter(property="mockserver.skip",
           defaultValue="false")
protected boolean skip
Skip the plugin execution completely


pipeLogToConsole

@Parameter(property="mockserver.pipeLogToConsole",
           defaultValue="false")
protected boolean pipeLogToConsole
If true the console of the forked JVM will be piped to the Maven console


initializationClass

@Parameter(property="mockserver.initializationClass")
protected String initializationClass
To enable the creation of default expectations that are generic across all tests or mocking scenarios a class can be specified to initialize expectations in the MockServer, this class must implement org.mockserver.initialize.ExpectationInitializer interface, the initializeExpectations(MockServerClient mockServerClient) method will be called once the MockServer has been started (but ONLY if serverPort has been set), however it should be noted that it is generally better practice to create all expectations locally in each test (or test class) for clarity, simplicity and to avoid brittle tests


compileClasspath

@Parameter(property="project.compileClasspathElements",
           required=true,
           readonly=true)
protected List<String> compileClasspath
The main classpath location of the project using this plugin


testClasspath

@Parameter(property="project.testClasspathElements",
           required=true,
           readonly=true)
protected List<String> testClasspath
The test classpath location of the project using this plugin

Constructor Detail

MockServerAbstractMojo

public MockServerAbstractMojo()
Method Detail

getEmbeddedJettyHolder

protected InstanceHolder getEmbeddedJettyHolder()

createInitializer

protected org.mockserver.initialize.ExpectationInitializer createInitializer()


Copyright © 2014. All rights reserved.