public void testToString() {
log.setMethod("testToString()");
String str;
AttributeModificationException ex = new AttributeModificationException(
"sample message");
str = ex.toString();
assertTrue(str.indexOf("sample message") >= 0);
assertFalse(str.indexOf("sample id") >= 0);
assertFalse(str.indexOf("sample value") >= 0);
ModificationItem items[] = new ModificationItem[] { new ModificationItem(
DirContext.ADD_ATTRIBUTE, new BasicAttribute("sample id",
"sample value")), };
ex.setUnexecutedModifications(items);
str = ex.toString();
assertTrue(str.indexOf("sample message") >= 0);
assertTrue(str.indexOf("sample id") >= 0);
assertTrue(str.indexOf("sample value") >= 0);
}