public abstract class AbstractMockService<MockOperationType extends MockOperation,MockServiceConfigType extends BaseMockServiceConfig> extends AbstractTestPropertyHolderWsdlModelItem<MockServiceConfigType> implements MockService, HasHelpUrl
Modifier and Type | Field and Description |
---|---|
protected List<MockOperation> |
mockOperations |
static String |
START_SCRIPT_PROPERTY |
static String |
STOP_SCRIPT_PROPERTY |
PATH_PROPERTY, PORT_PROPERTY
DESCRIPTION_PROPERTY, ICON_PROPERTY, LABEL_PROPERTY, NAME_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractMockService(MockServiceConfigType config,
ModelItem parent,
String icon) |
addPropertiesFromFile, addProperty, addTestPropertyListener, getModelItem, getProperties, getPropertiesLabel, getProperty, getPropertyAt, getPropertyCount, getPropertyHolderSupport, getPropertyList, getPropertyNames, getPropertyValue, hasProperty, moveProperty, removeProperty, removeTestPropertyListener, renameProperty, setPropertiesConfig, setPropertyValue
afterLoad, beforeSave, dependsOn, getConfig, getDescription, getExternalDependencies, getIcon, getId, getName, getParent, getSettings, getWsdlModelItemById, getWsdlModelItemByName, setConfig, setDescription, setIcon, setName, setSettings
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, getChildren, notifyPropertyChanged, notifyPropertyChanged, notifyPropertyChanged, notifyPropertyChanged, removePropertyChangeListener, removePropertyChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNewMockOperation, getStringID
getChildren, getDescription, getIcon, getId, getName, getParent, getSettings
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
addTestPropertyListener, getModelItem, getProperties, getPropertiesLabel, getProperty, getPropertyAt, getPropertyCount, getPropertyList, getPropertyNames, getPropertyValue, hasProperty, removeTestPropertyListener, setPropertyValue
getName, setIcon
getHelpUrl
createDispatcher
public static final String START_SCRIPT_PROPERTY
public static final String STOP_SCRIPT_PROPERTY
protected List<MockOperation> mockOperations
protected AbstractMockService(MockServiceConfigType config, ModelItem parent, String icon)
public WsdlProject getProject()
ModelItem
Workspace
object, an UnsupportedOperationException
is thrown.getProject
in interface MockService
getProject
in interface ModelItem
getProject
in class AbstractModelItem
public MockOperationType getMockOperationAt(int index)
getMockOperationAt
in interface MockService
public MockOperation getMockOperationByName(String name)
getMockOperationByName
in interface MockService
public void addMockOperation(MockOperationType mockOperation)
protected String getProtocol()
protected abstract boolean canIAddAMockOperation(MockOperationType mockOperation)
public int getMockOperationCount()
getMockOperationCount
in interface MockService
public int getPort()
getPort
in interface MockServer
public String getPath()
getPath
in interface MockServer
public void removeMockOperation(MockOperation mockOperation)
removeMockOperation
in interface MockService
public String getLocalEndpoint()
getLocalEndpoint
in interface MockServer
public String getHost()
getHost
in interface MockServer
public void setHost(String host)
public void setPort(int port)
setPort
in interface MockServer
public void setPath(String path)
setPath
in interface MockServer
public WsdlMockRunner start() throws Exception
start
in interface MockServer
Exception
public void startIfConfigured() throws Exception
MockServer
startIfConfigured
in interface MockServer
Exception
- if the start fails for some reason. One case may be that the port is occupied already.public boolean getBindToHostOnly()
getBindToHostOnly
in interface MockServer
public void setBindToHostOnly(boolean bindToHostOnly)
public WsdlMockRunner start(WsdlTestRunContext context) throws Exception
Exception
public void addMockRunListener(MockRunListener listener)
addMockRunListener
in interface MockServer
public void removeMockRunListener(MockRunListener listener)
removeMockRunListener
in interface MockServer
public void addMockServiceListener(MockServiceListener listener)
addMockServiceListener
in interface MockService
public void removeMockServiceListener(MockServiceListener listener)
removeMockServiceListener
in interface MockService
public WsdlMockRunner getMockRunner()
getMockRunner
in interface MockServer
public void setMockRunner(WsdlMockRunner mockRunner)
public MockRunListener[] getMockRunListeners()
getMockRunListeners
in interface MockServer
public MockServiceListener[] getMockServiceListeners()
public List<MockOperation> getMockOperationList()
getMockOperationList
in interface MockService
protected List<MockOperation> getMockOperations()
public void fireMockOperationAdded(MockOperation mockOperation)
fireMockOperationAdded
in interface MockService
public void fireMockOperationRemoved(MockOperation mockOperation)
fireMockOperationRemoved
in interface MockService
public void fireMockResponseAdded(MockResponse mockResponse)
fireMockResponseAdded
in interface MockService
public void fireMockResponseRemoved(MockResponse mockResponse)
fireMockResponseRemoved
in interface MockService
public void release()
release
in interface Releasable
release
in class AbstractWsdlModelItem<MockServiceConfigType extends BaseMockServiceConfig>
public void setStartScript(String script)
setStartScript
in interface MockServiceScripts
public String getStartScript()
getStartScript
in interface MockServiceScripts
public void setStopScript(String script)
setStopScript
in interface MockServiceScripts
public String getStopScript()
getStopScript
in interface MockServiceScripts
public Object runStartScript(WsdlMockRunContext runContext, MockRunner runner) throws Exception
runStartScript
in interface MockServiceScripts
Exception
public Object runStopScript(WsdlMockRunContext runContext, MockRunner runner) throws Exception
runStopScript
in interface MockServiceScripts
Exception
public void setOnRequestScript(String script)
setOnRequestScript
in interface MockServiceScripts
public String getOnRequestScript()
getOnRequestScript
in interface MockServiceScripts
public void setAfterRequestScript(String script)
setAfterRequestScript
in interface MockServiceScripts
public String getAfterRequestScript()
getAfterRequestScript
in interface MockServiceScripts
public Object runOnRequestScript(WsdlMockRunContext runContext, MockRequest mockRequest) throws Exception
runOnRequestScript
in interface MockServiceScripts
Exception
public Object runAfterRequestScript(WsdlMockRunContext runContext, MockResult mockResult) throws Exception
runAfterRequestScript
in interface MockServiceScripts
Exception
public void setDocroot(String docroot)
public String getDocroot()
public void addExternalDependencies(List<ExternalDependency> dependencies)
addExternalDependencies
in class AbstractWsdlModelItem<MockServiceConfigType extends BaseMockServiceConfig>
public void resolve(ResolveContext<?> context)
resolve
in class AbstractWsdlModelItem<MockServiceConfigType extends BaseMockServiceConfig>
public boolean isDispatchResponseMessages()
public void setDispatchResponseMessages(boolean dispatchResponseMessages)
public abstract String getIconName()
public void fireOnMockResult(Object result)
Copyright © 2019. All Rights Reserved.