Class TestUtils

java.lang.Object
edu.fiu.jtlex.data.TestUtils

public class TestUtils extends Object
A class with utility functions for testing purposes.
Author:
luisrobaina
  • Field Details

  • Constructor Details

    • TestUtils

      public TestUtils()
  • Method Details

    • getTestableFiles

      public static String[] getTestableFiles()
    • getResultsRelativePath

      public static String getResultsRelativePath()
      Retrieves the relative path to the result directory from the repository root directory.
      Returns:
      relative path to the Results directory from the repository root directory.
    • getResultsAbsolutePath

      public static String getResultsAbsolutePath()
      Generates the absolute path to the Results directory for the current executing machine. The value is cached to save resources.
      Returns:
      absolute path to the Results Corpus directory.
    • getCorpusRelativePath

      public static String getCorpusRelativePath()
      Retrieves the relative path to the Time Bank Corpus directory from the repository root directory.
      Returns:
      relative path to the Time Bank Corpus from the repository root directory.
    • getCorpusAbsolutePath

      public static String getCorpusAbsolutePath()
      Generates the absolute path to the Time Bank Corpus directory for the current executing machine. The value is cached to save resources.
      Returns:
      absolute path to The TimeBank Corpus directory.
    • getEnvironment

      public static String getEnvironment()
      Gets the environment variable with name ENV. The following are the supported values:
      1. PRODUCTION
      2. DEBUG
      Returns:
      A string indicating the current environment, or null if there is no environment variable with name ENV
    • isDebug

      public static boolean isDebug()
      Determines whether the current environment is DEBUG
      Returns:
      True if the environment is DEBUG, else false
    • isProduction

      public static boolean isProduction()
      Determines whether the current environment is PRODUCTION
      Returns:
      True if the environment is PRODUCTION, else false
      Since:
      jTLEX 1.0
    • generateTestGraph

      public static ITimeMLGraph generateTestGraph(int which)
      Utility function to generate a sample INewGraph for testing purposes.
      Parameters:
      which - Integer id of the graph to generate.
      Returns:
      A sample test IGraph with matching ID, else null.
    • generateTestSignals

      public static ArrayList<ITimeMLSignal> generateTestSignals()
      Generates every permutation of valid Signals. (5 total, .013 relative build time) Infinitely variable variables, such as Strings and Integers are given 2 test options. The rest (enums) iterate through possible values. Expect test cases using this list to be all-encompassing.
      Returns:
      a list of every permutation of valid Signals.
    • generateTestEvents

      public static ArrayList<ITimeMLEvent> generateTestEvents()
      Generates every permutation of valid Events. (42 total, .028s relative build time) Infinitely variable variables, such as Strings and Integers are given 2 test options. The rest (enums) iterate through possible values. Expect test cases using this list to be all-encompassing.
      Returns:
      a list of every permutation of valid Events.
    • generateTestInstances

      public static ArrayList<ITimeMLInstance> generateTestInstances()
      Generates every permutation of valid Instances. (705600 total, .219s relative build time) Infinitely variable variables, such as Strings and Integers are given 2 test options. The rest (enums) iterate through possible values. Expect test cases using this list to have a high computation time, yet being all-encompassing.
      Returns:
      a list of every permutation of valid Instances.
    • generateTestTimexes

      public static ArrayList<ITimeMLTimex> generateTestTimexes()
      Generates every permutation of valid Timexes. (524160 total, .164s relative build time) Infinitely variable variables, such as Strings and Integers are given 2 test options (not including null). The rest (enums) iterate through possible values. Expect test cases using this list to have a high computation time, yet being all-encompassing.
      Returns:
      a list of every permutation of valid Timexes.