Package org.glassfish.tests.utils
Class NucleusTestUtils
- java.lang.Object
-
- org.glassfish.tests.utils.NucleusTestUtils
-
public class NucleusTestUtils extends Object
- Author:
- Tom Mueller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NucleusTestUtils.NadminReturn
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_TIMEOUT_MSEC
protected static File
nucleusRoot
-
Constructor Summary
Constructors Modifier Constructor Description protected
NucleusTestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NucleusTestUtils.NadminReturn
cmdDetachWithOutput(File cmd, int timeout, String... args)
static NucleusTestUtils.NadminReturn
cmdWithOutput(File cmd, int timeout, String... args)
static File
getNucleusRoot()
static String
getURL(String urlstr)
This methods opens a connection to the given URL and returns the string that is returned from that URL.protected static boolean
isWindows()
static boolean
matchString(String a, String b)
Returns true if String b contains String a.static boolean
nadmin(int timeout, String... args)
Runs the command with the args givenstatic boolean
nadmin(String... args)
static NucleusTestUtils.NadminReturn
nadminDetachWithOutput(String... args)
static NucleusTestUtils.NadminReturn
nadminWithOutput(int timeout, String... args)
static NucleusTestUtils.NadminReturn
nadminWithOutput(String... args)
Runs the command with the args given Returns the precious output strings for further processing.static void
putEnv(String name, String value)
-
-
-
Field Detail
-
DEFAULT_TIMEOUT_MSEC
protected static final int DEFAULT_TIMEOUT_MSEC
- See Also:
- Constant Field Values
-
nucleusRoot
protected static final File nucleusRoot
-
-
Method Detail
-
getNucleusRoot
public static File getNucleusRoot()
-
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
-
nadminWithOutput
public static NucleusTestUtils.NadminReturn nadminWithOutput(int timeout, String... args)
-
nadminDetachWithOutput
public static NucleusTestUtils.NadminReturn nadminDetachWithOutput(String... args)
-
cmdWithOutput
public static NucleusTestUtils.NadminReturn cmdWithOutput(File cmd, int timeout, String... args)
-
cmdDetachWithOutput
public static NucleusTestUtils.NadminReturn cmdDetachWithOutput(File cmd, int timeout, String... args)
-
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 bb
- 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
-
-