Changeset 9469 in josm


Ignore:
Timestamp:
2016-01-15T20:34:53+01:00 (8 years ago)
Author:
Don-vip
Message:

map paint styles unit test robustness

File:
1 edited

Legend:

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

    r9458 r9469  
    77import java.io.IOException;
    88import java.util.Collection;
     9import java.util.Collections;
    910import java.util.HashMap;
    1011import java.util.Map;
     
    7980                    }
    8081                }
    81                 System.out.println(style.isValid() ? " => OK" : " => KO");
    82                 Collection<Throwable> errors = style.getErrors();
    83                 Collection<String> warnings = style.getWarnings();
    84                 if (!errors.isEmpty()) {
    85                     allErrors.put(source.url, errors);
    86                 }
    87                 if (!warnings.isEmpty()) {
    88                     allWarnings.put(source.url, warnings);
     82                if (style != null) {
     83                    System.out.println(style.isValid() ? " => OK" : " => KO");
     84                    Collection<Throwable> errors = style.getErrors();
     85                    Collection<String> warnings = style.getWarnings();
     86                    if (!errors.isEmpty()) {
     87                        allErrors.put(source.url, errors);
     88                    }
     89                    if (!warnings.isEmpty()) {
     90                        allWarnings.put(source.url, warnings);
     91                    }
     92                } else {
     93                    allWarnings.put(source.url, Collections.singleton("MapPaintStyles.addStyle() returned null"));
    8994                }
    9095            }
Note: See TracChangeset for help on using the changeset viewer.