Changeset 10202 in josm


Ignore:
Timestamp:
2016-05-13T04:20:36+02:00 (4 years ago)
Author:
Don-vip
Message:

increase code coverage

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java

    r9997 r10202  
    7373    private static final EmailValidator EMAIL_VALIDATOR_WITH_LOCAL = new EmailValidator(true, false);
    7474
    75 
    76     /**
    77      * Singleton instance of this class, which does
    78      *  consider local addresses valid.
    79      */
    80     private static final EmailValidator EMAIL_VALIDATOR_WITH_LOCAL_WITH_TLD = new EmailValidator(true, true);
    81 
    8275    /**
    8376     * Returns the Singleton instance of this validator.
     
    9992    public static EmailValidator getInstance(boolean allowLocal, boolean allowTld) {
    10093        if (allowLocal) {
    101             if (allowTld) {
    102                 return EMAIL_VALIDATOR_WITH_LOCAL_WITH_TLD;
    103             } else {
    104                 return EMAIL_VALIDATOR_WITH_LOCAL;
    105             }
     94            return EMAIL_VALIDATOR_WITH_LOCAL;
    10695        } else {
    10796            if (allowTld) {
  • trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java

    r9214 r10202  
    1313import org.openstreetmap.josm.JOSMFixture;
    1414import org.openstreetmap.josm.data.coor.LatLon;
     15import org.openstreetmap.josm.data.osm.Changeset;
    1516import org.openstreetmap.josm.data.osm.DataSet;
    1617import org.openstreetmap.josm.data.osm.Node;
     
    409410        assertTrue(r2.getMembers().contains(new RelationMember("relation-1", r1)));
    410411    }
     412
     413    /**
     414     * Unit test of {@code AbstractVisitor#visit(org.openstreetmap.josm.data.osm.Changeset)}.
     415     */
     416    @Test
     417    public void testVisitChangeset() {
     418        new MergeSourceBuildingVisitor(new DataSet()).visit(new Changeset());
     419    }
    411420}
  • trunk/test/unit/org/openstreetmap/josm/data/validation/routines/EmailValidatorTest.java

    r10133 r10202  
    6060    public void testEmail()  {
    6161        assertTrue(validator.isValid("jsmith@apache.org"));
     62        assertFalse(validator.isValid(null));
    6263    }
    6364
Note: See TracChangeset for help on using the changeset viewer.