Ignore:
Timestamp:
2016-09-03T12:24:18+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S3658 - Unit tests should throw exceptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java

    r10846 r10937  
    6161                break;
    6262            }
    63             try {
    64                 int[] rows = (int[]) idx[i];
    65                 if (rows.length != 2) {
    66                     fail("illegal selection range. Either null or not length 2: " + Arrays.toString(rows));
    67                 }
    68                 if (rows[0] > rows[1]) {
    69                     fail("illegal selection range. lower bound > upper bound ");
    70                 }
    71                 for (int j = rows[0]; j <= rows[1]; j++) {
    72                     assertTrue("expected row " + j + " to be selected", model.isSelectedIndex(j));
    73                 }
    74             } catch (ClassCastException e) {
    75                 fail("illegal selection range:" + idx[i]);
     63            int[] rows = (int[]) idx[i];
     64            if (rows.length != 2) {
     65                fail("illegal selection range. Either null or not length 2: " + Arrays.toString(rows));
     66            }
     67            if (rows[0] > rows[1]) {
     68                fail("illegal selection range. lower bound > upper bound ");
     69            }
     70            for (int j = rows[0]; j <= rows[1]; j++) {
     71                assertTrue("expected row " + j + " to be selected", model.isSelectedIndex(j));
    7672            }
    7773        }
Note: See TracChangeset for help on using the changeset viewer.