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 remoteTestServerPropName remotetest Property name for the hostname of the C-library remote test server. 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-core/src/test/data/ Level 1 test data directory (distributed with code and MAY be used in PR testing on GitHub). remoteTestServer remotetestserver remotetest.unidata.ucar.edu The hostname of the test server for doing C library remote tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTestDir.Actstatic classTestDir.FileFilterFromSuffixes
-
Field Summary
Fields Modifier and Type Field Description static StringcdmLocalTestDataDirThe cdm-core local test data, use from any top level gradle subproject.static StringcdmTestDataDircdm-test data directory (distributed with code but can depend on data not in github (e.g.static StringcdmUnitTestDirUnidata test data for the CDM.static Stringdap2TestServerstatic Stringdap2TestServerPropNamestatic Stringdap4TestServerstatic Stringdap4TestServerPropNamestatic StringremoteTestServer
-
Constructor Summary
Constructors Constructor Description TestDir()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intactOnAll(String dirName, FileFilter ff, TestDir.Act act)Call act.doAct() on each file in dirName that passes the file filter, recurse into subdirs.static intactOnAll(String dirName, FileFilter ff, TestDir.Act act, boolean recurse)Call act.doAct() on each file in dirName passing the file filterstatic intactOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames)Make list of filenames that pass the file filter, recurse true.static intactOnAllParameterized(String dirName, FileFilter ff, Collection<Object[]> filenames, boolean recurse)Make list of filenames that pass the file filter, recurse set by user.static longcheckLeaks()static FileFilterFileFilterSkipSuffix(String suffixes)static StringlocateThreddsRoot()static ucar.nc2.NetcdfFileopen(String filename)static ucar.nc2.NetcdfFileopenFileLocal(String filename)static voidreadAll(String filename)static intreadAllData(ucar.nc2.NetcdfFile ncfile)
-
-
-
Field Detail
-
cdmUnitTestDir
public static String cdmUnitTestDir
Unidata test data for the CDM. testdataDir + CdmUnitTest.
-
cdmLocalTestDataDir
public static String cdmLocalTestDataDir
The cdm-core local test data, use from any top level gradle subproject.
-
cdmTestDataDir
public static String cdmTestDataDir
cdm-test data directory (distributed with code but can depend on data not in github (e.g. NcML files can reference data not in github)
-
remoteTestServer
public static String remoteTestServer
-
dap2TestServerPropName
public static String dap2TestServerPropName
-
dap2TestServer
public static String dap2TestServer
-
dap4TestServerPropName
public static String dap4TestServerPropName
-
dap4TestServer
public static String dap4TestServer
-
-
Method Detail
-
open
public static ucar.nc2.NetcdfFile open(String filename) throws IOException
- Throws:
IOException
-
openFileLocal
public static ucar.nc2.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(ucar.nc2.NetcdfFile ncfile) throws IOException- Throws:
IOException
-
locateThreddsRoot
public static String locateThreddsRoot()
-
-