* This tests illegal separator renderer construction
*/
public void testRenderIllegal() throws Exception {
// Test null character string
try {
SeparatorRenderer renderer =
new DefaultCharacterMenuItemGroupSeparatorRenderer(null,
1);
fail("Construction of renderer should have been illegal (1)");
} catch (IllegalArgumentException iae) {
// Test was successfully if got here as the exception was thrown ;-)
}
// Test empty character string
try {
SeparatorRenderer renderer =
new DefaultCharacterMenuItemGroupSeparatorRenderer("",
1);
fail("Construction of renderer should have been illegal (1)");
} catch (IllegalArgumentException iae) {
// Test was successfully if got here as the exception was thrown ;-)
}
// Test negative repeats
try {
SeparatorRenderer renderer =
new DefaultCharacterMenuItemGroupSeparatorRenderer("*",
-1);
fail("Construction of renderer should have been illegal (2)");
} catch (IllegalArgumentException iae) {
// Test was successfully if got here as the exception was thrown ;-)
}
// Test zero repeats
try {
SeparatorRenderer renderer =
new DefaultCharacterMenuItemGroupSeparatorRenderer("*",
0);
fail("Construction of renderer should have been illegal (3)");
} catch (IllegalArgumentException iae) {
// Test was successfully if got here as the exception was thrown ;-)