Package edu.fiu.jtlex.data
Class TestUtils
java.lang.Object
edu.fiu.jtlex.data.TestUtils
A class with utility functions for testing purposes.
- Author:
- luisrobaina
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<ITimeMLEvent>Generates every permutation of valid Events.static ITimeMLGraphgenerateTestGraph(int which) Utility function to generate a sample INewGraph for testing purposes.static ArrayList<ITimeMLInstance>Generates every permutation of valid Instances.static ArrayList<ITimeMLSignal>Generates every permutation of valid Signals.static ArrayList<ITimeMLTimex>Generates every permutation of valid Timexes.static StringGenerates the absolute path to the Time Bank Corpus directory for the current executing machine.static StringRetrieves the relative path to the Time Bank Corpus directory from the repository root directory.static StringGets the environment variable with nameENV.static StringGenerates the absolute path to the Results directory for the current executing machine.static StringRetrieves the relative path to the result directory from the repository root directory.static String[]static booleanisDebug()Determines whether the current environment isDEBUGstatic booleanDetermines whether the current environment isPRODUCTION
-
Field Details
-
NUMBER_OF_TEST_GRAPHS
public static final int NUMBER_OF_TEST_GRAPHS- See Also:
-
-
Constructor Details
-
TestUtils
public TestUtils()
-
-
Method Details
-
getTestableFiles
-
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
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
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
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
Gets the environment variable with nameENV. The following are the supported values:- PRODUCTION
- 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 isDEBUG- Returns:
- True if the environment is
DEBUG, else false
-
isProduction
public static boolean isProduction()Determines whether the current environment isPRODUCTION- Returns:
- True if the environment is
PRODUCTION, else false - Since:
- jTLEX 1.0
-
generateTestGraph
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
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
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
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
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.
-