com.eviware.soapui.impl.wsdl.mock
Class WsdlMockResponse

java.lang.Object
  extended by com.eviware.soapui.model.support.AbstractModelItem
      extended by com.eviware.soapui.impl.wsdl.AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>
          extended by com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse
All Implemented Interfaces:
AttachmentContainer, MutableAttachmentContainer, MutableWsdlAttachmentContainer, WsaContainer, WsdlAttachmentContainer, MockResponse, ModelItem, PropertyExpansionContainer, TestModelItem, TestPropertyHolder, PropertyChangeNotifier

public class WsdlMockResponse
extends AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>
implements MockResponse, MutableWsdlAttachmentContainer, PropertyExpansionContainer, TestPropertyHolder, WsaContainer

A WsdlMockResponse contained by a WsdlMockOperation

Author:
ole.matzura

Nested Class Summary
 class WsdlMockResponse.ResponseHeaderHolder
           
 
Field Summary
protected  java.util.List<FileAttachment<WsdlMockResponse>> attachments
           
static java.lang.String AUTO_RESPONSE_COMPRESSION
           
static java.lang.String DISABLE_MULTIPART_ATTACHMENTS
           
static java.lang.String ENABLE_INLINE_FILES
           
static java.lang.String ENCODE_ATTACHMENTS
           
static java.lang.String FORCE_MTOM
           
static java.lang.String HEADERS_PROPERTY
           
static java.lang.String MOCKRESULT_PROPERTY
           
static java.lang.String NO_RESPONSE_COMPRESSION
           
static java.lang.String OUGOING_WSS
           
static java.lang.String REMOVE_EMPTY_CONTENT
           
static java.lang.String RESPONSE_DELAY_PROPERTY
           
static java.lang.String RESPONSE_HTTP_STATUS
           
static java.lang.String SCRIPT_PROPERTY
           
static java.lang.String STRIP_WHITESPACES
           
 
Fields inherited from interface com.eviware.soapui.model.mock.MockResponse
ENCODING_PROPERTY, MTOM_NABLED_PROPERTY, RESPONSE_CONTENT_PROPERTY
 
Fields inherited from interface com.eviware.soapui.model.ModelItem
DESCRIPTION_PROPERTY, ICON_PROPERTY, LABEL_PROPERTY, NAME_PROPERTY
 
Fields inherited from interface com.eviware.soapui.impl.wsdl.AttachmentContainer
ATTACHMENTS_PROPERTY
 
