Ignore:
Timestamp:
2015-08-06T16:55:15+02:00 (9 years ago)
Author:
nokutu
Message:

Created several new tests and improved comments.

Location:
applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary
Files:
4 added
4 edited
1 moved

Legend:

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

    r31456 r31460  
    1212public abstract class AbstractTest {
    1313
    14   private static boolean started = false;
    15 
    1614  /**
    1715   * Initiates the basic parts of JOSM.
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java

    r31456 r31460  
    1010import javax.imageio.IIOException;
    1111
    12 import org.apache.commons.imaging.common.RationalNumber;
    13 import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants;
    1412import org.openstreetmap.josm.data.coor.LatLon;
    1513import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryImportAction;
    16 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
    1714
    1815/**
     
    5148    img.getImage();
    5249  }
    53 
    54   /**
    55    * Test degMinSecToDouble method.
    56    */
    57   @Test
    58   public void degMinSecToDoubleTest() {
    59     RationalNumber[] num = new RationalNumber[3];
    60     num[0] = new RationalNumber(1, 1);
    61     num[1] = new RationalNumber(0, 1);
    62     num[2] = new RationalNumber(0, 1);
    63     String ref = GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH;
    64     assertEquals(1, MapillaryUtils.degMinSecToDouble(num, ref), 0.01);
    65     ref = GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH;
    66     assertEquals(-1, MapillaryUtils.degMinSecToDouble(num, ref), 0.01);
    67     num[0] = new RationalNumber(180, 1);
    68     assertEquals(-180, MapillaryUtils.degMinSecToDouble(num, ref), 0.01);
    69     num[0] = new RationalNumber(190, 1);
    70     assertEquals(170, MapillaryUtils.degMinSecToDouble(num, ref), 0.01);
    71   }
    7250}
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImageTest.java

    r31445 r31460  
    4242  }
    4343
    44   private void testGetDate(String expected, MapillaryAbstractImage img,
     44  private static void testGetDate(String expected, MapillaryAbstractImage img,
    4545      boolean isoDates, boolean displayHour, boolean format24) {
    4646    Main.pref.put("iso.dates", isoDates);
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/oauth/UploadTest.java

    r31459 r31460  
    1 package org.openstreetmap.josm.plugins.mapillary;
     1package org.openstreetmap.josm.plugins.mapillary.oauth;
    22
    33import static org.junit.Assert.assertEquals;
     
    1818import org.junit.Test;
    1919import org.openstreetmap.josm.data.coor.LatLon;
     20import org.openstreetmap.josm.plugins.mapillary.AbstractTest;
     21import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
    2022import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryImportAction;
    2123import org.openstreetmap.josm.plugins.mapillary.oauth.UploadUtils;
    2224import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
    2325
     26/**
     27 * Tests the {@link UploadUtils} class.
     28 *
     29 * @author nokutu
     30 * @see UploadUtils
     31 */
    2432public class UploadTest extends AbstractTest {
    2533
    2634  /**
    27    * Tests the updateFile method from {@link MapillaryImportAction} class.
     35   * Tests the {@link UploadUtils#updateFile(MapillaryImportedImage)} method.
    2836   */
    2937  @Test
  • applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/TestUtil.java

    r31456 r31460  
    11package org.openstreetmap.josm.plugins.mapillary.utils;
    22
    3 import java.io.File;
    43
    54import org.openstreetmap.josm.Main;
    65import org.openstreetmap.josm.data.projection.Projections;
    7 import org.openstreetmap.josm.plugins.PluginException;
    8 import org.openstreetmap.josm.plugins.PluginInformation;
    96import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
    10 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
    117import org.openstreetmap.josm.tools.I18n;
    128
Note: See TracChangeset for help on using the changeset viewer.