public void test_SyncAnnotation_stringChangesMetaid1() { Model c = new Model(2, 3); c.setMetaId("_000005"); c.setId("A"); string addedAnn = " <annotation>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000003\">\n" + " <dc:creator>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:parseType=\"Resource\">\n" + " <vCard:N rdf:parseType=\"Resource\">\n" + " <vCard:Family>Le Novere</vCard:Family>\n" + " <vCard:Given>Nicolas</vCard:Given>\n" + " </vCard:N>\n" + " <vCard:EMAIL>[email protected]</vCard:EMAIL>\n" + " <vCard:ORG rdf:parseType=\"Resource\">\n" + " <vCard:Orgname>EMBL-EBI</vCard:Orgname>\n" + " </vCard:ORG>\n" + " </rdf:li>\n" + " </rdf:Bag>\n" + " </dc:creator>\n" + " <dcterms:created rdf:parseType=\"Resource\">\n" + " <dcterms:W3CDTF>2005-02-02T14:56:11Z</dcterms:W3CDTF>\n" + " </dcterms:created>\n" + " <dcterms:modified rdf:parseType=\"Resource\">\n" + " <dcterms:W3CDTF>2006-05-30T10:46:02Z</dcterms:W3CDTF>\n" + " </dcterms:modified>\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>"; c.setAnnotation(addedAnn); string expected = "<model metaid=\"_000005\" id=\"A\">\n" + " <annotation>\n" + " <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" + " <rdf:Description rdf:about=\"#_000005\">\n" + " <dc:creator rdf:parseType=\"Resource\">\n" + " <rdf:Bag>\n" + " <rdf:li rdf:parseType=\"Resource\">\n" + " <vCard:N rdf:parseType=\"Resource\">\n" + " <vCard:Family>Le Novere</vCard:Family>\n" + " <vCard:Given>Nicolas</vCard:Given>\n" + " </vCard:N>\n" + " <vCard:EMAIL>[email protected]</vCard:EMAIL>\n" + " <vCard:ORG>\n" + " <vCard:Orgname>EMBL-EBI</vCard:Orgname>\n" + " </vCard:ORG>\n" + " </rdf:li>\n" + " </rdf:Bag>\n" + " </dc:creator>\n" + " <dcterms:created rdf:parseType=\"Resource\">\n" + " <dcterms:W3CDTF>2005-02-02T14:56:11Z</dcterms:W3CDTF>\n" + " </dcterms:created>\n" + " <dcterms:modified rdf:parseType=\"Resource\">\n" + " <dcterms:W3CDTF>2006-05-30T10:46:02Z</dcterms:W3CDTF>\n" + " </dcterms:modified>\n" + " <bqbiol:is>\n" + " <rdf:Bag>\n" + " <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" + " </rdf:Bag>\n" + " </bqbiol:is>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + " </annotation>\n" + "</model>"; assertEquals(true, equals(expected, c.toSBML())); }
public void test_SBMLDocument_clone() { SBMLDocument o1 = new SBMLDocument(); o1.setLevelAndVersion(1,1,false); Model m = new Model(1,1); m.createCompartment(); m.createSpecies(); m.createReaction(); m.setId("foo"); o1.setModel(m); assertTrue( o1.getLevel() == 1 ); assertTrue( o1.getVersion() == 1 ); assertTrue( o1.getModel().getId() == "foo" ); assertTrue( o1.getModel().getLevel() == 1 ); assertTrue( o1.getModel().getVersion() == 1 ); assertTrue( o1.getModel().getSBMLDocument() == o1 ); SBMLDocument o2 = o1.clone(); assertTrue( o2.getLevel() == 1 ); assertTrue( o2.getVersion() == 1 ); assertTrue( o2.getModel().getId() == "foo" ); assertTrue( o2.getModel().getLevel() == 1 ); assertTrue( o2.getModel().getVersion() == 1 ); assertTrue( o2.getModel().getSBMLDocument() == o2 ); o2 = null; o1 = null; }