Index: test/org/openstreetmap/josm/plugins/PluginExceptionTest.java
===================================================================
--- test/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 149)
+++ test/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 149)
@@ -0,0 +1,18 @@
+package org.openstreetmap.josm.plugins;
+
+import junit.framework.TestCase;
+
+public class PluginExceptionTest extends TestCase {
+
+	public void testConstructorPassesExceptionParameterAndSetPluginName() {
+		RuntimeException barEx = new RuntimeException("bar");
+		PluginException e = new PluginException(new PluginProxy(new String(), "42"), "42", barEx);
+		assertEquals(barEx, e.getCause());
+		assertEquals("42", e.getName());
+	}
+
+	public void testMessageContainsThePluginName() {
+		PluginException e = new PluginException(new PluginProxy(new String(), "42"), "42", new RuntimeException());
+		assertTrue(e.getMessage().contains("42"));
+	}
+}
Index: test/org/openstreetmap/josm/plugins/PluginLoaderTest.java
===================================================================
--- test/org/openstreetmap/josm/plugins/PluginLoaderTest.java	(revision 149)
+++ test/org/openstreetmap/josm/plugins/PluginLoaderTest.java	(revision 149)
@@ -0,0 +1,39 @@
+package org.openstreetmap.josm.plugins;
+
+import java.io.File;
+import java.lang.reflect.Field;
+
+import junit.framework.TestCase;
+
+public class PluginLoaderTest extends TestCase {
+
+	public static class TestPlugin extends Plugin {
+		public TestPlugin() {
+	        super();
+        }
+	}
+
+	private PluginLoader loader;
+
+	@Override protected void setUp() throws Exception {
+		super.setUp();
+		loader = new PluginLoader();
+	}
+
+	public void testLoadPluginCallsStandardConstructor() throws Exception {
+		PluginProxy plugin = loader.loadPlugin(getClass().getName()+"$TestPlugin", new File("foo.jar"));
+		assertTrue(plugin.plugin instanceof TestPlugin);
+		Field nameField = Plugin.class.getDeclaredField("name");
+		nameField.setAccessible(true);
+		assertEquals("foo", nameField.get(plugin.plugin));
+	}
+	
+	public void testLoadPluginLoadsAllClasses() throws Exception {
+		File classFile = new File(getClass().getResource("simple.jar").toURI());
+		
+		PluginProxy plugin = loader.loadPlugin("Simple", classFile);
+
+		assertNotNull(plugin.plugin);
+		assertEquals("simple", plugin.name);
+	}
+}
