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 31418)
@@ -2,28 +2,24 @@
 
 import org.junit.BeforeClass;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.mapillary.util.TestUtil;
 
+/**
+ * Abstract class for tests that require JOSM's preferences running.
+ *
+ * @author nokutu
+ *
+ */
 public abstract class AbstractTest {
 
   private static boolean started = false;
 
+  /**
+   * Initiates the basic parts of JOSM.
+   */
   @BeforeClass
-  public static void setUpBeforeClass() throws Exception {
+  public static void setUpBeforeClass() {
     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();
+      TestUtil.initPlugin();
       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 31418)
@@ -4,9 +4,13 @@
 import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
-import org.openstreetmap.josm.plugins.mapillary.util.TestUtil;
 
+/**
+ * Runs all tests.
+ *
+ * @author nokutu
+ *
+ */
 @RunWith(Suite.class)
-@SuiteClasses({ ImportTest.class,
-    MapillarySequenceDownloadThreadTest.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 31418)
@@ -2,4 +2,5 @@
 
 import static org.junit.Assert.*;
+import org.junit.Test;
 
 import java.io.File;
@@ -10,33 +11,48 @@
 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 the importation of images.
+ *
+ * @author nokutu
+ *
+ */
+public class ImportTest extends AbstractTest {
 
+  /**
+   * Test the importation of images in PNG format.
+   */
   @Test
-  public void importNoTagsTest() throws InterruptedException {
+  public void importNoTagsTest() {
     File image = new File(MapillaryPlugin.directory + "images/icon16.png");
-    MapillaryImportedImage img = MapillaryPlugin.importAction.readNoTags(image);
+    MapillaryImportedImage img = MapillaryPlugin.importAction.readNoTags(image,
+        new LatLon(0, 0));
     assertEquals(0, img.getCa(), 0.01);
-    assert(Main.map.mapView.getRealBounds().getCenter().equalsEpsilon(img.getLatLon()));
+    assert (Main.map.mapView.getRealBounds().getCenter().equalsEpsilon(img
+        .getLatLon()));
   }
 
-  @Test(expected=IIOException.class)
+  /**
+   * Test if provided an invalid file, the proper exception is thrown.
+   *
+   * @throws IOException
+   */
+  @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());
+    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();
+    img = new MapillaryImportedImage(0, 0, 0, new File(""));
+    assertEquals(new File(""), img.getFile());
+    img.getImage();
   }
 
+  /**
+   * Test degMinSecToDouble method.
+   */
   @Test
   public void degMinSecToDoubleTest() {
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 31417)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/util/TestUtil.java	(revision 31418)
@@ -11,37 +11,43 @@
 import org.openstreetmap.josm.tools.I18n;
 
+/**
+ *
+ * Utilities for tests.
+ *
+ * @author floscher
+ */
 public class TestUtil {
-    private static boolean isInitialized;
+  private static boolean isInitialized;
 
-    private TestUtil() {
-        // Prevent instantiation
+  private TestUtil() {
+    // Prevent instantiation
+  }
+
+  /**
+   * Initializes the {@link Main} class of JOSM and the mapillary plugin with
+   * the preferences from test/data/preferences.
+   *
+   * That is needed e.g. to use {@link MapillaryLayer#getInstance()}
+   */
+  public static final void initPlugin() {
+    if (!isInitialized) {
+      System.setProperty("josm.home", "test/data/preferences");
+      Main.initApplicationPreferences();
+      Main.pref.enableSaveOnPut(false);
+      I18n.init();
+      Main.determinePlatformHook();
+      Main.platform.preStartupHook();
+      Main.pref.init(false);
+      I18n.set(Main.pref.get("language", "en"));
+      Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+      try {
+        new MapillaryPlugin(new PluginInformation(new File(
+            "./build/libs/josm-mapillary-plugin.jar")));
+      } catch (PluginException e) {
+        e.printStackTrace();
+      }
+      isInitialized = true;
     }
-
-    /**
-     * Initializes the {@link Main} class of JOSM and the mapillary plugin
-     * with the preferences from test/data/preferences.
-     *
-     * That is needed e.g. to use {@link MapillaryLayer#getInstance()}
-     */
-    public static final void initPlugin() {
-        if (!isInitialized) {
-            System.setProperty("josm.home", "test/data/preferences");
-            Main.initApplicationPreferences();
-            Main.pref.enableSaveOnPut(false);
-            I18n.init();
-            Main.determinePlatformHook();
-            Main.platform.preStartupHook();
-            Main.pref.init(false);
-            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;
-        }
-    }
+  }
 
 }
