public class TestUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TestUtils.DimensionalityType |
static class |
TestUtils.ExpectedResults |
Modifier and Type | Field and Description |
---|---|
static org.opengis.referencing.crs.CoordinateReferenceSystem |
CUSTOM_CRS |
static String |
CUSTOM_CRSCODE |
static Index |
DEFAULT_SPATIAL_INDEX |
static Index |
DEFAULT_SPATIAL_TEMPORAL_INDEX |
static Index |
DEFAULT_TEMPORAL_INDEX |
static double |
DOUBLE_EPSILON |
static String |
S3_INPUT_PATH |
static String |
S3URL |
static File |
TEMP_DIR |
static String |
TEST_CASE_BASE |
static String |
TEST_FILTER_END_TIME_ATTRIBUTE_NAME |
static String |
TEST_FILTER_START_TIME_ATTRIBUTE_NAME |
static String |
TEST_NAMESPACE |
static String |
TEST_NAMESPACE_BAD |
static String |
TEST_RESOURCE_PACKAGE |
Constructor and Description |
---|
TestUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
assert200(String msg,
int responseCode)
Deprecated.
|
static void |
assert400(String msg,
int responseCode)
Deprecated.
|
static void |
assert404(String msg,
int responseCode)
Deprecated.
|
static void |
assertStatusCode(int expectedCode,
javax.ws.rs.core.Response response)
Asserts that the response has the expected Status Code.
|
static void |
assertStatusCode(String msg,
int expectedCode,
javax.ws.rs.core.Response response)
Asserts that the response has the expected Status Code.
|
static Index |
createWebMercatorSpatialIndex() |
static Index |
createWebMercatorSpatialTemporalIndex() |
static void |
deleteAll(DataStorePluginOptions dataStore) |
static QueryConstraints |
featureToQuery(org.opengis.feature.simple.SimpleFeature savedFilter,
org.apache.commons.lang3.tuple.Pair<String,String> optimalCqlQueryGeometryAndTimeField,
String crsCode,
boolean useDuring) |
static void |
fillTestRasters(WritableRaster raster1,
WritableRaster raster2,
int tileSize) |
static TestUtils.ExpectedResults |
getExpectedResults(CloseableIterator<?> results) |
static TestUtils.ExpectedResults |
getExpectedResults(URL[] expectedResultsResources) |
static TestUtils.ExpectedResults |
getExpectedResults(URL[] expectedResultsResources,
org.opengis.referencing.crs.CoordinateReferenceSystem crs) |
static StoreTestEnvironment |
getTestEnvironment(String type) |
static double |
getTileValue(int x,
int y,
int b,
int tileSize) |
static double |
getTileValue(int x,
int y,
int b,
int r,
int tileSize) |
static long |
hashCentroid(org.locationtech.jts.geom.Geometry geometry) |
static boolean |
isOracleJRE() |
static boolean |
isSet(String str) |
static boolean |
isYarn() |
static void |
printEndOfTest(org.slf4j.Logger logger,
String testName,
long startMillis) |
static void |
printStartOfTest(org.slf4j.Logger logger,
String testName) |
protected static void |
replaceParameters(Map<String,String> values,
File file) |
static org.opengis.feature.simple.SimpleFeature |
resourceToFeature(URL filterResource) |
static QueryConstraints |
resourceToQuery(URL filterResource) |
static QueryConstraints |
resourceToQuery(URL filterResource,
org.apache.commons.lang3.tuple.Pair<String,String> optimalCqlQueryGeometryAndTimeFields,
boolean useDuring) |
static void |
testLocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String ingestFilePath) |
static void |
testLocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String ingestFilePath,
int nthreads) |
static void |
testLocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String ingestFilePath,
String format,
int nthreads) |
static void |
testLocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String crsCode,
String ingestFilePath,
String format,
int nthreads) |
static void |
testLocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String crsCode,
String ingestFilePath,
String format,
int nthreads,
boolean supportTimeRange) |
static void |
testS3LocalIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String s3Url,
String ingestFilePath,
String format,
int nthreads) |
static void |
testSparkIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String format) |
static void |
testSparkIngest(DataStorePluginOptions dataStore,
TestUtils.DimensionalityType dimensionalityType,
String s3Url,
String ingestFilePath,
String format) |
static void |
testTileAgainstReference(BufferedImage actual,
BufferedImage expected,
double minPctError,
double maxPctError) |
static org.opengis.referencing.operation.MathTransform |
transformFromCrs(org.opengis.referencing.crs.CoordinateReferenceSystem crs) |
static void |
writeConfigToFile(File file,
org.apache.hadoop.conf.Configuration config) |
public static final File TEMP_DIR
public static final String TEST_FILTER_START_TIME_ATTRIBUTE_NAME
public static final String TEST_FILTER_END_TIME_ATTRIBUTE_NAME
public static final String TEST_NAMESPACE
public static final String TEST_NAMESPACE_BAD
public static final String TEST_RESOURCE_PACKAGE
public static final String TEST_CASE_BASE
public static final Index DEFAULT_SPATIAL_INDEX
public static final Index DEFAULT_TEMPORAL_INDEX
public static final Index DEFAULT_SPATIAL_TEMPORAL_INDEX
public static String CUSTOM_CRSCODE
public static final org.opengis.referencing.crs.CoordinateReferenceSystem CUSTOM_CRS
public static final double DOUBLE_EPSILON
public static final String S3_INPUT_PATH
public static final String S3URL
public static Index createWebMercatorSpatialIndex()
public static Index createWebMercatorSpatialTemporalIndex()
public static boolean isYarn()
public static boolean isOracleJRE()
public static void writeConfigToFile(File file, org.apache.hadoop.conf.Configuration config) throws IOException
IOException
public static void testLocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String ingestFilePath, int nthreads) throws Exception
Exception
public static void testLocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String ingestFilePath) throws Exception
Exception
public static boolean isSet(String str)
public static void deleteAll(DataStorePluginOptions dataStore)
public static void testLocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String ingestFilePath, String format, int nthreads) throws Exception
Exception
public static void testLocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String crsCode, String ingestFilePath, String format, int nthreads) throws Exception
Exception
public static void testLocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String crsCode, String ingestFilePath, String format, int nthreads, boolean supportTimeRange) throws Exception
Exception
public static void testS3LocalIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String s3Url, String ingestFilePath, String format, int nthreads) throws Exception
Exception
public static void testSparkIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String format) throws Exception
Exception
public static void testSparkIngest(DataStorePluginOptions dataStore, TestUtils.DimensionalityType dimensionalityType, String s3Url, String ingestFilePath, String format) throws Exception
Exception
public static long hashCentroid(org.locationtech.jts.geom.Geometry geometry)
public static TestUtils.ExpectedResults getExpectedResults(CloseableIterator<?> results) throws IOException
IOException
public static TestUtils.ExpectedResults getExpectedResults(URL[] expectedResultsResources) throws IOException
IOException
public static org.opengis.referencing.operation.MathTransform transformFromCrs(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public static TestUtils.ExpectedResults getExpectedResults(URL[] expectedResultsResources, org.opengis.referencing.crs.CoordinateReferenceSystem crs) throws IOException
IOException
public static QueryConstraints resourceToQuery(URL filterResource) throws IOException
IOException
public static QueryConstraints resourceToQuery(URL filterResource, org.apache.commons.lang3.tuple.Pair<String,String> optimalCqlQueryGeometryAndTimeFields, boolean useDuring) throws IOException
IOException
public static org.opengis.feature.simple.SimpleFeature resourceToFeature(URL filterResource) throws IOException
IOException
public static QueryConstraints featureToQuery(org.opengis.feature.simple.SimpleFeature savedFilter, org.apache.commons.lang3.tuple.Pair<String,String> optimalCqlQueryGeometryAndTimeField, String crsCode, boolean useDuring)
protected static void replaceParameters(Map<String,String> values, File file) throws IOException
IOException
public static void printStartOfTest(org.slf4j.Logger logger, String testName)
testName
- Name of the test that we are starting.public static void printEndOfTest(org.slf4j.Logger logger, String testName, long startMillis)
testName
- Name of the test that we are starting.startMillis
- The time (millis) that the test started.public static void testTileAgainstReference(BufferedImage actual, BufferedImage expected, double minPctError, double maxPctError)
actual
- sampleexpected
- referenceminPctError
- used for testing subsampling - to ensure we are properly subsampling we want
there to be some error if subsampling is aggressive (10 pixels)maxPctError
- used for testing subsampling - we want to ensure at most we are off by this
percentilepublic static double getTileValue(int x, int y, int b, int tileSize)
public static void fillTestRasters(WritableRaster raster1, WritableRaster raster2, int tileSize)
public static double getTileValue(int x, int y, int b, int r, int tileSize)
@Deprecated public static void assert200(String msg, int responseCode)
@Deprecated public static void assert400(String msg, int responseCode)
@Deprecated public static void assert404(String msg, int responseCode)
public static void assertStatusCode(String msg, int expectedCode, javax.ws.rs.core.Response response)
msg
- String message to include in the assertion message.expectedCode
- Integer HTTP Status code to expect from the response.response
- The Response object on which .getStatus() will be performed.public static void assertStatusCode(int expectedCode, javax.ws.rs.core.Response response)
expectedCode
- Integer HTTP Status code to expect from the response.response
- The Response object on which .getStatus() will be performed.public static StoreTestEnvironment getTestEnvironment(String type)
Copyright © 2013–2022. All rights reserved.