Пример #1
0
 public void test_XMLNode_namespace_remove() {
   XMLTriple triple = new XMLTriple("test", "", "");
   XMLAttributes attr = new XMLAttributes();
   XMLNode node = new XMLNode(triple, attr);
   node.addNamespace("http://test1.org/", "test1");
   node.addNamespace("http://test2.org/", "test2");
   node.addNamespace("http://test3.org/", "test3");
   node.addNamespace("http://test4.org/", "test4");
   node.addNamespace("http://test5.org/", "test5");
   assertTrue(node.getNamespacesLength() == 5);
   node.removeNamespace(4);
   assertTrue(node.getNamespacesLength() == 4);
   node.removeNamespace(3);
   assertTrue(node.getNamespacesLength() == 3);
   node.removeNamespace(2);
   assertTrue(node.getNamespacesLength() == 2);
   node.removeNamespace(1);
   assertTrue(node.getNamespacesLength() == 1);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 0);
   node.addNamespace("http://test1.org/", "test1");
   node.addNamespace("http://test2.org/", "test2");
   node.addNamespace("http://test3.org/", "test3");
   node.addNamespace("http://test4.org/", "test4");
   node.addNamespace("http://test5.org/", "test5");
   assertTrue(node.getNamespacesLength() == 5);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 4);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 3);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 2);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 1);
   node.removeNamespace(0);
   assertTrue(node.getNamespacesLength() == 0);
   node = null;
   triple = null;
   attr = null;
 }