Class UnitTestCommon


  • public abstract class UnitTestCommon
    extends Object
    • Field Detail

      • LOGSTDIO

        public static boolean LOGSTDIO
      • UTF8

        public static final Charset UTF8
      • OKCODES

        protected static final int[] OKCODES
      • log

        protected static final org.slf4j.Logger log
      • threddsroot

        protected static String threddsroot
      • title

        protected String title
      • DRIVELETTERS

        public static final String DRIVELETTERS
    • Constructor Detail

      • UnitTestCommon

        public UnitTestCommon()
      • UnitTestCommon

        public UnitTestCommon​(String name)
    • Method Detail

      • rebuildpath

        protected static String rebuildpath​(String[] pieces,
                                            int last)
      • clearDir

        public static void clearDir​(File dir,
                                    boolean clearsubdirs)
      • setTitle

        public void setTitle​(String title)
      • getTitle

        public String getTitle()
      • getThreddsroot

        public String getThreddsroot()
      • getName

        public String getName()
      • getResourceDir

        public String getResourceDir()
      • visual

        public void visual​(String header,
                           String captured)
      • visual

        public void visual​(String header,
                           String captured,
                           char marker)
      • checkServer

        protected boolean checkServer​(String candidate)
      • bindstd

        protected void bindstd()
      • unbindstd

        protected void unbindstd()
      • shortenFileName

        public static String shortenFileName​(String text,
                                             String filename)
      • tag

        public static void tag​(String t)
      • canonjoin

        public static String canonjoin​(String... pieces)
      • canonicalpath

        public static String canonicalpath​(String path)
        Convert path to: 1. use '/' consistently 2. remove any trailing '/' 3. trim blanks
        Parameters:
        path - convert this path
        Returns:
        canonicalized version
      • hasDriveLetter

        public static boolean hasDriveLetter​(String path)
        return true if this path appears to start with a windows drive letter
        Parameters:
        path -
        Returns:
        true, if path has drive letter
      • extractDatasetname

        public static String extractDatasetname​(String urlorpath,
                                                String suffix)
      • propertiesToArgs

        public static String[] propertiesToArgs​(String prefix,
                                                String... options)
        Parameters:
        prefix - - string to prefix all command line options: typically "--"
        options - - list of option names of interest
        Returns:
        specified properties converted to command line form
      • check

        protected static boolean check​(int code)
      • check

        protected static boolean check​(int code,
                                       int[] ok)