|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.util.TestUtil
public abstract class TestUtil
Static utilities for JUnit tests.
Field Summary | |
---|---|
private static String |
lineBreak
|
private static String |
lineBreak2
|
private static String |
lineBreak3
|
private static Pattern |
LineBreakPattern
|
static String |
NL
System-dependent newline character. |
private static Pattern |
TabPattern
|
Constructor Summary | |
---|---|
TestUtil()
|
Method Summary | |
---|---|
static void |
assertEqualsVerbose(String expected,
String actual)
|
static String |
fold(String string)
Converts a string containing newlines (\n) into a string containing os-dependent line endings. |
static String |
fold(String[] strings)
Combines an array of strings, each representing a line, into a single string containing line separators. |
static String |
quoteForJava(String s)
Converts a string (which may contain quotes and newlines) into a java literal. |
static String |
quotePattern(String s)
Quotes a pattern. |
static String |
toJavaString(String s)
Converts a string (which may contain quotes and newlines) into a java literal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Pattern LineBreakPattern
private static final Pattern TabPattern
public static final String NL
PrintWriter.println()
produces '\n' on Unix and '\r\n' on
Windows, but '\n' is always '\n', so your tests will fail on Windows.
private static final String lineBreak
private static final String lineBreak2
private static final String lineBreak3
Constructor Detail |
---|
public TestUtil()
Method Detail |
---|
public static void assertEqualsVerbose(String expected, String actual)
public static String quoteForJava(String s)
For example,
becomes string with "quotes" split
across lines
"string with \"quotes\" split" + NL +
"across lines"
public static String toJavaString(String s)
For example,
becomes string with "quotes" split
across lines
TestUtil.fold(
"string with \"quotes\" split\n",
+ "across lines")
public static String fold(String[] strings)
public static String fold(String string)
public static String quotePattern(String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |