Class XsdJavaTestGenerator
- java.lang.Object
-
- com.consol.citrus.generate.AbstractTestGenerator<T>
-
- com.consol.citrus.generate.javadsl.JavaTestGenerator<T>
-
- com.consol.citrus.generate.javadsl.JavaDslTestGenerator<T>
-
- com.consol.citrus.generate.javadsl.MessagingJavaTestGenerator<XsdJavaTestGenerator>
-
- com.consol.citrus.generate.javadsl.XsdJavaTestGenerator
-
- All Implemented Interfaces:
TestGenerator<XsdJavaTestGenerator>,XsdTestGenerator<XsdJavaTestGenerator>
public class XsdJavaTestGenerator extends MessagingJavaTestGenerator<XsdJavaTestGenerator> implements XsdTestGenerator<XsdJavaTestGenerator>
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 XsdJavaTestGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Create tests with this generator.protected MessagegenerateInboundMessage(Message message)Inbound message generation hook for subclasses.protected MessagegenerateOutboundMessage(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.XsdJavaTestGeneratorwithInboundMappingFile(String mappingFile)Add inbound XPath expression mappings file to manipulate inbound message content.XsdJavaTestGeneratorwithInboundMappings(Map<String,String> mappings)Add inbound XPath expression mappings to manipulate inbound message content.XsdJavaTestGeneratorwithNameSuffix(String suffix)Set the test name suffix to use.XsdJavaTestGeneratorwithOutboundMappingFile(String mappingFile)Add outbound XPath expression mappings file to manipulate outbound message content.XsdJavaTestGeneratorwithOutboundMappings(Map<String,String> mappings)Add outbound XPath expression mappings to manipulate outbound message content.XsdJavaTestGeneratorwithRequestMessage(String requestMessage)Set the request element name in xsd resource to use.XsdJavaTestGeneratorwithResponseMessage(String responseMessage)Set the response element name in xsd resource to use.XsdJavaTestGeneratorwithXsd(String xsdResource)Set the xsd schema resource to use.-
Methods inherited from class com.consol.citrus.generate.javadsl.MessagingJavaTestGenerator
addRequestHeader, addResponseHeader, createJavaFileBuilder, getActions, getEndpoint, getReceiveRequestCodeProvider, getReceiveResponseCodeProvider, getSendRequestCodeProvider, getSendResponseCodeProvider, setEndpoint, withEndpoint, withRequest, withResponse
-
Methods inherited from class com.consol.citrus.generate.javadsl.JavaDslTestGenerator
getBaseExtension, getCitrusAnnotation
-
Methods inherited from class com.consol.citrus.generate.javadsl.JavaTestGenerator
createAnnotationBuilder, getBaseType, getMode, getSrcDirectory, setMode, 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 interface:TestGeneratorCreate tests with this generator.- Specified by:
createin interfaceTestGenerator<XsdJavaTestGenerator>- Overrides:
createin classJavaTestGenerator<XsdJavaTestGenerator>
-
generateInboundMessage
protected Message generateInboundMessage(Message message)
Description copied from class:MessagingJavaTestGeneratorInbound message generation hook for subclasses.- Overrides:
generateInboundMessagein classMessagingJavaTestGenerator<XsdJavaTestGenerator>- Returns:
-
generateOutboundMessage
protected Message generateOutboundMessage(Message message)
Description copied from class:MessagingJavaTestGeneratorOutbound message generation hook for subclasses.- Overrides:
generateOutboundMessagein classMessagingJavaTestGenerator<XsdJavaTestGenerator>- Returns:
-
getResponseMessageSuggestion
public String getResponseMessageSuggestion()
Suggest name of response element based on request message element name.- Specified by:
getResponseMessageSuggestionin interfaceXsdTestGenerator<XsdJavaTestGenerator>- Returns:
-
getTestNameSuggestion
public String getTestNameSuggestion()
Suggest name of test based on request message element name.- Returns:
-
withXsd
public XsdJavaTestGenerator withXsd(String xsdResource)
Set the xsd schema resource to use.- Specified by:
withXsdin interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
xsdResource-- Returns:
-
withRequestMessage
public XsdJavaTestGenerator withRequestMessage(String requestMessage)
Set the request element name in xsd resource to use.- Specified by:
withRequestMessagein interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
requestMessage-- Returns:
-
withResponseMessage
public XsdJavaTestGenerator withResponseMessage(String responseMessage)
Set the response element name in xsd resource to use.- Specified by:
withResponseMessagein interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
responseMessage-- Returns:
-
withNameSuffix
public XsdJavaTestGenerator withNameSuffix(String suffix)
Set the test name suffix to use.- Specified by:
withNameSuffixin interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
suffix-- Returns:
-
withInboundMappings
public XsdJavaTestGenerator withInboundMappings(Map<String,String> mappings)
Add inbound XPath expression mappings to manipulate inbound message content.- Specified by:
withInboundMappingsin interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
mappings-- Returns:
-
withOutboundMappings
public XsdJavaTestGenerator withOutboundMappings(Map<String,String> mappings)
Add outbound XPath expression mappings to manipulate outbound message content.- Specified by:
withOutboundMappingsin interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
mappings-- Returns:
-
withInboundMappingFile
public XsdJavaTestGenerator withInboundMappingFile(String mappingFile)
Add inbound XPath expression mappings file to manipulate inbound message content.- Specified by:
withInboundMappingFilein interfaceXsdTestGenerator<XsdJavaTestGenerator>- Parameters:
mappingFile-- Returns:
-
withOutboundMappingFile
public XsdJavaTestGenerator withOutboundMappingFile(String mappingFile)
Add outbound XPath expression mappings file to manipulate outbound message content.- Specified by:
withOutboundMappingFilein interfaceXsdTestGenerator<XsdJavaTestGenerator>- 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<XsdJavaTestGenerator>- Returns:
-
setRequestMessage
public void setRequestMessage(String requestMessage)
Sets the requestMessage.- Parameters:
requestMessage-
-
getRequestMessage
public String getRequestMessage()
Gets the requestMessage.- Specified by:
getRequestMessagein interfaceXsdTestGenerator<XsdJavaTestGenerator>- Returns:
-
setResponseMessage
public void setResponseMessage(String responseMessage)
Sets the responseMessage.- Parameters:
responseMessage-
-
getResponseMessage
public String getResponseMessage()
Gets the responseMessage.- Specified by:
getResponseMessagein interfaceXsdTestGenerator<XsdJavaTestGenerator>- Returns:
-
setNameSuffix
public void setNameSuffix(String nameSuffix)
Sets the nameSuffix.- Parameters:
nameSuffix-
-
getNameSuffix
public String getNameSuffix()
Gets the nameSuffix.- Returns:
-
-