Changeset 8940 in josm for trunk/test/unit


Ignore:
Timestamp:
2015-10-24T15:34:20+02:00 (9 years ago)
Author:
Don-vip
Message:

better assertion message in unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java

    r8937 r8940  
    66
    77import java.io.IOException;
    8 import java.util.ArrayList;
    98import java.util.Collection;
     9import java.util.HashMap;
     10import java.util.Map;
    1011
    1112import org.junit.BeforeClass;
     
    3940                .loadAndGetAvailableSources();
    4041        assertFalse(sources.isEmpty());
    41         Collection<Throwable> allErrors = new ArrayList<>();
     42        Map<String, Collection<Throwable>> allErrors = new HashMap<>();
    4243        for (ExtendedSourceEntry source : sources) {
    4344            System.out.print(source.url);
    4445            Collection<Throwable> errors = MapPaintStyles.addStyle(source);
    4546            System.out.println(errors.isEmpty() ? " => OK" : " => KO");
    46             allErrors.addAll(errors);
     47            if (!errors.isEmpty()) {
     48                allErrors.put(source.url, errors);
     49            }
    4750        }
    48         assertTrue(allErrors.isEmpty());
     51        assertTrue(allErrors.toString(), allErrors.isEmpty());
    4952    }
    5053}
Note: See TracChangeset for help on using the changeset viewer.