public abstract class UnitTestCommon extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UnitTestCommon.ModDelete
Instance of Modifier specialized to delete lines matching
a given Java regular expression
of text before is is passed to compare().
|
static interface |
UnitTestCommon.Modifier
Provide an interface that allows for arbitrary modification
of text before is is passed to compare().
|
static class |
UnitTestCommon.ModSuppress
Instance of Modifier specialized to delete named attributes.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
static String |
DRIVELETTERS |
protected static org.slf4j.Logger |
log |
static boolean |
LOGSTDIO |
protected String |
name |
protected static int[] |
OKCODES |
protected boolean |
prop_ascii |
protected boolean |
prop_baseline |
protected String |
prop_controls |
protected boolean |
prop_debug |
protected boolean |
prop_diff |
protected boolean |
prop_display |
protected boolean |
prop_generate |
protected boolean |
prop_visual |
protected static String |
threddsroot |
protected static String |
threddsServer |
protected String |
title |
static Charset |
UTF8 |
| Constructor and Description |
|---|
UnitTestCommon() |
UnitTestCommon(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindstd() |
static String |
canonicalpath(String path)
Convert path to:
1.
|
static String |
canonjoin(String... pieces) |
static String |
canonjoin2(String prefix,
String suffix) |
protected static boolean |
check(int code) |
protected static boolean |
check(int code,
int[] ok) |
protected boolean |
checkServer(String candidate) |
static void |
clearDir(File dir,
boolean clearsubdirs) |
static String |
compare(String tag,
String baseline,
String testresult) |
static String |
extractDatasetname(String urlorpath,
String suffix) |
String |
getName() |
String |
getResourceDir() |
String |
getThreddsroot() |
String |
getTitle() |
static boolean |
hasDriveLetter(String path)
return true if this path appears to start with a windows drive letter
|
protected static String |
ncdumpdata(ucar.nc2.NetcdfFile ncfile,
String datasetname) |
protected static String |
ncdumpmetadata(ucar.nc2.NetcdfFile ncfile,
String datasetname) |
static ucar.nc2.dataset.NetcdfDataset |
openDataset(String url) |
static String[] |
propertiesToArgs(String prefix,
String... options) |
static byte[] |
readbinaryfile(InputStream stream) |
static byte[] |
readbinaryfile(String filename) |
static String |
readfile(String filename) |
protected static String |
rebuildpath(String[] pieces,
int last) |
static boolean |
same(String tag,
String baseline,
String testresult) |
protected void |
setSystemProperties()
Try to get the system properties
|
void |
setTitle(String title) |
static String |
shortenFileName(String text,
String filename) |
static boolean |
similar(String tag,
String baseline,
String testresult,
UnitTestCommon.Modifier mbaseline,
UnitTestCommon.Modifier mtest) |
static void |
tag(String t) |
protected void |
unbindstd() |
void |
visual(String header,
String captured) |
void |
visual(String header,
String captured,
char marker) |
static void |
writefile(String path,
byte[] content) |
static void |
writefile(String path,
String content) |
public static boolean LOGSTDIO
public static final boolean DEBUG
public static final Charset UTF8
protected static final int[] OKCODES
protected static final org.slf4j.Logger log
protected static String threddsroot
protected static String threddsServer
protected boolean prop_ascii
protected boolean prop_diff
protected boolean prop_baseline
protected boolean prop_visual
protected boolean prop_debug
protected boolean prop_generate
protected String prop_controls
protected boolean prop_display
protected String title
protected String name
public static final String DRIVELETTERS
public UnitTestCommon()
public UnitTestCommon(String name)
public static void clearDir(File dir, boolean clearsubdirs)
protected void setSystemProperties()
public void setTitle(String title)
public String getTitle()
public String getThreddsroot()
public String getName()
public String getResourceDir()
public static boolean similar(String tag, String baseline, String testresult, UnitTestCommon.Modifier mbaseline, UnitTestCommon.Modifier mtest)
protected boolean checkServer(String candidate)
protected void bindstd()
protected void unbindstd()
public static void writefile(String path, String content) throws IOException
IOExceptionpublic static void writefile(String path, byte[] content) throws IOException
IOExceptionpublic static String readfile(String filename) throws IOException
IOExceptionpublic static byte[] readbinaryfile(String filename) throws IOException
IOExceptionpublic static byte[] readbinaryfile(InputStream stream) throws IOException
IOExceptionpublic static ucar.nc2.dataset.NetcdfDataset openDataset(String url) throws IOException
IOExceptionpublic static void tag(String t)
public static String canonicalpath(String path)
path - convert this pathpublic static boolean hasDriveLetter(String path)
path - protected static String ncdumpmetadata(ucar.nc2.NetcdfFile ncfile, String datasetname) throws Exception
Exceptionprotected static String ncdumpdata(ucar.nc2.NetcdfFile ncfile, String datasetname) throws Exception
Exceptionpublic static String[] propertiesToArgs(String prefix, String... options)
prefix - - string to prefix all command line options: typically "--"options - - list of option names of interestprotected static boolean check(int code)
protected static boolean check(int code,
int[] ok)