public void test_RDFAnnotation2_modelWithHistoryWithCharacterReference() { ModelHistory h = new ModelHistory(); ModelCreator c = new ModelCreator(); c.setFamilyName("Dräger"); c.setGivenName("Andreas"); h.addCreator(c); Date d = new Date(2005,2,2,14,56,11); h.setCreatedDate(d); h.addModifiedDate(d); m2.unsetModelHistory(); m2.setModelHistory(h); XMLNode ann = RDFAnnotationParser.parseModelHistory(m2); string expected = "<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=\"#_000001\">\n" + " <dc:creator rdf:parseType=\"Resource\">\n" + " <rdf:Bag>\n" + " <rdf:li rdf:parseType=\"Resource\">\n" + " <vCard:N rdf:parseType=\"Resource\">\n" + " <vCard:Family>Dräger</vCard:Family>\n" + " <vCard:Given>Andreas</vCard:Given>\n" + " </vCard:N>\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>2005-02-02T14:56:11Z</dcterms:W3CDTF>\n" + " </dcterms:modified>\n" + " </rdf:Description>\n" + " </rdf:RDF>\n" + "</annotation>"; assertEquals( true, equals(expected,ann.toXMLString()) ); }
public void test_ModelHistory_addModifiedDate() { ModelHistory history = new ModelHistory(); assertTrue( history != null ); assertTrue( history.isSetModifiedDate() == false ); assertTrue( history.getNumModifiedDates() == 0 ); Date date = new Date(2005,12,30,12,15,45,1,2,0); history.addModifiedDate(date); date = null; assertTrue( history.getNumModifiedDates() == 1 ); assertTrue( history.isSetModifiedDate() == true ); Date newdate = history.getListModifiedDates().get(0); assertTrue( newdate.getYear() == 2005 ); assertTrue( newdate.getMonth() == 12 ); assertTrue( newdate.getDay() == 30 ); assertTrue( newdate.getHour() == 12 ); assertTrue( newdate.getMinute() == 15 ); assertTrue( newdate.getSecond() == 45 ); assertTrue( newdate.getSignOffset() == 1 ); assertTrue( newdate.getHoursOffset() == 2 ); assertTrue( newdate.getMinutesOffset() == 0 ); Date date1 = new Date(2008,11,2,16,42,40,1,2,0); history.addModifiedDate(date1); date1 = null; assertTrue( history.getNumModifiedDates() == 2 ); assertTrue( history.isSetModifiedDate() == true ); Date newdate1 = history.getModifiedDate(1); assertTrue( newdate1.getYear() == 2008 ); assertTrue( newdate1.getMonth() == 11 ); assertTrue( newdate1.getDay() == 2 ); assertTrue( newdate1.getHour() == 16 ); assertTrue( newdate1.getMinute() == 42 ); assertTrue( newdate1.getSecond() == 40 ); assertTrue( newdate1.getSignOffset() == 1 ); assertTrue( newdate1.getHoursOffset() == 2 ); assertTrue( newdate1.getMinutesOffset() == 0 ); history = null; }