Methods Summary |
---|
private void | runFailTest(java.lang.String value)Run a failure test. value should be invalid.
NMToken oToken = null;
try {
oToken = new NMToken(value);
}
catch (Exception e) { // catch the validation exception
}
assertNull(
"NMToken validation restriction failed. did not restrict bad value [" +
value + "] did not restrict bad value", oToken);
|
private void | runPassTest(java.lang.String value)Run a successful test. value should be valid.
NMToken oToken = null;
try {
oToken = new NMToken(value);
}
catch (Exception e) { // catch the validation exception
}
assertEquals("NMToken strings not equal. orig value:" + value, oToken.toString(), value);
|
public void | testDoubleSpace()this is to differentiate from normalized string which cannot accept double spaces.
runFailTest("a B"); // note: \r fails
|
public void | testLineFeed()this is to differentiate from normalized string which cannot accept a \n
runFailTest("line one\n line two");
|
public void | testPunctuationString()Test a simple string.
runPassTest("Atlanta.-_:");
|
public void | testSimpleString()Test a simple string.
runPassTest("Atlanta1234567890");
|
public void | testStringWithLeadingAndTrailingSpaces()this is to differentiate from normalized string which cannot accept
leading and trailing spaces.
runFailTest(" centered ");
|
public void | testStringWithLeadingSpaces()this is to differentiate from normalized string which cannot accept leading spaces.
runFailTest(" a failure case");
|
public void | testStringWithTabs()this is to differentiate from normalized string which cannot accept a \t
runFailTest("this has \t a tab");
|
public void | testStringWithTrailingSpaces()this is to differentiate from normalized string which cannot accept trailing spaces.
runFailTest("this is a ");
|