Constructor Summary
WsdlMockResponse(WsdlMockOperation operation, com.eviware.soapui.config.MockResponseConfig config)
           
 
Method Summary
 Attachment addAttachment(Attachment attachment)
           
 void addAttachmentsChangeListener(java.beans.PropertyChangeListener listener)
           
 void addTestPropertyListener(TestPropertyListener listener)
           
 void addWsaPropertyExpansions(java.util.List<PropertyExpansion> result, WsaConfig wsaConfig, ModelItem modelItem)
           
 Attachment attachFile(java.io.File file, boolean cache)
           
 void beforeSave()
           
 void evaluateScript(WsdlMockRequest request)
           
 WsdlMockResult execute(WsdlMockRequest request, WsdlMockResult result)
           
 WsdlAttachment getAttachmentAt(int index)
           
 int getAttachmentCount()
           
 Attachment.AttachmentEncoding getAttachmentEncoding(java.lang.String partName)
           
 HttpAttachmentPart getAttachmentPart(java.lang.String partName)
           
 Attachment[] getAttachments()
           
 Attachment[] getAttachmentsForPart(java.lang.String partName)
           
 long getContentLength()
           
 HttpAttachmentPart[] getDefinedAttachmentParts()
           
 java.lang.String getEncoding()
           
 javax.swing.ImageIcon getIcon()
           
 WsdlMockOperation getMockOperation()
           
 WsdlMockResult getMockResult()
           
 ModelItem getModelItem()
          Returns ModelItem associated with this container
 WsdlOperation getOperation()
           
 java.lang.String getOutgoingWss()
           
 java.util.Map<java.lang.String,TestProperty> getProperties()
           
 java.lang.String getPropertiesLabel()
           
 TestProperty getProperty(java.lang.String name)
           
 TestProperty getPropertyAt(int index)
           
 int getPropertyCount()
           
 PropertyExpansion[] getPropertyExpansions()
           
 java.util.List<TestProperty> getPropertyList()
           
 java.lang.String[] getPropertyNames()
           
 java.lang.String getPropertyValue(java.lang.String name)
           
 MessagePart[] getRequestParts()
           
 java.lang.String getResponseCompression()
           
 java.lang.String getResponseContent()
           
 long getResponseDelay()
           
 StringToStringMap getResponseHeaders()
           
 java.lang.String getResponseHttpStatus()
           
 MessagePart[] getResponseParts()
           
 java.lang.String getScript()
           
 SoapVersion getSoapVersion()
           
 WsaConfig getWsaConfig()
           
 boolean hasProperty(java.lang.String name)
           
 boolean isEncodeAttachments()
           
 boolean isEntitizeProperties()
           
 boolean isForceMtom()
           
 boolean isInlineFilesEnabled()
           
 boolean isMtomEnabled()
           
 boolean isMultipartEnabled()
           
 boolean isReadOnly()
           
 boolean isRemoveEmptyContent()
           
 boolean isStripWhitespaces()
           
 boolean isWsAddressing()
           
 boolean isWsaEnabled()
           
 void release()
           
 void removeAttachment(Attachment attachment)
           
 void removeAttachmentsChangeListener(java.beans.PropertyChangeListener listener)
           
 void removeTestPropertyListener(TestPropertyListener listener)
           
 void setConfig(com.eviware.soapui.config.MockResponseConfig config)
           
 void setEncodeAttachments(boolean encodeAttachments)
           
 void setEncoding(java.lang.String encoding)
           
 void setEntitizeProperties(boolean entitizeProperties)
           
 void setForceMtom(boolean forceMtom)
           
 void setInlineFilesEnabled(boolean inlineFilesEnabled)
           
 void setMockResult(WsdlMockResult mockResult)
           
 void setMtomEnabled(boolean mtomEnabled)
           
 void setMultipartEnabled(boolean multipartEnabled)
           
 void setOperation(WsdlOperation operation)
           
 void setOutgoingWss(java.lang.String outgoingWss)
           
 void setPropertyValue(java.lang.String name, java.lang.String value)
           
 void setRemoveEmptyContent(boolean removeEmptyContent)
           
 void setResponseCompression(java.lang.String compression)
           
 void setResponseContent(java.lang.String responseContent)
           
 void setResponseDelay(long delay)
           
 void setResponseHeaders(StringToStringMap headers)
           
 void setResponseHttpStatus(java.lang.String httpStatus)
           
 void setScript(java.lang.String script)
           
 void setStripWhitespaces(boolean stripWhitespaces)
           
 void setWsAddressing(boolean wsAddressing)
           
 void setWsaEnabled(boolean arg0)
           
 
Methods inherited from class com.eviware.soapui.impl.wsdl.AbstractWsdlModelItem
afterLoad, dependsOn, getConfig, getDescription, getId, getName, getParent, getSettings, getWsdlModelItemByName, resolve, setDescription, setIcon, setName, setSettings
 
Methods inherited from class com.eviware.soapui.model.support.AbstractModelItem
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, getChildren, notifyPropertyChanged, notifyPropertyChanged, notifyPropertyChanged, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.eviware.soapui.model.ModelItem
getChildren, getDescription, getId, getName, getParent, getSettings
 
Methods inherited from interface com.eviware.soapui.support.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

AUTO_RESPONSE_COMPRESSION

public static final java.lang.String AUTO_RESPONSE_COMPRESSION
See Also:
Constant Field Values

NO_RESPONSE_COMPRESSION

public static final java.lang.String NO_RESPONSE_COMPRESSION
See Also:
Constant Field Values

MOCKRESULT_PROPERTY

public static final java.lang.String MOCKRESULT_PROPERTY

SCRIPT_PROPERTY

public static final java.lang.String SCRIPT_PROPERTY

HEADERS_PROPERTY

public static final java.lang.String HEADERS_PROPERTY

DISABLE_MULTIPART_ATTACHMENTS

public static final java.lang.String DISABLE_MULTIPART_ATTACHMENTS

FORCE_MTOM

public static final java.lang.String FORCE_MTOM

ENABLE_INLINE_FILES

public static final java.lang.String ENABLE_INLINE_FILES

RESPONSE_DELAY_PROPERTY

public static final java.lang.String RESPONSE_DELAY_PROPERTY

STRIP_WHITESPACES

public static final java.lang.String STRIP_WHITESPACES

REMOVE_EMPTY_CONTENT

public static final java.lang.String REMOVE_EMPTY_CONTENT

ENCODE_ATTACHMENTS

public static final java.lang.String ENCODE_ATTACHMENTS

RESPONSE_HTTP_STATUS

public static final java.lang.String RESPONSE_HTTP_STATUS

