Package com.consol.citrus.generate.xml
Class XsdXmlTestGenerator
- java.lang.Object
-
- com.consol.citrus.generate.AbstractTestGenerator<T>
-
- com.consol.citrus.generate.AbstractTemplateBasedTestGenerator<T>
-
- com.consol.citrus.generate.xml.XmlTestGenerator<T>
-
- com.consol.citrus.generate.xml.MessagingXmlTestGenerator<XsdXmlTestGenerator>
-
- com.consol.citrus.generate.xml.XsdXmlTestGenerator
-
- All Implemented Interfaces:
TestGenerator<XsdXmlTestGenerator>,XsdTestGenerator<XsdXmlTestGenerator>
public class XsdXmlTestGenerator extends MessagingXmlTestGenerator<XsdXmlTestGenerator> implements XsdTestGenerator<XsdXmlTestGenerator>
Test generator creates one to many test cases based on operations defined in a XML schema XSD.- Since:
- 2.7.4
- Author:
- Christoph Deppisch
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.consol.citrus.generate.TestGenerator
TestGenerator.GeneratorMode
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.generate.AbstractTestGenerator
log, self
-
-
Constructor Summary
Constructors Constructor Description XsdXmlTestGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Create the test case.protected com.consol.citrus.message.MessagegenerateInboundMessage(com.consol.citrus.message.Message message)Inbound message generation hook for subclasses.protected com.consol.citrus.message.MessagegenerateOutboundMessage(com.consol.citrus.message.Message message)Outbound message generation hook for subclasses.StringgetNameSuffix()Gets the nameSuffix.StringgetRequestMessage()Gets the requestMessage.StringgetResponseMessage()Gets the responseMessage.StringgetResponseMessageSuggestion()Suggest name of response element based on request message element name.StringgetTestNameSuggestion()Suggest name of test based on request message element name.StringgetXsd()Gets the xsd.voidsetNameSuffix(String nameSuffix)Sets the nameSuffix.voidsetRequestMessage(String requestMessage)Sets the requestMessage.voidsetResponseMessage(String responseMessage)Sets the responseMessage.voidsetXsd(String xsd)Sets the xsd.XsdXmlTestGeneratorwithInboundMappingFile(String mappingFile)Add inbound XPath expression mappings file to manipulate inbound message content.XsdXmlTestGeneratorwithInboundMappings(Map<String,String> mappings)Add inbound XPath expression mappings to manipulate inbound message content.XsdXmlTestGeneratorwithNameSuffix(String suffix)Set the test name suffix to use.XsdXmlTestGeneratorwithOutboundMappingFile(String mappingFile)Add outbound XPath expression mappings file to manipulate outbound message content.XsdXmlTestGeneratorwithOutboundMappings(Map<String,String> mappings)Add outbound XPath expression mappings to manipulate outbound message content.XsdXmlTestGeneratorwithRequestMessage(String requestMessage)Set the request element name in xsd resource to use.XsdXmlTestGeneratorwithResponseMessage(String responseMessage)Set the response element name in xsd resource to use.XsdXmlTestGeneratorwithXsd(String xsdResource)Set the xsd schema resource to use.-
Methods inherited from class com.consol.citrus.generate.xml.MessagingXmlTestGenerator
addRequestHeader, addResponseHeader, getActions, getEndpoint, getReceiveRequestActionProvider, getReceiveResponseActionProvider, getSendRequestActionProvider, getSendResponseActionProvider, setEndpoint, withEndpoint, withRequest, withResponse
-
Methods inherited from class com.consol.citrus.generate.xml.XmlTestGenerator
getJavaTestGenerator, getMarshaller, getMarshallerContextPaths, getMode, getNamespacePrefixMapper, getSrcDirectory, getTemplateFilePath, getTemplateProperties, setMarshaller, setMode, setNamespacePrefixMapper, withMode
-
Methods inherited from class com.consol.citrus.generate.AbstractTestGenerator
getAuthor, getCreationDate, getDescription, getFileExtension, getFramework, getMethodName, getName, getPackage, getTargetFile, getTargetPackage, getUpdateDateTime, isDisabled, setAuthor, setDescription, setDisabled, setFileExtension, setFramework, setName, setPackage, setSrcDirectory, setTargetPackage, usePackage, useSrcDirectory, withAuthor, withDescription, withDisabled, withFileExtension, withFramework, withName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.consol.citrus.generate.TestGenerator
getAuthor, getDescription, getFramework, getMode, getName, getTargetPackage, isDisabled, usePackage, useSrcDirectory, withAuthor, withDescription, withDisabled, withFramework, withMode, withName
-
Methods inherited from interface com.consol.citrus.generate.XsdTestGenerator
withEndpoint
-
-
-
-
Method Detail
-
create
public void create()
Description copied from class:AbstractTemplateBasedTestGeneratorCreate the test case.- Specified by:
createin interfaceTestGenerator<XsdXmlTestGenerator>- Overrides:
createin classXmlTestGenerator<XsdXmlTestGenerator>
-
generateInboundMessage
protected com.consol.citrus.message.Message generateInboundMessage(com.consol.citrus.message.Message message)
Description copied from class:MessagingXmlTestGeneratorInbound message generation hook for subclasses.- Overrides:
generateInboundMessagein classMessagingXmlTestGenerator<XsdXmlTestGenerator>- Returns:
-
generateOutboundMessage
protected com.consol.citrus.message.Message generateOutboundMessage(com.consol.citrus.message.Message message)
Description copied from class:MessagingXmlTestGeneratorOutbound message generation hook for subclasses.- Overrides:
generateOutboundMessagein classMessagingXmlTestGenerator<XsdXmlTestGenerator>- Returns:
-
getResponseMessageSuggestion
public String getResponseMessageSuggestion()
Suggest name of response element based on request message element name.- Specified by:
getResponseMessageSuggestionin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Returns:
-
getTestNameSuggestion
public String getTestNameSuggestion()
Suggest name of test based on request message element name.- Returns:
-
withXsd
public XsdXmlTestGenerator withXsd(String xsdResource)
Set the xsd schema resource to use.- Specified by:
withXsdin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
xsdResource-- Returns:
-
withRequestMessage
public XsdXmlTestGenerator withRequestMessage(String requestMessage)
Set the request element name in xsd resource to use.- Specified by:
withRequestMessagein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
requestMessage-- Returns:
-
withResponseMessage
public XsdXmlTestGenerator withResponseMessage(String responseMessage)
Set the response element name in xsd resource to use.- Specified by:
withResponseMessagein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
responseMessage-- Returns:
-
withNameSuffix
public XsdXmlTestGenerator withNameSuffix(String suffix)
Set the test name suffix to use.- Specified by:
withNameSuffixin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
suffix-- Returns:
-
withInboundMappings
public XsdXmlTestGenerator withInboundMappings(Map<String,String> mappings)
Add inbound XPath expression mappings to manipulate inbound message content.- Specified by:
withInboundMappingsin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
mappings-- Returns:
-
withOutboundMappings
public XsdXmlTestGenerator withOutboundMappings(Map<String,String> mappings)
Add outbound XPath expression mappings to manipulate outbound message content.- Specified by:
withOutboundMappingsin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
mappings-- Returns:
-
withInboundMappingFile
public XsdXmlTestGenerator withInboundMappingFile(String mappingFile)
Add inbound XPath expression mappings file to manipulate inbound message content.- Specified by:
withInboundMappingFilein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
mappingFile-- Returns:
-
withOutboundMappingFile
public XsdXmlTestGenerator withOutboundMappingFile(String mappingFile)
Add outbound XPath expression mappings file to manipulate outbound message content.- Specified by:
withOutboundMappingFilein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Parameters:
mappingFile-- Returns:
-
setXsd
public void setXsd(String xsd)
Sets the xsd.- Parameters:
xsd-
-
getXsd
public String getXsd()
Gets the xsd.- Specified by:
getXsdin interfaceXsdTestGenerator<XsdXmlTestGenerator>- Returns:
-
setRequestMessage
public void setRequestMessage(String requestMessage)
Sets the requestMessage.- Parameters:
requestMessage-
-
getRequestMessage
public String getRequestMessage()
Gets the requestMessage.- Specified by:
getRequestMessagein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Returns:
-
setResponseMessage
public void setResponseMessage(String responseMessage)
Sets the responseMessage.- Parameters:
responseMessage-
-
getResponseMessage
public String getResponseMessage()
Gets the responseMessage.- Specified by:
getResponseMessagein interfaceXsdTestGenerator<XsdXmlTestGenerator>- Returns:
-
setNameSuffix
public void setNameSuffix(String nameSuffix)
Sets the nameSuffix.- Parameters:
nameSuffix-
-
getNameSuffix
public String getNameSuffix()
Gets the nameSuffix.- Returns:
-
-