Exemplo n.º 1
0
        public void test_XMLToken_newSetters_removeNamespaces1()
        {
            XMLTriple     triple = new  XMLTriple("test", "", "");
            XMLAttributes attr   = new  XMLAttributes();
            XMLToken      token  = new  XMLToken(triple, attr);

            token.addNamespace("http://test1.org/", "test1");
            assertTrue(token.getNamespacesLength() == 1);
            int i = token.removeNamespace("test2");

            assertTrue(i == libsbml.LIBSBML_INDEX_EXCEEDS_SIZE);
            assertTrue(token.getNamespacesLength() == 1);
            i = token.removeNamespace("test1");
            assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
            assertTrue(token.getNamespacesLength() == 0);
            token  = null;
            triple = null;
            attr   = null;
        }
Exemplo n.º 2
0
        public void test_XMLToken_namespace_remove()
        {
            XMLTriple     triple = new  XMLTriple("test", "", "");
            XMLAttributes attr   = new  XMLAttributes();
            XMLToken      token  = new  XMLToken(triple, attr);

            token.addNamespace("http://test1.org/", "test1");
            token.addNamespace("http://test2.org/", "test2");
            token.addNamespace("http://test3.org/", "test3");
            token.addNamespace("http://test4.org/", "test4");
            token.addNamespace("http://test5.org/", "test5");
            assertTrue(token.getNamespacesLength() == 5);
            token.removeNamespace(4);
            assertTrue(token.getNamespacesLength() == 4);
            token.removeNamespace(3);
            assertTrue(token.getNamespacesLength() == 3);
            token.removeNamespace(2);
            assertTrue(token.getNamespacesLength() == 2);
            token.removeNamespace(1);
            assertTrue(token.getNamespacesLength() == 1);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 0);
            token.addNamespace("http://test1.org/", "test1");
            token.addNamespace("http://test2.org/", "test2");
            token.addNamespace("http://test3.org/", "test3");
            token.addNamespace("http://test4.org/", "test4");
            token.addNamespace("http://test5.org/", "test5");
            assertTrue(token.getNamespacesLength() == 5);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 4);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 3);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 2);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 1);
            token.removeNamespace(0);
            assertTrue(token.getNamespacesLength() == 0);
            token  = null;
            triple = null;
            attr   = null;
        }