OUGOING_WSS

public static final java.lang.String OUGOING_WSS

attachments

protected java.util.List<FileAttachment<WsdlMockResponse>> attachments
Constructor Detail

WsdlMockResponse

public WsdlMockResponse(WsdlMockOperation operation,
                        com.eviware.soapui.config.MockResponseConfig config)
Method Detail

setConfig

public void setConfig(com.eviware.soapui.config.MockResponseConfig config)
Overrides:
setConfig in class AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>

getAttachments

public Attachment[] getAttachments()
Specified by:
getAttachments in interface AttachmentContainer
Specified by:
getAttachments in interface MockResponse

getScript

public java.lang.String getScript()

getEncoding

public java.lang.String getEncoding()
Specified by:
getEncoding in interface MockResponse

setEncoding

public void setEncoding(java.lang.String encoding)

getResponseContent

public java.lang.String getResponseContent()
Specified by:
getResponseContent in interface MockResponse

setResponseContent

public void setResponseContent(java.lang.String responseContent)
Specified by:
setResponseContent in interface MockResponse

setResponseCompression

public void setResponseCompression(java.lang.String compression)

getResponseCompression

public java.lang.String getResponseCompression()

getIcon

public javax.swing.ImageIcon getIcon()
Specified by:
getIcon in interface ModelItem
Overrides:
getIcon in class AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>

getMockOperation

public WsdlMockOperation getMockOperation()
Specified by:
getMockOperation in interface MockResponse

execute

public WsdlMockResult execute(WsdlMockRequest request,
                              WsdlMockResult result)
                       throws DispatchException
Throws:
DispatchException

evaluateScript

public void evaluateScript(WsdlMockRequest request)
                    throws java.lang.Exception
Throws:
java.lang.Exception

release

public void release()
Overrides:
release in class AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>

setScript

public void setScript(java.lang.String script)

setResponseHeaders

public void setResponseHeaders(StringToStringMap headers)

getResponseHeaders

public StringToStringMap getResponseHeaders()
Specified by:
getResponseHeaders in interface MockResponse

getRequestParts

public MessagePart[] getRequestParts()

getResponseParts

public MessagePart[] getResponseParts()

attachFile

public Attachment attachFile(java.io.File file,
                             boolean cache)
                      throws java.io.IOException
Specified by:
attachFile in interface MutableAttachmentContainer
Throws:
java.io.IOException

getAttachmentCount

public int getAttachmentCount()
Specified by:
getAttachmentCount in interface AttachmentContainer

getAttachmentAt

public WsdlAttachment getAttachmentAt(int index)
Specified by:
getAttachmentAt in interface AttachmentContainer

removeAttachment

public void removeAttachment(Attachment attachment)
Specified by:
removeAttachment in interface MutableAttachmentContainer

getDefinedAttachmentParts

public HttpAttachmentPart[] getDefinedAttachmentParts()
Specified by:
getDefinedAttachmentParts in interface AttachmentContainer

getAttachmentPart

public HttpAttachmentPart getAttachmentPart(java.lang.String partName)
Specified by:
getAttachmentPart in interface AttachmentContainer

getAttachmentsForPart

public Attachment[] getAttachmentsForPart(java.lang.String partName)
Specified by:
getAttachmentsForPart in interface AttachmentContainer

isMtomEnabled

public boolean isMtomEnabled()
Specified by:
isMtomEnabled in interface WsdlAttachmentContainer
Specified by:
isMtomEnabled in interface MockResponse

setMtomEnabled

public void setMtomEnabled(boolean mtomEnabled)

addAttachment

public Attachment addAttachment(Attachment attachment)

setResponseDelay

public void setResponseDelay(long delay)

getResponseDelay

public long getResponseDelay()

setResponseHttpStatus

public void setResponseHttpStatus(java.lang.String httpStatus)

getResponseHttpStatus

public java.lang.String getResponseHttpStatus()

setMockResult

public void setMockResult(WsdlMockResult mockResult)

getMockResult

public WsdlMockResult getMockResult()
Specified by:
getMockResult in interface MockResponse

getContentLength

public long getContentLength()

isMultipartEnabled

public boolean isMultipartEnabled()
Specified by:
isMultipartEnabled in interface AttachmentContainer

setMultipartEnabled

public void setMultipartEnabled(boolean multipartEnabled)

isEntitizeProperties

public boolean isEntitizeProperties()

setEntitizeProperties

public void setEntitizeProperties(boolean entitizeProperties)

isForceMtom

public boolean isForceMtom()

setForceMtom

public void setForceMtom(boolean forceMtom)

