public void testXmlAttributeEscaper() throws Exception {
CharEscaper xmlAttributeEscaper = (CharEscaper) XmlEscapers.xmlAttributeEscaper();
assertBasicXmlEscaper(xmlAttributeEscaper, true, true);
// Test quotes are escaped.
assertEquals(""test"", xmlAttributeEscaper.escape("\"test\""));
assertEquals("'test'", xmlAttributeEscaper.escape("\'test'"));
// Test all escapes
assertEquals("a"b<c>d&e"f'",
xmlAttributeEscaper.escape("a\"b<c>d&e\"f'"));
// Test '\t', '\n' and '\r' are escaped.
assertEquals("a	b
c
d", xmlAttributeEscaper.escape("a\tb\nc\rd"));