Package org.citrusframework.generate
Class AbstractTestGenerator<T extends TestGenerator>
java.lang.Object
org.citrusframework.generate.AbstractTestGenerator<T>
- All Implemented Interfaces:
TestGenerator<T>
- Direct Known Subclasses:
AbstractTemplateBasedTestGenerator,JavaTestGenerator
public abstract class AbstractTestGenerator<T extends TestGenerator>
extends Object
implements TestGenerator<T>
- Since:
- 2.7.4
- Author:
- Christoph Deppisch
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.citrusframework.generate.TestGenerator
TestGenerator.GeneratorMode -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the test author.protected StringGet current date in special format.Get the test description.Gets the fileExtension.Get the unit test framework (usually TestNG or JUnit).protected StringConstruct default test method name from test name.getName()Get the test name.Get the test package.Get the test source directory.protected FileConstruct proper target file to save test content to.Get the target package.protected StringGet current date time in special format.booleanGets the disabled.voidSet the test author.voidsetDescription(String description) Set the test description.voidsetDisabled(boolean disabled) Sets the disabled.voidsetFileExtension(String fileExtension) Sets the fileExtension.voidsetFramework(UnitFramework framework) Set the unit test framework.voidSet the test name.voidsetPackage(String targetPackage) Set the test package.voidsetSrcDirectory(String srcDirectory) Set the test source directory.voidsetTargetPackage(String targetPackage) Set the target package.usePackage(String targetPackage) Set package via builder method.useSrcDirectory(String srcDirectory) Set test source directory via builder method.withAuthor(String author) Set author via builder method.withDescription(String description) Set description via builder method.withDisabled(boolean disabled) Set the disabled state to use.withFileExtension(String extension) Set file extension via builder method.withFramework(UnitFramework framework) Set the unit testing framework to use.Set name via builder method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.generate.TestGenerator
create, getMode, withMode
-
Field Details
-
self
-
-
Constructor Details
-
AbstractTestGenerator
public AbstractTestGenerator()
-
-
Method Details
-
withName
Set name via builder method.- Specified by:
withNamein interfaceTestGenerator<T extends TestGenerator>- Parameters:
name-- Returns:
-
withAuthor
Set author via builder method.- Specified by:
withAuthorin interfaceTestGenerator<T extends TestGenerator>- Parameters:
author-- Returns:
-
withDescription
Set description via builder method.- Specified by:
withDescriptionin interfaceTestGenerator<T extends TestGenerator>- Parameters:
description-- Returns:
-
withFileExtension
Set file extension via builder method.- Parameters:
extension-- Returns:
-
usePackage
Set package via builder method.- Specified by:
usePackagein interfaceTestGenerator<T extends TestGenerator>- Parameters:
targetPackage-- Returns:
-
useSrcDirectory
Set test source directory via builder method.- Specified by:
useSrcDirectoryin interfaceTestGenerator<T extends TestGenerator>- Parameters:
srcDirectory-- Returns:
-
withFramework
Set the unit testing framework to use.- Specified by:
withFrameworkin interfaceTestGenerator<T extends TestGenerator>- Parameters:
framework-- Returns:
-
withDisabled
Set the disabled state to use.- Specified by:
withDisabledin interfaceTestGenerator<T extends TestGenerator>- Parameters:
disabled-- Returns:
-
getMethodName
Construct default test method name from test name.- Returns:
-
getCreationDate
Get current date in special format.- Returns:
-
getUpdateDateTime
Get current date time in special format.- Returns:
-
getTargetFile
Construct proper target file to save test content to.- Returns:
-
setName
Set the test name.- Parameters:
name- the name to set
-
getName
Get the test name.- Specified by:
getNamein interfaceTestGenerator<T extends TestGenerator>- Returns:
- the name
-
setAuthor
Set the test author.- Parameters:
author- the author to set
-
getAuthor
Get the test author.- Specified by:
getAuthorin interfaceTestGenerator<T extends TestGenerator>- Returns:
- the author
-
setDescription
Set the test description.- Parameters:
description- the description to set
-
getDescription
Get the test description.- Specified by:
getDescriptionin interfaceTestGenerator<T extends TestGenerator>- Returns:
- the description
-
setPackage
Set the test package.- Parameters:
targetPackage- the targetPackage to set
-
getSrcDirectory
Get the test source directory.- Returns:
- the srcDirectory
-
setSrcDirectory
Set the test source directory.- Parameters:
srcDirectory- the srcDirectory to set
-
getPackage
Get the test package.- Returns:
- the targetPackage
-
getTargetPackage
Get the target package.- Specified by:
getTargetPackagein interfaceTestGenerator<T extends TestGenerator>- Returns:
- the targetPackage
-
setTargetPackage
Set the target package.- Parameters:
targetPackage- the targetPackage to set
-
getFramework
Get the unit test framework (usually TestNG or JUnit).- Specified by:
getFrameworkin interfaceTestGenerator<T extends TestGenerator>- Returns:
- the framework
-
setFramework
Set the unit test framework.- Parameters:
framework- the framework to set
-
getFileExtension
Gets the fileExtension.- Returns:
-
setFileExtension
Sets the fileExtension.- Parameters:
fileExtension-
-
isDisabled
public boolean isDisabled()Gets the disabled.- Specified by:
isDisabledin interfaceTestGenerator<T extends TestGenerator>- Returns:
-
setDisabled
public void setDisabled(boolean disabled) Sets the disabled.- Parameters:
disabled-
-