public abstract class CleartkTestBase extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_TESTS_PROPERTY_VALUE
Value for the
SKIP_TESTS_PROPERTY property that indicates that all tests that can be
skipped are disabled. |
static String |
BIG_MEMORY_TEST_MESSAGE
A message indicating that the current test requires a lot of memory, and giving instructions
how to skip it.
|
static String |
BIG_MEMORY_TESTS_PROPERTY_VALUE
Value for the
SKIP_TESTS_PROPERTY property that indicates that tests requiring a lot
of memory should be disabled. |
static String |
COMMON_TESTS_PROPERTY_VALUE
Value for the
SKIP_TESTS_PROPERTY property that indicates that commonly skipped tests
should be disabled. |
org.junit.rules.TemporaryFolder |
folder |
protected JCas |
jCas |
protected Logger |
logger
A
Logger instance associated with the class, intended for use by subclasses. |
protected static String |
LONG_TEST_MESSAGE
A message indicating that the current test runs for a long time, and giving instructions how to
skip it.
|
static String |
LONG_TESTS_PROPERTY_VALUE
Value for the
SKIP_TESTS_PROPERTY property that indicates that long-running tests
should be disabled. |
protected File |
outputDirectory |
protected String |
outputDirectoryName |
static String |
SKIP_TESTS_PROPERTY
The name of the property that can be set to skip some tests.
|
| Constructor and Description |
|---|
CleartkTestBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assumeBigMemoryTestsEnabled()
Subclasses should call this method at the beginning of a test that will take a long time to
run.
|
protected void |
assumeLongTestsEnabled()
Subclasses should call this method at the beginning of a test that will take a long time to
run.
|
protected void |
assumeTestsEnabled(String... testNames)
Subclasses should call this method at the beginning of a test to check whether a specific type
of test is enabled by checking whether the name of that test is contained in the
"cleartk.skipTests" property.
|
static String |
createTestEnabledMessage(String testName,
String message)
Subclasses should call this method to create a message that explains how to disable a test.
|
void |
setUp() |
public static final String ALL_TESTS_PROPERTY_VALUE
SKIP_TESTS_PROPERTY property that indicates that all tests that can be
skipped are disabled. Current value: "all".public static final String BIG_MEMORY_TEST_MESSAGE
assumeBigMemoryTestsEnabled().public static final String BIG_MEMORY_TESTS_PROPERTY_VALUE
SKIP_TESTS_PROPERTY property that indicates that tests requiring a lot
of memory should be disabled. Current value: "bigMem".public static final String COMMON_TESTS_PROPERTY_VALUE
SKIP_TESTS_PROPERTY property that indicates that commonly skipped tests
should be disabled. Currently, this will disable at least "long"
and "bigMem" tests. It will also typically disable tests that
require binaries that are hard to build (e.g. tk-svmlight, crfsuite). Current value:
"common".public org.junit.rules.TemporaryFolder folder
protected Logger logger
Logger instance associated with the class, intended for use by subclasses.protected static final String LONG_TEST_MESSAGE
assumeLongTestsEnabled().public static final String LONG_TESTS_PROPERTY_VALUE
SKIP_TESTS_PROPERTY property that indicates that long-running tests
should be disabled. Current value: "long".protected File outputDirectory
protected String outputDirectoryName
public static final String SKIP_TESTS_PROPERTY
-Dcleartk.skipTests=long,bigMempublic CleartkTestBase()
protected void assumeBigMemoryTestsEnabled()
this.logger.info(BIG_MEMORY_TEST_MESSAGE).protected void assumeLongTestsEnabled()
this.logger.info(LONG_TEST_MESSAGE).protected void assumeTestsEnabled(String... testNames)
assumeTestsEnabled(java.lang.String...), a test should log a message
created by createTestEnabledMessage(java.lang.String, java.lang.String) to explain to a user how to disable the test if
they wish.
Note that if "cleartk.skipTests" contains "all" then the
test will be skipped even if ALL_TESTS_PROPERTY_VALUE was not passed as an argument to
this method.public static String createTestEnabledMessage(String testName, String message)
assumeTestsEnabled(String...).testName - The name of the test (i.e. the value that should be present in the
"cleartk.skipTests" property)message - A message describing the requirements of the tests that are run when the named test is
enabled.Copyright © 2014. All rights reserved.