Ignore:
Timestamp:
2015-10-11T17:28:19+02:00 (10 years ago)
Author:
Don-vip
Message:

improve/cleanup unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/CustomMatchers.java

    r8759 r8857  
    1414import org.openstreetmap.josm.tools.Predicate;
    1515
     16/**
     17 * Custom matchers for unit tests.
     18 */
    1619@Ignore("no test")
    1720public final class CustomMatchers {
     
    2124    }
    2225
     26    /**
     27     * Matcher for a predicate.
     28     * @param predicate the predicate
     29     * @return matcher for a predicate
     30     */
    2331    public static <T> Matcher<? extends T> forPredicate(final Predicate<T> predicate) {
    2432        return new TypeSafeMatcher<T>() {
     
    3644    }
    3745
     46    /**
     47     * Matcher for a collection of a given size.
     48     * @param size of collection
     49     * @return matcher for a collection of a given size
     50     */
    3851    public static Matcher<Collection<?>> hasSize(final int size) {
    3952        return new TypeSafeMatcher<Collection<?>>() {
     
    5063    }
    5164
     65    /**
     66     * Matcher for an empty collection.
     67     * @return matcher for an empty collection
     68     */
    5269    public static Matcher<Collection<?>> isEmpty() {
    5370        return new TypeSafeMatcher<Collection<?>>() {
     
    6481    }
    6582
     83    /**
     84     * Matcher for a point at a given location.
     85     * @param expected expected location
     86     * @return matcher for a point at a given location
     87     */
    6688    public static Matcher<? super Point2D> is(final Point2D expected) {
    6789        return new CustomTypeSafeMatcher<Point2D>("the same Point2D") {
     
    7395    }
    7496
     97    /**
     98     * Matcher for a point at a given location.
     99     * @param expected expected location
     100     * @return matcher for a point at a given location
     101     */
    75102    public static Matcher<? super LatLon> is(final LatLon expected) {
    76103        return new CustomTypeSafeMatcher<LatLon>("the same LatLon") {
     
    83110    }
    84111
     112    /**
     113     * Matcher for a point at a given location.
     114     * @param expected expected location
     115     * @return matcher for a point at a given location
     116     */
    85117    public static Matcher<? super EastNorth> is(final EastNorth expected) {
    86118        return new CustomTypeSafeMatcher<EastNorth>("the same EastNorth") {
     
    92124        };
    93125    }
    94 
    95126}
Note: See TracChangeset for help on using the changeset viewer.