public void test_SBase_appendNotes8() { XMLAttributes att = new XMLAttributes (); XMLNamespaces ns = new XMLNamespaces (); ns.@add ("http://www.w3.org/1999/xhtml", ""); XMLTriple body_triple = new XMLTriple ("body", "", ""); XMLTriple p_triple = new XMLTriple ("p", "", ""); XMLToken body_token = new XMLToken (body_triple, att, ns); XMLToken p_token = new XMLToken (p_triple, att); XMLToken text_token = new XMLToken ("This is my text"); XMLNode body_node = new XMLNode (body_token); XMLNode p_node = new XMLNode (p_token); XMLNode text_node = new XMLNode (text_token); XMLToken p_token1 = new XMLToken (p_triple, att, ns); XMLToken text_token1 = new XMLToken ("This is more text"); XMLNode p_node1 = new XMLNode (p_token1); XMLNode text_node1 = new XMLNode (text_token1); XMLNode notes; XMLNode child, child1; p_node.addChild (text_node); body_node.addChild (p_node); p_node1.addChild (text_node1); S.setNotes (body_node); S.appendNotes (p_node1); notes = S.getNotes (); assertTrue (("notes" == notes.getName ())); assertTrue (notes.getNumChildren () == 1); child = notes.getChild (0); assertTrue (("body" == child.getName ())); assertTrue (child.getNumChildren () == 2); child1 = child.getChild (0); assertTrue (("p" == child1.getName ())); assertTrue (child1.getNumChildren () == 1); child1 = child1.getChild (0); assertTrue (("This is my text" == child1.getCharacters ())); assertTrue (child1.getNumChildren () == 0); child1 = child.getChild (1); assertTrue (("p" == child1.getName ())); assertTrue (child1.getNumChildren () == 1); child1 = child1.getChild (0); assertTrue (("This is more text" == child1.getCharacters ())); assertTrue (child1.getNumChildren () == 0); att = null; ns = null; body_triple = null; p_triple = null; body_token = null; p_token = null; text_token = null; text_token1 = null; p_token1 = null; body_node = null; p_node = null; text_node = null; p_node1 = null; text_node1 = null; }
public void test_SBase_hasValidLevelVersionNamespaceCombination() { Species species = new Species (3, 1); assertTrue (species.hasValidLevelVersionNamespaceCombination () == true); species = null; XMLNamespaces invalidNamespaces = new XMLNamespaces (); species = new Species (3, 1); species.setNamespaces (invalidNamespaces); invalidNamespaces.@add (SBMLNamespaces.getSBMLNamespaceURI (2, 3), "sbml23"); species.setNamespaces (invalidNamespaces); assertTrue (species.hasValidLevelVersionNamespaceCombination () == false); invalidNamespaces.@add (SBMLNamespaces.getSBMLNamespaceURI (3, 1), "sbml31"); species.setNamespaces (invalidNamespaces); assertTrue (species.hasValidLevelVersionNamespaceCombination () == false); invalidNamespaces.clear (); invalidNamespaces.@add (SBMLNamespaces.getSBMLNamespaceURI (3, 1), "sbml31"); species.setNamespaces (invalidNamespaces); assertTrue (species.hasValidLevelVersionNamespaceCombination () == true); species = null; }
public void test_SBase_appendNotes() { XMLToken token; XMLNode node; XMLToken token1; XMLNode node1; XMLNode node2; XMLTriple triple = new XMLTriple ("p", "", ""); XMLAttributes att = new XMLAttributes (); XMLNamespaces ns = new XMLNamespaces (); ns.@add ("http://www.w3.org/1999/xhtml", ""); XMLToken token4 = new XMLToken ("This is my text"); XMLNode node4 = new XMLNode (token4); XMLToken token5 = new XMLToken ("This is additional text"); XMLNode node5 = new XMLNode (token5); token = new XMLToken (triple, att, ns); node = new XMLNode (token); node.addChild (node4); S.setNotes (node); assertTrue (S.isSetNotes () == true); token1 = new XMLToken (triple, att, ns); node1 = new XMLNode (token1); node1.addChild (node5); S.appendNotes (node1); assertTrue (S.isSetNotes () == true); node2 = S.getNotes (); assertTrue (node2.getNumChildren () == 2); assertTrue (("p" == node2.getChild (0).getName ())); assertTrue (node2.getChild (0).getNumChildren () == 1); assertTrue (("p" == node2.getChild (1).getName ())); assertTrue (node2.getChild (1).getNumChildren () == 1); string chars1 = node2.getChild (0).getChild (0).getCharacters (); string chars2 = node2.getChild (1).getChild (0).getCharacters (); assertTrue (("This is my text" == chars1)); assertTrue (("This is additional text" == chars2)); node = null; node1 = null; }