gp.load("sample/Event Tag Test.ged");
Gedcom gBefore = gp.gedcom;
assertNotNull(gBefore);
assertEquals(1, gBefore.individuals.size());
Individual iBefore = gBefore.individuals.get("@I1@");
assertNotNull(iBefore);
assertNotNull(iBefore.events);
assertEquals(4, iBefore.events.size());
IndividualEvent eBefore = iBefore.events.get(0); // The birth event
assertNotNull(eBefore);
assertEquals(IndividualEventType.BIRTH, eBefore.type);
assertNull(eBefore.yNull);
assertNotNull(eBefore.description);
// Write the file back out in standard format
String fn = "tmp/" + this.getClass().getName() + ".ged";
GedcomWriter gw = new GedcomWriter(gBefore);
gw.validationSuppressed = true;
gw.write(fn);
// Read the file we just wrote back in. The non-standard part should be removed.
gp = new GedcomParser();
gp.load(fn);
Gedcom gAfter = gp.gedcom;
assertNotNull(gBefore);
assertEquals(1, gAfter.individuals.size());
Individual iAfter = gAfter.individuals.get("@I1@");
assertNotNull(iAfter);
assertNotNull(iAfter.events);
assertEquals(4, iAfter.events.size());
IndividualEvent eAfter = iAfter.events.get(0); // The birth event