Class TestHelper

java.lang.Object
org.nuiton.plugin.PluginHelper
org.nuiton.plugin.TestHelper

public abstract class TestHelper extends org.nuiton.plugin.PluginHelper
Since:
1.0.3
Author:
Tony Chemit - chemit@codelutin.com
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static File
     
    protected static File
     
    protected static boolean
     

    Fields inherited from class org.nuiton.plugin.PluginHelper

    memoryFactors, memoryUnites, SNAPSHOT_SUFFIX, timeFactors, timeUnites
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkExistsPattern(File file, String pattern, String encoding, boolean required)
    Checks on the given file that : file exists the given pattern exists required = true (or not required = false) in the content of the file.
    static void
    checkPattern(File file, String content, String pattern, boolean required)
     
    static File
     
    static File
     
    static File
    getTestDir(Class<?> type, String prefix)
     
    static boolean
     
    static void
    setBasedir(File basedir)
     
    static void
    setVerbose(boolean verbose)
     

    Methods inherited from class org.nuiton.plugin.PluginHelper

    addResourceDir, addResourceDir, addTestResourceDir, checkEncoding, convert, convertMemory, convertTime, convertTime, copy, copyFiles, copyFiles, createDirectoryIfNecessary, createNewFile, deleteFile, expandFile, expandFiles, getEmptyKeys, getFile, getIncludedFiles, getLines, getLinesAsFiles, getLinesAsURL, getRelativePath, getUrl, prefixLines, readAsString, readAsString, removeSnapshotSuffix, renameFile, setLastModified, splitAndTrim, toGenericList, writeString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • verbose

      protected static boolean verbose
    • basedir

      protected static File basedir
    • testBasedir

      protected static File testBasedir
  • Constructor Details

    • TestHelper

      public TestHelper()
  • Method Details

    • getTestBasedir

      public static File getTestBasedir()
    • getBasedir

      public static File getBasedir()
      Returns:
      the basedir for all tests
      See Also:
      • PlexusTestCase.getBasedir()
    • setBasedir

      public static void setBasedir(File basedir)
    • isVerbose

      public static boolean isVerbose()
    • setVerbose

      public static void setVerbose(boolean verbose)
    • getTestDir

      public static File getTestDir(Class<?> type, String prefix)
    • checkExistsPattern

      public static void checkExistsPattern(File file, String pattern, String encoding, boolean required) throws IOException
      Checks on the given file that :
      • file exists
      • the given pattern exists required = true (or not required = false) in the content of the file.
      Parameters:
      file - the file to test
      pattern - the pattern to search
      encoding - encoding of the file to read
      required - flag to says if pattern should (or not) be found in file's content
      Throws:
      IOException - if could not read file
    • checkPattern

      public static void checkPattern(File file, String content, String pattern, boolean required) throws IOException
      Throws:
      IOException