Package org.gedcom4j.model

Examples of org.gedcom4j.model.StringWithCustomTags


     * Test method for
     * {@link org.gedcom4j.validate.SubmitterValidator#validate()}.
     */
    public void testValidateSubmitterHappyPath() {
        Submitter submitter = new Submitter();
        submitter.name = new StringWithCustomTags("somebody");
        submitter.xref = "@nobody@";
        AbstractValidator sv = new SubmitterValidator(rootValidator, submitter);
        sv.validate();
        dumpFindings();
        assertTrue(rootValidator.findings.isEmpty());
View Full Code Here


     * {@link org.gedcom4j.validate.SubmitterValidator#validate()}.
     */
    public void testValidateSubmitterHasBlankName() {
        Submitter submitter = new Submitter();
        submitter.xref = "@SOMEVALUE@";
        submitter.name = new StringWithCustomTags("");
        AbstractValidator sv = new SubmitterValidator(rootValidator, submitter);
        sv.validate();
        assertFindingsContain(Severity.ERROR, "name", "blank", "null");
    }
View Full Code Here

     * Test method for
     * {@link org.gedcom4j.validate.SubmitterValidator#validate()}.
     */
    public void testValidateSubmitterHasBlankXref() {
        Submitter submitter = new Submitter();
        submitter.name = new StringWithCustomTags("somebody");
        submitter.xref = "";
        AbstractValidator sv = new SubmitterValidator(rootValidator, submitter);
        sv.validate();
        assertFindingsContain(Severity.ERROR, "xref", "too short");
        assertFindingsContain(Severity.ERROR, "xref", "null");
View Full Code Here

     * Test method for
     * {@link org.gedcom4j.validate.SubmitterValidator#validate()}.
     */
    public void testValidateSubmitterHasNoXref() {
        Submitter submitter = new Submitter();
        submitter.name = new StringWithCustomTags("somebody");
        AbstractValidator sv = new SubmitterValidator(rootValidator, submitter);
        sv.validate();
        assertFindingsContain(Severity.ERROR, "xref", "blank", "null");
    }
View Full Code Here

        Gedcom g = new Gedcom();
        rootValidator.gedcom = g;
        rootValidator.autorepair = false;
        Submitter s = new Submitter();
        s.xref = "@SUBM0001@";
        s.name = new StringWithCustomTags("test");
        g.submitters.put(s.xref, s);
        g.submission = new Submission("@SUBN0001@");
        g.header.submitter = s;

        g.trailer = null;
View Full Code Here

    /**
     * Test when source has some bad values
     */
    public void testBadSource1() {
        Source src = new Source("bad xref");
        src.recIdNumber = new StringWithCustomTags("");
        AbstractValidator av = new SourceValidator(rootValidator, src);
        av.validate();
        assertFindingsContain(Severity.ERROR, "record id", "source", "blank");
        assertFindingsContain(Severity.ERROR, "xref", "source", "start", "at", "sign");
        assertFindingsContain(Severity.ERROR, "xref", "source", "end", "at", "sign");
View Full Code Here

     */
    public void testBadSource2() {
        Source src = new Source("@Test@");
        src.data = new SourceData();
        EventRecorded e = new EventRecorded();
        e.datePeriod = new StringWithCustomTags("anytime");
        src.data.eventsRecorded.add(e);
        AbstractValidator av = new SourceValidator(rootValidator, src);
        av.validate();
        assertNoIssues();
    }
View Full Code Here

        Gedcom g = new Gedcom();
        rootValidator.gedcom = g;
        rootValidator.autorepair = false;
        Submitter s = new Submitter();
        s.xref = "@SUBM0001@";
        s.name = new StringWithCustomTags("test");
        g.submitters.put(s.xref, s);
        g.submission = new Submission("@SUBN0001@");
        Header h = g.header;
        h.submitter = s;
        h.submission = g.submission;

        h.characterSet = null;

        rootValidator.validate();
        assertFindingsContain(Severity.ERROR, "character set");

        h.characterSet = new CharacterSet();
        rootValidator.validate();
        assertNoIssues();

        h.characterSet.characterSetName = null;
        rootValidator.validate();
        assertFindingsContain(Severity.ERROR, "character set", "name", "not", "defined");

        h.characterSet.characterSetName = new StringWithCustomTags("FRYINGPAN");
        rootValidator.validate();
        assertFindingsContain(Severity.ERROR, "character set", "not", "supported");

        h.characterSet.characterSetName = new StringWithCustomTags(Encoding.ASCII.getCharacterSetName());
        rootValidator.validate();
        assertNoIssues();

        h.characterSet.customTags = null;
        rootValidator.validate();
View Full Code Here

        Gedcom g = new Gedcom();
        rootValidator.gedcom = g;
        rootValidator.autorepair = false;
        Submitter s = new Submitter();
        s.xref = "@SUBM0001@";
        s.name = new StringWithCustomTags("test");
        g.submitters.put(s.xref, s);
        Header h = g.header;
        h.submitter = s;
        g.submission = new Submission("@SUBN0001@");
View Full Code Here

        Gedcom g = new Gedcom();
        rootValidator.gedcom = g;
        rootValidator.autorepair = false;
        Submitter s = new Submitter();
        s.xref = "@SUBM0001@";
        s.name = new StringWithCustomTags("test");
        g.submitters.put(s.xref, s);
        Header h = g.header;
        h.submitter = s;
        g.submission = new Submission("@SUBN0001@");
        h.submission = g.submission;
View Full Code Here

TOP

Related Classes of org.gedcom4j.model.StringWithCustomTags

Copyright © 2018 www.massapicom. 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.