Package org.gedcom4j.parser

Examples of org.gedcom4j.parser.GedcomParser.load()


     * @throws IOException
     */
    @Test
    public void testToStringBigFile() throws IOException, GedcomParserException {
        GedcomParser gp = new GedcomParser();
        gp.load("sample/5.5.1 sample 1.ged");
        Gedcom g = gp.gedcom;

        for (Family f : g.families.values()) {
            assertNotNull(f.customTags.toString());
            assertFalse(0 == f.customTags.hashCode());
View Full Code Here


     *             if the gedcom can't be parsed
     */
    @Before
    public void setUp() throws IOException, GedcomParserException {
        GedcomParser gp = new GedcomParser();
        gp.load("sample/RelationshipTest.ged");
        assertTrue(gp.errors.isEmpty());
        assertTrue(gp.warnings.isEmpty());

        g = gp.gedcom;
        assertNotNull(g);
View Full Code Here

     */
    @Test
    public void testNonStdTagsNotWritten() throws IOException, GedcomParserException, GedcomWriterException {
        // Read original non-standard file, find non-standard birth event, assert some pre-conditions
        GedcomParser gp = new GedcomParser();
        gp.load("sample/Event Tag Test.ged");
        Gedcom gBefore = gp.gedcom;
        assertNotNull(gBefore);

        assertEquals(1, gBefore.individuals.size());
        Individual iBefore = gBefore.individuals.get("@I1@");
View Full Code Here

        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@");
View Full Code Here

     */
    @Test
    public void testValidation() throws IOException, GedcomParserException, GedcomWriterException {
        // Read original non-standard file, find non-standard birth event, assert some pre-conditions
        GedcomParser gp = new GedcomParser();
        gp.load("sample/Event Tag Test.ged");
        Gedcom gBefore = gp.gedcom;
        assertNotNull(gBefore);

        assertEquals(1, gBefore.individuals.size());
        Individual iBefore = gBefore.individuals.get("@I1@");
View Full Code Here

     *             if the file can't be parsed
     */
    public void testValidateStressTestFile() throws IOException, GedcomParserException {
        // Load a file
        GedcomParser p = new GedcomParser();
        p.load(SAMPLE_STRESS_TEST_FILENAME);
        assertTrue(p.errors.isEmpty());
        rootValidator = new GedcomValidator(p.gedcom);
        rootValidator.validate();
        dumpFindings();
        /*
 
View Full Code Here

     *             if a gedcom data structure can't be written (usually due to invalid data, shouldn't happen)
     */
    public GedcomWriterTest() throws IOException, GedcomParserException, GedcomWriterException {
        // Load a file
        GedcomParser p = new GedcomParser();
        p.load(SAMPLE_STRESS_TEST_FILENAME);
        assertTrue(p.errors.isEmpty());
        gedcomOrig = p.gedcom;

        GedcomWriter gw = new GedcomWriter(gedcomOrig);
        gw.validationSuppressed = true;
View Full Code Here

            }
        }

        // Reload the file we just wrote
        p = new GedcomParser();
        p.load(tempFile.getAbsolutePath());
        for (String s : p.errors) {
            System.err.println(s);
        }
        assertTrue(p.errors.isEmpty());
        assertTrue(p.warnings.isEmpty());
View Full Code Here

     */
    @Before
    public void setup() throws IOException, GedcomParserException {
        GedcomParser gp = new GedcomParser();

        gp.load("sample/RelationshipTest.ged");
        assertTrue(gp.errors.isEmpty());
        assertTrue(gp.warnings.isEmpty());
        g = gp.gedcom;
        assertNotNull(g);
        assertEquals("There are supposed to be 43 people in the gedcom - are you using the right file/file version?",
View Full Code Here

        // Write the test data
        gw.write("tmp/writertest551.ged");

        // Read it back
        GedcomParser gp = new GedcomParser();
        gp.load("tmp/writertest551.ged");
        assertTrue(gp.errors.isEmpty());
        assertTrue(gp.warnings.isEmpty());

        // Look for expected data
        g = gp.gedcom;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.