Object
TestCase
- Direct Known Subclasses:
ImageIOTestCase
,NameTest
,ReferencingTestCase
,TransformTestCase
Base class of all GeoAPI tests.
All concrete subclasses need at least one
Factory
for instantiating the objects to test.
The factories must be specified at subclasses construction time either directly by the implementer,
or indirectly through dependency injection.
Test case life cycle
GeoAPI test cases contain states as non-final protected fields. Therefor, a newTestCase
instance should be created for each test method to run
(Lifecycle.PER_METHOD
).
If PER_CLASS
is desired,
then subclasses are responsible for resetting these fields after each test.- Since:
- 2.2
-
Field Summary
Modifier and TypeFieldDescriptionprotected Configuration.Key
<Boolean> A tip set by subclasses during the execution of some optional tests.protected final Units
Provider of units of measurement (degree, metre, second, etc), nevernull
.protected final ValidatorContainer
The set ofValidator
instances to use for verifying objects conformance (nevernull
). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns information about the configuration of the test which has been run.protected final boolean[]
getEnabledFlags
(Configuration.Key<Boolean>... properties) Returns booleans indicating whether the given operations are enabled.
-
Field Details
-
units
Provider of units of measurement (degree, metre, second, etc), nevernull
. TheUnits.degree()
,metre()
and other methods shall returnUnit
instances compatible with the units created by theFactory
instances to be tested. ThoseUnit<?>
instances depend on the Unit of Measurement (JSR-373) implementation used by the factories. If no units were explicitly specified, then the default units are used.- Since:
- 3.1
-
validators
The set ofValidator
instances to use for verifying objects conformance (nevernull
). If no validators were explicitly specified, then the default validators are used.- Since:
- 3.1
-
configurationTip
A tip set by subclasses during the execution of some optional tests. In case of optional test failure, if this field is non-null, then a message will be logged at theLevel.INFO
for giving some tips to the developer about how he can disable the test.Example
@Test public void myTest() { if (isDerivativeSupported) { configurationTip = Configuration.Key.isDerivativeSupported; // Do some tests the require support of math transform derivatives. } configurationTip = null; }
- Since:
- 3.1
-
-
Constructor Details
-
TestCase
protected TestCase()Creates a new test case.
-
-
Method Details
-
getEnabledFlags
Returns booleans indicating whether the given operations are enabled. By default, every operations are enabled.- Parameters:
properties
- the key for which the flags are wanted.- Returns:
- an array of the same length as
properties
in which each element at index i indicates whether theproperties[i]
test should be enabled. - Since:
- 3.1
-
configuration
Returns information about the configuration of the test which has been run. The content of this map depends on theTestCase
subclass. For a description of the map content, see any of the following subclasses:- Returns:
- the configuration of the test being run, or an empty map if none. This method returns a modifiable map in order to allow subclasses to modify it.
- Since:
- 3.1
-