@Test
public void testCharactersCData() throws XMLStreamException {
XMLStreamReader reader = createXmlStreamReader("<alice>bob</alice>");
reader.next();
Characters characters = eventAllocator.allocate(reader).asCharacters();
verify(characters, XMLStreamConstants.CHARACTERS, "bob");
Assert.assertEquals("bob", characters.getData());
Assert.assertFalse(characters.isCData());
Assert.assertFalse(characters.isWhiteSpace());
Assert.assertFalse(characters.isIgnorableWhiteSpace());
reader = createXmlStreamReader("<alice><![CDATA[bob]]></alice>");
reader.next();
characters = eventAllocator.allocate(reader).asCharacters();
verify(characters, XMLStreamConstants.CDATA, "<![CDATA[bob]]>");
Assert.assertEquals("bob", characters.getData());
Assert.assertTrue(characters.isCData());
reader = createXmlStreamReader("<alice><![CDATA[ ]]></alice>");
reader.next();
characters = eventAllocator.allocate(reader).asCharacters();
verify(characters, XMLStreamConstants.CDATA, "<![CDATA[ ]]>");
Assert.assertEquals(" ", characters.getData());
Assert.assertTrue(characters.isWhiteSpace());
Assert.assertFalse(characters.isIgnorableWhiteSpace());
}