isRemoveEmptyContent

public boolean isRemoveEmptyContent()

setRemoveEmptyContent

public void setRemoveEmptyContent(boolean removeEmptyContent)

isEncodeAttachments

public boolean isEncodeAttachments()
Specified by:
isEncodeAttachments in interface WsdlAttachmentContainer

setEncodeAttachments

public void setEncodeAttachments(boolean encodeAttachments)

isStripWhitespaces

public boolean isStripWhitespaces()

setStripWhitespaces

public void setStripWhitespaces(boolean stripWhitespaces)

isInlineFilesEnabled

public boolean isInlineFilesEnabled()
Specified by:
isInlineFilesEnabled in interface WsdlAttachmentContainer

setInlineFilesEnabled

public void setInlineFilesEnabled(boolean inlineFilesEnabled)

beforeSave

public void beforeSave()
Overrides:
beforeSave in class AbstractWsdlModelItem<com.eviware.soapui.config.MockResponseConfig>

addAttachmentsChangeListener

public void addAttachmentsChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addAttachmentsChangeListener in interface AttachmentContainer

isReadOnly

public boolean isReadOnly()

removeAttachmentsChangeListener

public void removeAttachmentsChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removeAttachmentsChangeListener in interface AttachmentContainer

getSoapVersion

public SoapVersion getSoapVersion()

getPropertyExpansions

public PropertyExpansion[] getPropertyExpansions()
Specified by:
getPropertyExpansions in interface PropertyExpansionContainer

addWsaPropertyExpansions

public void addWsaPropertyExpansions(java.util.List<PropertyExpansion> result,
                                     WsaConfig wsaConfig,
                                     ModelItem modelItem)

addTestPropertyListener

public void addTestPropertyListener(TestPropertyListener listener)
Specified by:
addTestPropertyListener in interface TestPropertyHolder

getModelItem

public ModelItem getModelItem()
Description copied from interface: AttachmentContainer
Returns ModelItem associated with this container

Specified by:
getModelItem in interface AttachmentContainer
Specified by:
getModelItem in interface TestPropertyHolder

getProperties

public java.util.Map<java.lang.String,TestProperty> getProperties()
Specified by:
getProperties in interface TestPropertyHolder

getProperty

public TestProperty getProperty(java.lang.String name)
Specified by:
getProperty in interface TestPropertyHolder

getPropertyNames

public java.lang.String[] getPropertyNames()
Specified by:
getPropertyNames in interface TestPropertyHolder

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Specified by:
getPropertyValue in interface TestPropertyHolder

hasProperty

public boolean hasProperty(java.lang.String name)
Specified by:
hasProperty in interface TestPropertyHolder

removeTestPropertyListener

public void removeTestPropertyListener(TestPropertyListener listener)
Specified by:
removeTestPropertyListener in interface TestPropertyHolder

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.String value)
Specified by:
setPropertyValue in interface TestPropertyHolder

getOutgoingWss

public java.lang.String getOutgoingWss()

setOutgoingWss

public void setOutgoingWss(java.lang.String outgoingWss)

getPropertyAt

public TestProperty getPropertyAt(int index)
Specified by:
getPropertyAt in interface TestPropertyHolder

getPropertyCount

public int getPropertyCount()
Specified by:
getPropertyCount in interface TestPropertyHolder

getPropertyList

public java.util.List<TestProperty> getPropertyList()
Specified by:
getPropertyList in interface TestPropertyHolder

getPropertiesLabel

public java.lang.String getPropertiesLabel()
Specified by:
getPropertiesLabel in interface TestPropertyHolder

getAttachmentEncoding

public Attachment.AttachmentEncoding getAttachmentEncoding(java.lang.String partName)
Specified by:
getAttachmentEncoding in interface WsdlAttachmentContainer

getWsaConfig

public WsaConfig getWsaConfig()
Specified by:
getWsaConfig in interface WsaContainer

isWsAddressing

public boolean isWsAddressing()

setWsAddressing

public void setWsAddressing(boolean wsAddressing)

isWsaEnabled

public boolean isWsaEnabled()
Specified by:
isWsaEnabled in interface WsaContainer

setWsaEnabled

public void setWsaEnabled(boolean arg0)
Specified by:
setWsaEnabled in interface WsaContainer

getOperation

public WsdlOperation getOperation()
Specified by:
getOperation in interface WsaContainer

setOperation

public void setOperation(WsdlOperation operation)
Specified by:
setOperation in interface WsaContainer


Copyright © 2005-2009 eviware.com. All Rights Reserved.