org.tanukisoftware.wrapper.test
public class TestUtils extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
sleep(long ms)
Sleep for the specified time without any exceptions.
|
static void |
writeTextFile(java.io.File file,
java.lang.String text)
Writes the specified text to a file.
|
static void |
writeTextFile(java.io.File file,
java.lang.String text,
java.lang.String encoding,
boolean append)
Writes the specified text to a file.
|
static void |
writeWrapperCommand(java.lang.String command)
Writes a command to the Wrapper command file.
|
static void |
writeWrapperTestCommand(java.lang.String command)
Writes a test command to the Wrapper command file.
|
public static void sleep(long ms)
ms
- Time to sleep.public static void writeTextFile(java.io.File file, java.lang.String text, java.lang.String encoding, boolean append) throws java.io.IOException
file
- File to be written to.text
- Text to be written to the file. May contain multiple lines.
No additional line feeds will be written out so it is
important to include them if needed.encoding
- Encoding to use when writing the text. Null implies
that the system default will be used.append
- If true and the file already exists then the text will be
appended to the end of the file. If false then a new file
will always be created.java.io.IOException
- If there are any problems writing to the file.public static void writeTextFile(java.io.File file, java.lang.String text) throws java.io.IOException
file
- File to be written to.text
- Text to be written to the file. May contain multiple lines.
No additional line feeds will be written out so it is
important to include them if needed.java.io.IOException
- If there are any problems writing to the file.public static void writeWrapperCommand(java.lang.String command) throws java.io.IOException, java.lang.IllegalStateException
command
- Command to write to the configured Wrapper command file.java.io.IOException
- If there are any problems writing to the file.java.lang.IllegalStateException
- If the wrapper.commandfile property has not
been defined.public static void writeWrapperTestCommand(java.lang.String command) throws java.io.IOException, java.lang.IllegalStateException
command
- Command to write to the configured Wrapper command file.java.io.IOException
- If there are any problems writing to the file.java.lang.IllegalStateException
- If the wrapper.commandfile property has not
been defined or the wrapper.command.enable_tests
property has not been set to true.