Package ucar.unidata.util.test
Class TestDir
- java.lang.Object
-
- ucar.unidata.util.test.TestDir
-
public class TestDir extends Object
Manage the test data directories and servers.- Since:
- 3/23/12
-D Property Names Static Variable Property Name(s) Description testdataDirPropName unidata.testdata.path Property name for the path to the Unidata test data directory, e.g unidata.testdata.path=/share/testdata Computed Paths Static Variable Property Name(s) (-d) Default Value Description cdmUnitTestDir NA NA New test data directory. Do not put temporary files in here. Migrate all test data here eventually. cdmLocalTestDataDir NA ../cdm/src/test/data Level 1 test data directory (distributed with code and MAY be used in Unidata nightly testing).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TestDir.Act
static class
TestDir.FileFilterFromSuffixes
-
Field Summary
Fields Modifier and Type Field Description static String
cdmLocalFromTestDataDir
The cdm-core local test directory, from cdm-test submodule.static String
cdmLocalTestDataDir
The cdm-core local test directory, from any cdm submodule.static String
cdmTestDataDir
cdm-test data directory (distributed with code but depends on data not in github)static String
cdmUnitTestDir
New test data directory.static String
localTestDataDir
The module local test directory.static String
testdataDir
Path to the Unidata test data directory.
-
Constructor Summary
Constructors Constructor Description TestDir()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
actOnAll(String dirName, FileFilter ff, TestDir.Act act)
Call act.doAct() on each file in dirName that passes the file filter, recurse into subdirs.static int
actOnAll(String dirName, FileFilter ff, TestDir.Act act, boolean recurse)
Call act.doAct() on each file in dirName passing the file filterstatic int
actOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames)
Make list of filenames that pass the file filter, recurse true.static int
actOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames, boolean recurse)
Make list of filenames that pass the file filter, recurse set by user.static long
checkLeaks()
static FileFilter
FileFilterSkipSuffix(String suffixes)
static NetcdfFile
open(String filename)
static NetcdfFile
openFileLocal(String filename)
static void
readAll(String filename)
static int
readAllData(NetcdfFile ncfile)
-
-
-
Field Detail
-
testdataDir
public static String testdataDir
Path to the Unidata test data directory.
-
cdmUnitTestDir
public static String cdmUnitTestDir
New test data directory. do not put temporary files in here. migrate all test data here eventually Unidata "//fileserver/data/testdata2/cdmUnitTest" directory.
-
cdmLocalTestDataDir
public static String cdmLocalTestDataDir
The cdm-core local test directory, from any cdm submodule.
-
localTestDataDir
public static String localTestDataDir
The module local test directory. Assumes pwd = top of module.
-
cdmLocalFromTestDataDir
public static String cdmLocalFromTestDataDir
The cdm-core local test directory, from cdm-test submodule.
-
cdmTestDataDir
public static String cdmTestDataDir
cdm-test data directory (distributed with code but depends on data not in github)
-
-
Method Detail
-
open
public static NetcdfFile open(String filename) throws IOException
- Throws:
IOException
-
openFileLocal
public static NetcdfFile openFileLocal(String filename) throws IOException
- Throws:
IOException
-
checkLeaks
public static long checkLeaks()
-
FileFilterSkipSuffix
public static FileFilter FileFilterSkipSuffix(String suffixes)
-
actOnAll
public static int actOnAll(String dirName, FileFilter ff, TestDir.Act act) throws IOException
Call act.doAct() on each file in dirName that passes the file filter, recurse into subdirs.- Throws:
IOException
-
actOnAll
public static int actOnAll(String dirName, FileFilter ff, TestDir.Act act, boolean recurse) throws IOException
Call act.doAct() on each file in dirName passing the file filter- Parameters:
dirName
- recurse into this directoryff
- for files that pass this filter, may be nullact
- perform this acctionrecurse
- recurse into subdirectories- Returns:
- count
- Throws:
IOException
- on IO error
-
actOnAllParameterized
public static int actOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames) throws IOException
Make list of filenames that pass the file filter, recurse true.- Throws:
IOException
-
actOnAllParameterized
public static int actOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames, boolean recurse) throws IOException
Make list of filenames that pass the file filter, recurse set by user.- Throws:
IOException
-
readAll
public static void readAll(String filename) throws IOException
- Throws:
IOException
-
readAllData
public static int readAllData(NetcdfFile ncfile) throws IOException
- Throws:
IOException
-
-