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
  • Field Details

  • Constructor Details

    • AbstractTestGenerator

      public AbstractTestGenerator()
  • Method Details

    • withName

      public T withName(String name)
      Set name via builder method.
      Specified by:
      withName in interface TestGenerator<T extends TestGenerator>
      Parameters:
      name -
      Returns:
    • withAuthor

      public T withAuthor(String author)
      Set author via builder method.
      Specified by:
      withAuthor in interface TestGenerator<T extends TestGenerator>
      Parameters:
      author -
      Returns:
    • withDescription

      public T withDescription(String description)
      Set description via builder method.
      Specified by:
      withDescription in interface TestGenerator<T extends TestGenerator>
      Parameters:
      description -
      Returns:
    • withFileExtension

      public T withFileExtension(String extension)
      Set file extension via builder method.
      Parameters:
      extension -
      Returns:
    • usePackage

      public T usePackage(String targetPackage)
      Set package via builder method.
      Specified by:
      usePackage in interface TestGenerator<T extends TestGenerator>
      Parameters:
      targetPackage -
      Returns:
    • useSrcDirectory

      public T useSrcDirectory(String srcDirectory)
      Set test source directory via builder method.
      Specified by:
      useSrcDirectory in interface TestGenerator<T extends TestGenerator>
      Parameters:
      srcDirectory -
      Returns:
    • withFramework

      public T withFramework(UnitFramework framework)
      Set the unit testing framework to use.
      Specified by:
      withFramework in interface TestGenerator<T extends TestGenerator>
      Parameters:
      framework -
      Returns:
    • withDisabled

      public T withDisabled(boolean disabled)
      Set the disabled state to use.
      Specified by:
      withDisabled in interface TestGenerator<T extends TestGenerator>
      Parameters:
      disabled -
      Returns:
    • getMethodName

      protected String getMethodName()
      Construct default test method name from test name.
      Returns:
    • getCreationDate

      protected String getCreationDate()
      Get current date in special format.
      Returns:
    • getUpdateDateTime

      protected String getUpdateDateTime()
      Get current date time in special format.
      Returns:
    • getTargetFile

      protected File getTargetFile()
      Construct proper target file to save test content to.
      Returns:
    • setName

      public void setName(String name)
      Set the test name.
      Parameters:
      name - the name to set
    • getName

      public String getName()
      Get the test name.
      Specified by:
      getName in interface TestGenerator<T extends TestGenerator>
      Returns:
      the name
    • setAuthor

      public void setAuthor(String author)
      Set the test author.
      Parameters:
      author - the author to set
    • getAuthor

      public String getAuthor()
      Get the test author.
      Specified by:
      getAuthor in interface TestGenerator<T extends TestGenerator>
      Returns:
      the author
    • setDescription

      public void setDescription(String description)
      Set the test description.
      Parameters:
      description - the description to set
    • getDescription

      public String getDescription()
      Get the test description.
      Specified by:
      getDescription in interface TestGenerator<T extends TestGenerator>
      Returns:
      the description
    • setPackage

      public void setPackage(String targetPackage)
      Set the test package.
      Parameters:
      targetPackage - the targetPackage to set
    • getSrcDirectory

      public String getSrcDirectory()
      Get the test source directory.
      Returns:
      the srcDirectory
    • setSrcDirectory

      public void setSrcDirectory(String srcDirectory)
      Set the test source directory.
      Parameters:
      srcDirectory - the srcDirectory to set
    • getPackage

      public String getPackage()
      Get the test package.
      Returns:
      the targetPackage
    • getTargetPackage

      public String getTargetPackage()
      Get the target package.
      Specified by:
      getTargetPackage in interface TestGenerator<T extends TestGenerator>
      Returns:
      the targetPackage
    • setTargetPackage

      public void setTargetPackage(String targetPackage)
      Set the target package.
      Parameters:
      targetPackage - the targetPackage to set
    • getFramework

      public UnitFramework getFramework()
      Get the unit test framework (usually TestNG or JUnit).
      Specified by:
      getFramework in interface TestGenerator<T extends TestGenerator>
      Returns:
      the framework
    • setFramework

      public void setFramework(UnitFramework framework)
      Set the unit test framework.
      Parameters:
      framework - the framework to set
    • getFileExtension

      public String getFileExtension()
      Gets the fileExtension.
      Returns:
    • setFileExtension

      public void setFileExtension(String fileExtension)
      Sets the fileExtension.
      Parameters:
      fileExtension -
    • isDisabled

      public boolean isDisabled()
      Gets the disabled.
      Specified by:
      isDisabled in interface TestGenerator<T extends TestGenerator>
      Returns:
    • setDisabled

      public void setDisabled(boolean disabled)
      Sets the disabled.
      Parameters:
      disabled -