testable.startPrefixMapping(PREFIX, URI);
Attributes attributes = new AttributesImpl();
// ensure that the event is not immediatly passed to the next process
{
XMLProcessTestable next = createNextProcess();
testable.setNextProcess(next);
testable.startPrefixMapping(PREFIX, URI);
next.assertStartPrefixMappingNotInvoked();
testable.startElement("", "localname", "localname", attributes);
next.assertStartPrefixMappingInvoked(PREFIX, URI);
next.assertStartElementInvoked("", "localname", "localname", attributes);
}
// ensure that empty prefix events are never passed to the next process
{
XMLProcessTestable next = createNextProcess();
testable.setNextProcess(next);
testable.startPrefixMapping(PREFIX, URI);
testable.endPrefixMapping(PREFIX);
testable.startElement("", "localname", "localname", attributes);
next.assertStartPrefixMappingNotInvoked();
next.assertStartElementInvoked("", "localname", "localname", attributes);
}
// ensure that prefix events without a startElement are ignored
{
char[] characters = "abc".toCharArray();
XMLProcessTestable next = createNextProcess();
testable.setNextProcess(next);
testable.startPrefixMapping(PREFIX, URI);
testable.characters(characters, 0, characters.length);
testable.endPrefixMapping(PREFIX);
next.assertStartPrefixMappingNotInvoked();
next.assertCharactersInvoked(characters, 0, characters.length);
next.assertEndPrefixMappingNotInvoked();
}
}