Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 9674)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 9675)
@@ -208,5 +208,5 @@
      * @return the current edit layer. null, if no edit layer exists
      */
-    protected static OsmDataLayer getEditLayer() {
+    public static OsmDataLayer getEditLayer() {
         return Main.main != null ? Main.main.getEditLayer() : null;
     }
Index: trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 9674)
+++ trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java	(revision 9675)
@@ -14,4 +14,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -73,9 +74,13 @@
         }
         tests = null;
-        OsmDataLayer editLayer = Main.main.getEditLayer();
-        editLayer.validationErrors.clear();
-        editLayer.validationErrors.addAll(errors);
-        Main.map.validatorDialog.tree.setErrors(errors);
-        if (errors == null || errors.isEmpty())
+        OsmDataLayer editLayer = JosmAction.getEditLayer();
+        if (editLayer != null) {
+            editLayer.validationErrors.clear();
+            editLayer.validationErrors.addAll(errors);
+        }
+        if (Main.map != null) {
+            Main.map.validatorDialog.tree.setErrors(errors);
+        }
+        if (errors.isEmpty())
             return true;
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(revision 9674)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(revision 9675)
@@ -12,5 +12,5 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
@@ -53,5 +53,5 @@
         super.startTest(monitor);
 
-        OsmDataLayer layer = Main.main.getEditLayer();
+        OsmDataLayer layer = JosmAction.getEditLayer();
 
         if (layer != null) {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 9674)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java	(revision 9675)
@@ -8,6 +8,7 @@
 import java.util.Set;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -120,6 +121,9 @@
     public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
+        DataSet ds = JosmAction.getCurrentDataSet();
+        if (ds == null)
+            return;
         waysUsedInRelations = new HashSet<>();
-        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
+        for (Relation r : ds.getRelations()) {
             if (r.isUsable()) {
                 for (RelationMember m : r.getMembers()) {
Index: trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(revision 9675)
+++ trunk/test/unit/org/openstreetmap/josm/actions/upload/FixDataHookTest.java	(revision 9675)
@@ -0,0 +1,29 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions.upload;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.APIDataSet;
+
+/**
+ * Unit tests for class {@link FixDataHook}.
+ */
+public class FixDataHookTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test of {@link FixDataHook#checkUpload} method.
+     */
+    @Test
+    public void testCheckUpload() {
+        new FixDataHook().checkUpload(new APIDataSet());
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 9675)
+++ trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 9675)
@@ -0,0 +1,29 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions.upload;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.APIDataSet;
+
+/**
+ * Unit tests for class {@link ValidateUploadHook}.
+ */
+public class ValidateUploadHookTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test of {@link ValidateUploadHook#checkUpload} method.
+     */
+    @Test
+    public void testCheckUpload() {
+        new ValidateUploadHook().checkUpload(new APIDataSet());
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java	(revision 9675)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUITest.java	(revision 9675)
@@ -0,0 +1,31 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.oauth;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+
+/**
+ * Unit tests of {@link FullyAutomaticAuthorizationUI} class.
+ */
+public class FullyAutomaticAuthorizationUITest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link FullyAutomaticAuthorizationUI#FullyAutomaticAuthorizationUI}.
+     */
+    @Test
+    public void testFullyAutomaticAuthorizationUI() {
+        assertNotNull(new FullyAutomaticAuthorizationUI("", Main.worker));
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java	(revision 9675)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUITest.java	(revision 9675)
@@ -0,0 +1,31 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.oauth;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+
+/**
+ * Unit tests of {@link ManualAuthorizationUI} class.
+ */
+public class ManualAuthorizationUITest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link ManualAuthorizationUI#ManualAuthorizationUI}.
+     */
+    @Test
+    public void testManualAuthorizationUI() {
+        assertNotNull(new ManualAuthorizationUI("", Main.worker));
+    }
+}
Index: trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java	(revision 9675)
+++ trunk/test/unit/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUITest.java	(revision 9675)
@@ -0,0 +1,31 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.oauth;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+
+/**
+ * Unit tests of {@link SemiAutomaticAuthorizationUI} class.
+ */
+public class SemiAutomaticAuthorizationUITest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Unit test of {@link SemiAutomaticAuthorizationUI#SemiAutomaticAuthorizationUI}.
+     */
+    @Test
+    public void testSemiAutomaticAuthorizationUI() {
+        assertNotNull(new SemiAutomaticAuthorizationUI("", Main.worker));
+    }
+}
