Package com.consol.citrus.generate.xml
Class XmlTestGenerator<T extends XmlTestGenerator>
- java.lang.Object
-
- com.consol.citrus.generate.AbstractTestGenerator<T>
-
- com.consol.citrus.generate.AbstractTemplateBasedTestGenerator<T>
-
- com.consol.citrus.generate.xml.XmlTestGenerator<T>
-
- All Implemented Interfaces:
TestGenerator<T>
- Direct Known Subclasses:
MessagingXmlTestGenerator
public class XmlTestGenerator<T extends XmlTestGenerator> extends AbstractTemplateBasedTestGenerator<T>
- 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 XmlTestGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()Create the test case.protected List<Object>getActions()List of test actions to be marshalled in the actions section of the test.protected TestGeneratorgetJavaTestGenerator()Gets Java test generator for this XML test.TestActionMarshallergetMarshaller()Gets the marshaller.protected List<String>getMarshallerContextPaths()Marshaller context paths.protected List<org.springframework.core.io.Resource>getMarshallerSchemas()Marshaller schema.TestGenerator.GeneratorModegetMode()Gets the mode.StringgetSrcDirectory()Get the test source directory.protected StringgetTemplateFilePath()Subclasses must provide proper template file path.protected PropertiesgetTemplateProperties()Prepares the test case properties for dynamic property replacement in test case templates.voidsetMarshaller(TestActionMarshaller marshaller)Sets the marshaller.voidsetMode(TestGenerator.GeneratorMode mode)Sets the mode.TwithMode(TestGenerator.GeneratorMode mode)Set the mode describing which part (client/server) to use.-
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
-
-
-
-
Method Detail
-
withMode
public T withMode(TestGenerator.GeneratorMode mode)
Set the mode describing which part (client/server) to use.- Parameters:
mode-- Returns:
-
getMarshallerContextPaths
protected List<String> getMarshallerContextPaths()
Marshaller context paths. Subclasses may add additional packages.- Returns:
-
getMarshallerSchemas
protected List<org.springframework.core.io.Resource> getMarshallerSchemas()
Marshaller schema. Subclasses may overwrite schema or set to null to disable schema validation of marshalled data.- Returns:
-
create
public void create()
Description copied from class:AbstractTemplateBasedTestGeneratorCreate the test case.- Specified by:
createin interfaceTestGenerator<T extends XmlTestGenerator>- Overrides:
createin classAbstractTemplateBasedTestGenerator<T extends XmlTestGenerator>
-
getTemplateProperties
protected Properties getTemplateProperties()
Description copied from class:AbstractTemplateBasedTestGeneratorPrepares the test case properties for dynamic property replacement in test case templates.- Overrides:
getTemplatePropertiesin classAbstractTemplateBasedTestGenerator<T extends XmlTestGenerator>- Returns:
- the prepared property set.
-
getActions
protected List<Object> getActions()
List of test actions to be marshalled in the actions section of the test.- Returns:
-
getJavaTestGenerator
protected TestGenerator getJavaTestGenerator()
Gets Java test generator for this XML test.- Returns:
-
getTemplateFilePath
protected String getTemplateFilePath()
Description copied from class:AbstractTemplateBasedTestGeneratorSubclasses must provide proper template file path.- Specified by:
getTemplateFilePathin classAbstractTemplateBasedTestGenerator<T extends XmlTestGenerator>- Returns:
-
getSrcDirectory
public String getSrcDirectory()
Description copied from class:AbstractTestGeneratorGet the test source directory.- Overrides:
getSrcDirectoryin classAbstractTestGenerator<T extends XmlTestGenerator>- Returns:
- the srcDirectory
-
setMarshaller
public void setMarshaller(TestActionMarshaller marshaller)
Sets the marshaller.- Parameters:
marshaller-
-
getMarshaller
public TestActionMarshaller getMarshaller()
Gets the marshaller.- Returns:
-
getMode
public TestGenerator.GeneratorMode getMode()
Gets the mode.- Returns:
-
setMode
public void setMode(TestGenerator.GeneratorMode mode)
Sets the mode.- Parameters:
mode-
-
-