Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AbstractTest.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AbstractTest.java	(revision 31417)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AbstractTest.java	(revision 31417)
@@ -0,0 +1,30 @@
+package org.openstreetmap.josm.plugins.mapillary;
+
+import org.junit.BeforeClass;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.plugins.mapillary.util.TestUtil;
+
+public abstract class AbstractTest {
+
+  private static boolean started = false;
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+    if (!started) {
+      new Thread() {
+        @Override
+        public synchronized void run() {
+          MainApplication
+              .main(new String[] { "--download=http://www.openstreetmap.org/#map=18/40.42013/-3.68923" });
+        }
+      }.start();
+      started = true;
+      while (Main.map == null || Main.map.mapView == null) {
+        synchronized (Thread.currentThread()) {
+          Thread.currentThread().wait(1000);
+        }
+      }
+    }
+  }
+}
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AllTests.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AllTests.java	(revision 31417)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/AllTests.java	(revision 31417)
@@ -0,0 +1,12 @@
+package org.openstreetmap.josm.plugins.mapillary;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+import org.openstreetmap.josm.plugins.mapillary.util.TestUtil;
+
+@RunWith(Suite.class)
+@SuiteClasses({ ImportTest.class,
+    MapillarySequenceDownloadThreadTest.class})
+public class AllTests {
+}
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java	(revision 31417)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportTest.java	(revision 31417)
@@ -0,0 +1,55 @@
+package org.openstreetmap.josm.plugins.mapillary;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.IIOException;
+
+import org.apache.commons.imaging.common.RationalNumber;
+import org.apache.commons.imaging.formats.tiff.constants.GpsTagConstants;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.plugins.mapillary.actions.MapillaryImportAction;
+
+public class ImportTest extends AbstractTest{
+
+  @Test
+  public void importNoTagsTest() throws InterruptedException {
+    File image = new File(MapillaryPlugin.directory + "images/icon16.png");
+    MapillaryImportedImage img = MapillaryPlugin.importAction.readNoTags(image);
+    assertEquals(0, img.getCa(), 0.01);
+    assert(Main.map.mapView.getRealBounds().getCenter().equalsEpsilon(img.getLatLon()));
+  }
+
+  @Test(expected=IIOException.class)
+  public void testInvalidFiles() throws IOException {
+      MapillaryImportedImage img = new MapillaryImportedImage(0,0,0, null);
+      assertEquals(null, img.getImage());
+      assertEquals(null, img.getFile());
+
+      img = new MapillaryImportedImage(0, 0, 0, new File(""));
+      assertEquals(new File(""), img.getFile());
+      img.getImage();
+  }
+
+  @Test
+  public void degMinSecToDoubleTest() {
+    RationalNumber[] num = new RationalNumber[3];
+    num[0] = new RationalNumber(1, 1);
+    num[1] = new RationalNumber(0, 1);
+    num[2] = new RationalNumber(0, 1);
+    String ref = GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_NORTH;
+    assertEquals(1, MapillaryImportAction.degMinSecToDouble(num, ref), 0.01);
+    ref = GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF_VALUE_SOUTH;
+    assertEquals(-1, MapillaryImportAction.degMinSecToDouble(num, ref), 0.01);
+    num[0] = new RationalNumber(180, 1);
+    assertEquals(0, MapillaryImportAction.degMinSecToDouble(num, ref), 0.01);
+  }
+
+}
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportedImageTest.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/ImportedImageTest.java	(revision 31411)
+++ 	(revision )
@@ -1,30 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.IIOException;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ImportedImageTest {
-
-    @Before
-    public void setUp() {
-        MapillaryData.TEST_MODE = true;
-    }
-
-    @Test(expected=IIOException.class)
-    public void testInvalidFiles() throws IOException {
-        MapillaryImportedImage img = new MapillaryImportedImage(0,0,0, null);
-        assertEquals(null, img.getImage());
-        assertEquals(null, img.getFile());
-
-        img = new MapillaryImportedImage(0, 0, 0, new File(""));
-        assertEquals(new File(""), img.getFile());
-        img.getImage();
-    }
-}
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/util/TestUtil.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/util/TestUtil.java	(revision 31411)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/util/TestUtil.java	(revision 31417)
@@ -1,7 +1,12 @@
 package org.openstreetmap.josm.plugins.mapillary.util;
+
+import java.io.File;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.plugins.PluginException;
+import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 import org.openstreetmap.josm.tools.I18n;
 
@@ -30,5 +35,10 @@
             I18n.set(Main.pref.get("language", "en"));
             Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
-
+            try {
+              new MapillaryPlugin(new PluginInformation(new File("/home/nokutu/.josm/plugins/Mapillary.jar")));
+            } catch (PluginException e) {
+              // TODO Auto-generated catch block
+              e.printStackTrace();
+            }
             isInitialized = true;
         }
