Class NucleusTestUtils


  • public class NucleusTestUtils
    extends Object
    Author:
    Tom Mueller
    • Field Detail

      • nucleusRoot

        protected static final File nucleusRoot
    • Constructor Detail

      • NucleusTestUtils

        protected NucleusTestUtils()
    • Method Detail

      • getNucleusRoot

        public static File getNucleusRoot()
      • putEnv

        public static void putEnv​(String name,
                                  String value)
      • nadmin

        public static boolean nadmin​(int timeout,
                                     String... args)
        Runs the command with the args given
        Parameters:
        args -
        Returns:
        true if successful
      • nadmin

        public static boolean nadmin​(String... args)
      • nadminWithOutput

        public static NucleusTestUtils.NadminReturn nadminWithOutput​(String... args)
        Runs the command with the args given Returns the precious output strings for further processing.
        Parameters:
        args -
        Returns:
        true if successful
      • isWindows

        protected static boolean isWindows()
      • matchString

        public static boolean matchString​(String a,
                                          String b)
        Returns true if String b contains String a. Returns true if both strings are null. Returns false if only one of the strings is null.
        Parameters:
        a - The possibly null string that must be contained in b
        b - The possibly null string that must contain a
        Returns:
        true if b contains a
      • getURL

        public static String getURL​(String urlstr)
        This methods opens a connection to the given URL and returns the string that is returned from that URL. This is useful for simple servlet retrieval
        Parameters:
        urlstr - The URL to connect to
        Returns:
        The string returned from that URL, or empty string if there was a problem contacting the URL