Package org.opengis.test.referencing
Class AffineTransformTest
Object
TestCase
TransformTestCase
AffineTransformTest
Tests affine transforms
from the
org.opengis.referencing.operation
package. Math transform instances are
created using the factory given at construction time.
Usage example:
in order to specify their factories and run the tests in a JUnit framework, implementers can define a subclass in their own test suite as in the example below:import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.opengis.test.referencing.AffineTransformTest;
@RunWith(JUnit4.class)
public class MyTest extends AffineTransformTest {
public MyTest() {
super(new MyMathTransformFactory());
}
}
- Since:
- 3.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
true
ifMathTransformFactory.createAffineTransform(Matrix)
accepts matrixes of size different than 3×3.protected boolean
true
ifMathTransformFactory.createAffineTransform(Matrix)
accepts non-square matrixes.protected Matrix
The matrix of the math transform being tested.protected final MathTransformFactory
The factory for creatingMathTransform
objects, ornull
if none.Fields inherited from class TransformTestCase
derivativeDeltas, isDerivativeSupported, isDoubleToDoubleSupported, isDoubleToFloatSupported, isFloatToDoubleSupported, isFloatToFloatSupported, isInverseTransformSupported, isOverlappingArraySupported, tolerance, toleranceModifier, transform
Fields inherited from class TestCase
configurationTip, listener, units, validators
-
Constructor Summary
ConstructorsConstructorDescriptionAffineTransformTest
(MathTransformFactory factory) Creates a new test using the given factory. -
Method Summary
Modifier and TypeMethodDescriptionReturns information about the configuration of the test which has been run.Returns a default set of factories to use for running the tests.void
Tests a transform swapping the axes in a two-dimensional space.void
Tests a transform which reduce the number of dimensions from 4 to 2.void
Tests using a combination of scale, rotation and translation in a two-dimensional space.void
Tests using a non-uniform scale factor of (3,4) in a two-dimensional space.void
Tests using an identity transform in an one-dimensional space.void
Tests using an identity transform in a two-dimensional space.void
Tests using an identity transform in a three-dimensional space.void
Tests using an anticlockwise 30° rotation in a two-dimensional space.void
Tests using a 180° rotation in a two-dimensional space.void
Tests using a translation of (400000,-100000) metres in a two-dimensional space.void
Tests using a uniform scale factor of 0.3048 in a two-dimensional space.Methods inherited from class TransformTestCase
assertAllTestsEnabled, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinateEquals, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertCoordinatesEqual, assertMatrixEquals, normalize, tolerance, verifyConsistency, verifyDerivative, verifyInDomain, verifyInverse, verifyInverse, verifyTransform
Methods inherited from class TestCase
factories, getEnabledFlags
-
Field Details
-
mtFactory
The factory for creatingMathTransform
objects, ornull
if none. -
matrix
The matrix of the math transform being tested. This field is set, together with thetransform
field, after the execution of everytestFoo()
method in this class.If this field is non-null before a test is run, then those parameters will be used directly. This allow implementers to alter the parameters before to run the test one more time.
-
isNonSquareMatrixSupported
protected boolean isNonSquareMatrixSupportedtrue
ifMathTransformFactory.createAffineTransform(Matrix)
accepts non-square matrixes. Transforms defined by non-square matrixes have a number of input dimensions different than the number of output dimensions. -
isNonBidimensionalSpaceSupported
protected boolean isNonBidimensionalSpaceSupportedtrue
ifMathTransformFactory.createAffineTransform(Matrix)
accepts matrixes of size different than 3×3. Iffalse
, then only matrixes of size 3×3 (i.e. affine transforms between two-dimensional spaces) will be tested.
-
-
Constructor Details
-
AffineTransformTest
Creates a new test using the given factory. If the given factory isnull
, then the tests will be skipped.- Parameters:
factory
- factory for creatingMathTransform
instances.
-
-
Method Details
-
factories
Returns a default set of factories to use for running the tests. Those factories are given in arguments to the constructor when this test class is instantiated directly by JUnit (for example as a suite element), instead of sub-classed by the implementer. The factories are fetched as documented in theTestCase.factories(Class[])
javadoc.- Returns:
- the default set of arguments to be given to the
AffineTransformTest
constructor.
-
configuration
Returns information about the configuration of the test which has been run. This method returns a map containing:- All the entries defined in the parent class.
- All the following values associated to the
Configuration.Key
of the same name:
- Overrides:
configuration
in classTransformTestCase
- 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.
-
testIdentity1D
Tests using an identity transform in an one-dimensional space. This test is executed only if theisNonBidimensionalSpaceSupported
flag is set totrue
.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testIdentity2D
Tests using an identity transform in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testIdentity3D
Tests using an identity transform in a three-dimensional space. This test is executed only if theisNonBidimensionalSpaceSupported
flag is set totrue
.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testAxisSwapping2D
Tests a transform swapping the axes in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testSouthOrientated2D
Tests using a 180° rotation in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testTranslatation2D
Tests using a translation of (400000,-100000) metres in a two-dimensional space. This translation is the (False easting, False northing) parameter values of the OSGB 1936 / British National Grid projection.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testUniformScale2D
Tests using a uniform scale factor of 0.3048 in a two-dimensional space. This is the conversion factor from feet to metres.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testGenericScale2D
Tests using a non-uniform scale factor of (3,4) in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testRotation2D
Tests using an anticlockwise 30° rotation in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testGeneral
Tests using a combination of scale, rotation and translation in a two-dimensional space.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-
testDimensionReduction
Tests a transform which reduce the number of dimensions from 4 to 2. This test is executed only if theisNonSquareMatrixSupported
flag is set totrue
.- Throws:
FactoryException
- should never happen.TransformException
- should never happen.
-