public void testNamespace() {
MappingElement element = new MappingElement("Test"); //$NON-NLS-1$
assertEquals("Test", element.getName()); //$NON-NLS-1$
assertNull(element.getNamespacePrefix());
Namespace namespace = new Namespace("foo", "protocol://someuri"); //$NON-NLS-1$ //$NON-NLS-2$
element = new MappingElement("Test", namespace); //$NON-NLS-1$
assertEquals("foo", element.getNamespacePrefix()); //$NON-NLS-1$
assertEquals(element.getNamespaces().length, 0);
element.addNamespace(namespace);
assertEquals(element.getNamespaces().length, 1);
element.addNamespace(new Namespace("ns1", "http://mm.com")); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals(element.getNamespaces().length, 2);
// they may be switch some times, need a better way to test this?
assertEquals("ns1", element.getNamespaces()[0].getPrefix()); //$NON-NLS-1$
assertEquals("foo", element.getNamespaces()[1].getPrefix()); //$NON-NLS-1$