public class Capability1Tests extends CommonFixture
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
Capability1Tests.validateFile
This interface is used to connect the directory iterator to validation
lambda functions.
|
path, ROOT_PKG_PATH, SAMPLE_CDB_PATH| Constructor and Description |
|---|
Capability1Tests() |
| Modifier and Type | Method and Description |
|---|---|
protected ArrayList<Path> |
getDatasetPaths(String cdbRoot,
String datasetName)
Scan the "Tiles" directory in the given CDB path for all Datasets with a
matching name, returning a list of their paths.
|
protected void |
iterateDatasets(ArrayList<Path> datasets,
Capability1Tests.validateFile lambda)
Combine looping of the array of dataset paths with lambda file
evaluation.
|
protected void |
iterateEntries(Path baseDirectory,
int depth,
Capability1Tests.validateFile lambda)
Run a lambda function against all files a certain depth below a given
directory.
|
void |
obtainTestSubject(org.testng.ITestContext testContext)
Obtains the test subject from the ISuite context.
|
protected Integer |
parseLOD(String lod)
Parse a positive/negative integer from a String containing an LOD.
|
protected void |
validateComponentSelector1(String cs1,
String dataset,
ArrayList<String> errors)
Validate a first-level Component Selector based on a given Dataset.
|
protected void |
validateComponentSelector2(String cs2,
String cs1,
String dataset,
ArrayList<String> errors)
Validate a second-level Component Selector based on the first-level
Component Selector and Dataset.
|
protected void |
validateComponentSelectorFormat(String cs,
Integer index,
String filename,
ArrayList<String> errors)
Validate that a Component Selector is a valid format
|
protected void |
validateDISCategory(Path file,
ArrayList<String> errors)
Validate that a DIS Category directory is a valid format
|
protected void |
validateDISCountry(Path file,
ArrayList<String> errors)
Validate that a DIS Country directory is a valid format
|
protected void |
validateDISDomain(Path file,
ArrayList<String> errors)
Validate that a DIS Domain directory is a valid format
|
protected void |
validateDISEntity(Path file,
ArrayList<String> errors)
Validate that a DIS Entity directory is a valid format
|
protected void |
validateDISEntityKind(Path file,
ArrayList<String> errors)
Validate that a DIS Entity Kind directory is a valid format
|
protected void |
validateFeatureCode(String featureCode,
Path file,
ArrayList<String> errors)
Validate that the Feature Code is a valid format
|
protected void |
validateFeatureSubCode(String featureSubCode,
Path file,
ArrayList<String> errors)
Validate that the Feature Sub Code is a valid format
|
protected void |
validateLatitude(String latitude,
ArrayList<String> errors)
Validate a latitude code as being a valid latitude.
|
protected void |
validateLOD(Path file,
ArrayList<String> errors)
Deprecated.
Use
validateLod instead, with the filename |
protected void |
validateLod(String lod,
ArrayList<String> errors)
Validate a level-of-detail code.
|
protected void |
validateLongitude(String longitude,
ArrayList<String> errors)
Validate a longitude code as being a valid longitude.
|
protected void |
validateModelName(String modelName,
Path file,
ArrayList<String> errors)
Validate that the Model Name substring is a valid format
|
protected void |
validateRref(Integer rref,
Integer lod,
ArrayList<String> errors)
Validates a RREF value is valid for an LOD.
|
protected void |
validateTextureNameCode(String textureName,
Path file,
ArrayList<String> errors)
Validate that the texture name component of a filename matches the name
of the parent directory for that file.
|
protected void |
validateUref(Integer uref,
Integer lod,
ArrayList<String> errors)
Validate that a UREF value is valid for a given LOD.
|
public void obtainTestSubject(org.testng.ITestContext testContext)
SuiteAttribute.TEST_SUBJECT should
evaluate to a DOM Document node.obtainTestSubject in class CommonFixturetestContext - The test (group) context.protected ArrayList<Path> getDatasetPaths(String cdbRoot, String datasetName) throws IOException
cdbRoot - String of path to root of CDBdatasetName - String of directories to match and returnArrayList<Path>IOException - Error reading from base directoryprotected void iterateDatasets(ArrayList<Path> datasets, Capability1Tests.validateFile lambda) throws IOException
datasets - Array of datasets to evaluatelambda - Lambda used to validate individual files; lambda will
receive one argument, a Path to the file to be
tested.IOException - Error reading from CDBprotected void iterateEntries(Path baseDirectory, int depth, Capability1Tests.validateFile lambda) throws IOException
baseDirectory - Path to directory into which to "walk"depth - How many levels of subdirectories to recurse before
running lambdas against file entrieslambda - Lambda function to run against files at target
depthIOException - Error reading from base directoryprotected Integer parseLOD(String lod)
lod - String value of LOD from directory or filenameprotected void validateComponentSelector1(String cs1, String dataset, ArrayList<String> errors)
cs1 - String of Component Selector with leading zerosdataset - String of Dataset ID with leading zeroserrors - ArrayList (String) of errors, will be modified in-placeprotected void validateComponentSelector2(String cs2, String cs1, String dataset, ArrayList<String> errors)
cs2 - String of Component Selector 2 with leading zeroscs1 - String of Component Selector 1 with leading zerosdataset - String of Dataset ID with leading zeroserrors - ArrayList (String) of errors, will be modified in-placeprotected void validateComponentSelectorFormat(String cs, Integer index, String filename, ArrayList<String> errors)
cs - The Component Selector substringindex - Integer for "1" (CS1) or "2" (CS2)filename - The filename being tested, used for errorserrors - ArrayList (String) of errors, will be modified in-placeprotected void validateDISCategory(Path file, ArrayList<String> errors)
file - The Path to the DIS Country directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateDISCountry(Path file, ArrayList<String> errors)
file - The Path to the DIS Country directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateDISDomain(Path file, ArrayList<String> errors)
file - The Path to the DIS Domain directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateDISEntityKind(Path file, ArrayList<String> errors)
file - The Path to the DIS Entity Kind directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateDISEntity(Path file, ArrayList<String> errors)
file - The Path to the DIS Entity directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateFeatureCode(String featureCode, Path file, ArrayList<String> errors)
featureCode - The Feature Code substringfile - The Path to the file being tested, used for errorserrors - ArrayList (String) of errors, will be modified
in-placeprotected void validateFeatureSubCode(String featureSubCode, Path file, ArrayList<String> errors)
featureSubCode - The Feature Sub Code substringfile - The path to the file being tested, used for errorserrors - ArrayList (String) of errors, will be modified
in-placeprotected void validateLatitude(String latitude, ArrayList<String> errors)
latitude - String value of latitude, including prefix character
(e.g. "S15")errors - ArrayList (String) of errors, will be modified in-placeprotected void validateLOD(Path file, ArrayList<String> errors)
validateLod instead, with the filenamefile - The Path to the LOD directoryerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateLod(String lod, ArrayList<String> errors)
lod - String of level-of-detail codeerrors - ArrayList (String) of errors, will be modified in-placeprotected void validateLongitude(String longitude, ArrayList<String> errors)
longitude - String value of longitude, including prefix character
(e.g. "E100")errors - ArrayList (String) of errors, will be modified in-placeprotected void validateModelName(String modelName, Path file, ArrayList<String> errors)
modelName - The Model Name substringfile - The path to the file being testederrors - ArrayList (String) of errors, will be modified in-placeprotected void validateRref(Integer rref, Integer lod, ArrayList<String> errors)
rref - Integer of RREF valuelod - Integer of level of detail (LOD), expecting -10 to 23errors - ArrayList (String) of errors, will be modified in-placeprotected void validateTextureNameCode(String textureName, Path file, ArrayList<String> errors)
textureName - The texture name code substring of the file namefile - The Path to the file being tested, used for errorserrors - ArrayList (String) of errors, will be modified
in-placeprotected void validateUref(Integer uref, Integer lod, ArrayList<String> errors)
uref - Integer of UREF valuelod - Integer of level of detail (LOD), expecting -10 to 23errors - ArrayList (String) of errors, will be modified in-placeCopyright © 2023 Open Geospatial Consortium. All rights reserved.