Ignore:
Timestamp:
2016-07-15T15:25:20+02:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Rework join and unjoin command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordTest.java

    r32653 r32659  
    177177  @Test
    178178  public void commandJoinClass() {
    179     CommandJoin cmd1 = new CommandJoin(Arrays.asList(new MapillaryAbstractImage[]{img1, img2}));
    180     CommandJoin cmd2 = new CommandJoin(Arrays.asList(new MapillaryAbstractImage[]{img2, img3}));
     179    CommandJoin cmd1 = new CommandJoin(img1, img2);
     180    CommandJoin cmd2 = new CommandJoin(img2, img3);
    181181
    182182    this.record.addCommand(cmd1);
     
    189189    assertEquals(3, img1.getSequence().getImages().size());
    190190    assertEquals(img3, img1.next().next());
    191 
    192     try {
    193       this.record.addCommand(new CommandJoin(Arrays.asList(new MapillaryAbstractImage[]{img1, img2, img3})));
    194       fail();
    195     } catch (IllegalArgumentException e) {
    196       // Expected output.
    197     }
     191  }
     192 
     193  @Test(expected=NullPointerException.class)
     194  public void commandJoinNull1() {
     195    new CommandJoin(img1, null);
     196  }
     197 
     198  @Test(expected=NullPointerException.class)
     199  public void commandJoinNull2() {
     200    new CommandJoin(null, img1);
    198201  }
    199202
     
    203206  @Test
    204207  public void commandUnjoinClass() {
    205     CommandJoin join1 = new CommandJoin(
    206             Arrays.asList(new MapillaryAbstractImage[]{this.img1, this.img2}));
    207     CommandJoin join2 = new CommandJoin(
    208             Arrays.asList(new MapillaryAbstractImage[]{this.img2, this.img3}));
     208    CommandJoin join1 = new CommandJoin(this.img1, this.img2);
     209    CommandJoin join2 = new CommandJoin(this.img2, this.img3);
    209210
    210211    CommandUnjoin cmd1 = new CommandUnjoin(
     
    238239  @Test
    239240  public void commandDeleteTest() {
    240     CommandJoin join1 = new CommandJoin(Arrays.asList(new MapillaryAbstractImage[]{img1, img2}));
    241     CommandJoin join2 = new CommandJoin(Arrays.asList(new MapillaryAbstractImage[]{img2, img3}));
     241    CommandJoin join1 = new CommandJoin(img1, img2);
     242    CommandJoin join2 = new CommandJoin(img2, img3);
    242243
    243244    CommandDelete cmd1 = new CommandDelete(
Note: See TracChangeset for help on using the changeset viewer.