public class Utilities
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NL
The newline character(s).
|
Modifier | Constructor and Description |
---|---|
private |
Utilities() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
convertToHexString(byte[] buf)
Convert a byte array to a hex string suitable for insert.
|
static java.lang.String |
formatTestClassNames(java.lang.String test)
Function to eliminate known package prefixes given a class full path
|
static java.io.BufferedReader |
getSysinfoFromServer()
Calls the public method
getSysInfo of the Network
Server instance associated with the current test configuration and
returns the result as a BufferedReader, making it easy to analyse the
output line by line. |
static java.io.BufferedReader |
getSysinfoLocally()
Calls the public method
getInfo of the sysinfo tool within
this JVM and returns a BufferedReader for reading its
output. |
static java.lang.String |
repeatChar(java.lang.String c,
int repeatCount)
Creates a string with the specified length.
|
static void |
showResultSet(java.sql.ResultSet rs)
Print out resultSet in two dimensional array format, for use by
JDBC.assertFullResultSet(rs,expectedRows) expectedRows argument.
|
static void |
sleep(long millis)
Sleeps the specified number of milliseconds.
|
static java.lang.String[] |
split(java.lang.String str,
char delim)
Splits a string around matches of the given delimiter character.
|
static java.lang.String |
stringToHexLiteral(java.lang.String s)
Converts a string to a hex literal to assist in converting test
cases that used to insert strings into bit data tables.
|
public static java.lang.String stringToHexLiteral(java.lang.String s)
Converts using UTF-16BE just like the old casts used to.
s
- string to convertprivate static java.lang.String convertToHexString(byte[] buf)
buf
- byte array to convertpublic static java.lang.String repeatChar(java.lang.String c, int repeatCount)
Called from various tests to test edge cases and such.
c
- character to repeatrepeatCount
- Number of times to repeat characterpublic static void showResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- result set to printjava.sql.SQLException
- if accessing the result set failspublic static java.io.BufferedReader getSysinfoLocally()
getInfo
of the sysinfo tool within
this JVM and returns a BufferedReader
for reading its
output. This is useful for obtaining system information that could be
used to verify, for example, values returned by Derby MBeans.sysinfo.getInfo(java.io.PrintWriter out)
public static java.io.BufferedReader getSysinfoFromServer() throws java.lang.Exception
Calls the public method getSysInfo
of the Network
Server instance associated with the current test configuration and
returns the result as a BufferedReader, making it easy to analyse the
output line by line.
This is useful for obtaining system information that could be used to verify, for example, values returned by Derby MBeans.
java.lang.Exception
NetworkServerControl.getSysinfo()
public static java.lang.String[] split(java.lang.String str, char delim)
String.split(String regex)
, which is not available
on a JSR169/Java ME platform.str
- the string to be splitdelim
- the delimiterjava.lang.NullPointerException
- if str is nullpublic static void sleep(long millis)
millis
- sleep durationpublic static java.lang.String formatTestClassNames(java.lang.String test)
test
- class name prefixed with packageApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.