* <code><alice xmlns="http://some-namespace">bob</alice></code>
*/
@Test
public void testNamespaces() throws Exception {
String input = "<?xml version=\"1.0\"?><alice xmlns=\"http://some-namespace\">bob</alice>";
XMLStreamReader reader = new SimpleXMLStreamReader(new StringReader(input));
Assert.assertEquals(XMLConstants.NULL_NS_URI, reader.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX));
Assert.assertNull(reader.getNamespaceContext().getPrefix("http://some-namespace"));
verify(reader, XMLStreamConstants.START_DOCUMENT, null, null);
reader.next();
verify(reader, XMLStreamConstants.START_ELEMENT, "alice", null);
Assert.assertEquals("http://some-namespace", reader.getNamespaceURI());
Assert.assertEquals("http://some-namespace", reader.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX));
Assert.assertEquals(XMLConstants.DEFAULT_NS_PREFIX, reader.getNamespaceContext().getPrefix("http://some-namespace"));
Assert.assertEquals(0, reader.getAttributeCount());
reader.next();
verify(reader, XMLStreamConstants.CHARACTERS, null, "bob");
reader.next();
verify(reader, XMLStreamConstants.END_ELEMENT, "alice", null);
Assert.assertEquals("http://some-namespace", reader.getNamespaceURI());
Assert.assertEquals("http://some-namespace", reader.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX));
Assert.assertEquals(XMLConstants.DEFAULT_NS_PREFIX, reader.getNamespaceContext().getPrefix("http://some-namespace"));
reader.next();
verify(reader, XMLStreamConstants.END_DOCUMENT, null, null);
reader.close();
}