public abstract class UnitTestCommon
extends java.lang.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 java.lang.String |
DRIVELETTERS |
protected static org.slf4j.Logger |
log |
static boolean |
LOGSTDIO |
protected java.lang.String |
name |
protected static int[] |
OKCODES |
protected static java.lang.String |
threddsroot |
protected java.lang.String |
title |
static java.nio.charset.Charset |
UTF8 |
Constructor and Description |
---|
UnitTestCommon() |
UnitTestCommon(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
bindstd() |
static java.lang.String |
canonicalpath(java.lang.String path)
Convert path to:
1.
|
static java.lang.String |
canonjoin(java.lang.String... pieces) |
static java.lang.String |
canonjoin2(java.lang.String prefix,
java.lang.String suffix) |
protected static boolean |
check(int code) |
protected static boolean |
check(int code,
int[] ok) |
protected boolean |
checkServer(java.lang.String candidate) |
static void |
clearDir(java.io.File dir,
boolean clearsubdirs) |
static java.lang.String |
compare(java.lang.String tag,
java.lang.String baseline,
java.lang.String testresult) |
static java.lang.String |
extractDatasetname(java.lang.String urlorpath,
java.lang.String suffix) |
java.lang.String |
getName() |
java.lang.String |
getResourceDir() |
java.lang.String |
getThreddsroot() |
java.lang.String |
getTitle() |
static boolean |
hasDriveLetter(java.lang.String path)
return true if this path appears to start with a windows drive letter
|
protected static java.lang.String |
ncdumpdata(NetcdfFile ncfile,
java.lang.String datasetname) |
protected static java.lang.String |
ncdumpmetadata(NetcdfFile ncfile,
java.lang.String datasetname) |
static NetcdfDataset |
openDataset(java.lang.String url) |
static java.lang.String[] |
propertiesToArgs(java.lang.String prefix,
java.lang.String... options) |
static byte[] |
readbinaryfile(java.io.InputStream stream) |
static byte[] |
readbinaryfile(java.lang.String filename) |
static java.lang.String |
readfile(java.lang.String filename) |
protected static java.lang.String |
rebuildpath(java.lang.String[] pieces,
int last) |
static boolean |
same(java.lang.String tag,
java.lang.String baseline,
java.lang.String testresult) |
void |
setTitle(java.lang.String title) |
static java.lang.String |
shortenFileName(java.lang.String text,
java.lang.String filename) |
static boolean |
similar(java.lang.String tag,
java.lang.String baseline,
java.lang.String testresult,
UnitTestCommon.Modifier mbaseline,
UnitTestCommon.Modifier mtest) |
static void |
tag(java.lang.String t) |
protected void |
unbindstd() |
void |
visual(java.lang.String header,
java.lang.String captured) |
void |
visual(java.lang.String header,
java.lang.String captured,
char marker) |
static void |
writefile(java.lang.String path,
byte[] content) |
static void |
writefile(java.lang.String path,
java.lang.String content) |
public static boolean LOGSTDIO
public static final boolean DEBUG
public static final java.nio.charset.Charset UTF8
protected static final int[] OKCODES
protected static final org.slf4j.Logger log
protected static java.lang.String threddsroot
protected java.lang.String title
protected java.lang.String name
public static final java.lang.String DRIVELETTERS
public UnitTestCommon()
public UnitTestCommon(java.lang.String name)
protected static java.lang.String rebuildpath(java.lang.String[] pieces, int last)
public static void clearDir(java.io.File dir, boolean clearsubdirs)
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public java.lang.String getThreddsroot()
public java.lang.String getName()
public java.lang.String getResourceDir()
public void visual(java.lang.String header, java.lang.String captured)
public void visual(java.lang.String header, java.lang.String captured, char marker)
public static java.lang.String compare(java.lang.String tag, java.lang.String baseline, java.lang.String testresult)
public static boolean same(java.lang.String tag, java.lang.String baseline, java.lang.String testresult)
public static boolean similar(java.lang.String tag, java.lang.String baseline, java.lang.String testresult, UnitTestCommon.Modifier mbaseline, UnitTestCommon.Modifier mtest)
protected boolean checkServer(java.lang.String candidate)
protected void bindstd()
protected void unbindstd()
public static void writefile(java.lang.String path, java.lang.String content) throws java.io.IOException
java.io.IOException
public static void writefile(java.lang.String path, byte[] content) throws java.io.IOException
java.io.IOException
public static java.lang.String readfile(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static byte[] readbinaryfile(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static byte[] readbinaryfile(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public static NetcdfDataset openDataset(java.lang.String url) throws java.io.IOException
java.io.IOException
public static java.lang.String shortenFileName(java.lang.String text, java.lang.String filename)
public static void tag(java.lang.String t)
public static java.lang.String canonjoin2(java.lang.String prefix, java.lang.String suffix)
public static java.lang.String canonjoin(java.lang.String... pieces)
public static java.lang.String canonicalpath(java.lang.String path)
path
- convert this pathpublic static boolean hasDriveLetter(java.lang.String path)
path
- public static java.lang.String extractDatasetname(java.lang.String urlorpath, java.lang.String suffix)
protected static java.lang.String ncdumpmetadata(NetcdfFile ncfile, java.lang.String datasetname) throws java.lang.Exception
java.lang.Exception
protected static java.lang.String ncdumpdata(NetcdfFile ncfile, java.lang.String datasetname) throws java.lang.Exception
java.lang.Exception
public static java.lang.String[] propertiesToArgs(java.lang.String prefix, java.lang.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)