Index: test/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
===================================================================
--- test/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 266)
+++ test/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 267)
@@ -44,11 +44,4 @@
 	}
 
-	public void testHashCodeReturnsIdIfNotZeroAndNotZeroIfIdIsZero() {
-		osm.id = 23;
-		assertEquals(23, osm.hashCode());
-		osm.id = 0;
-		assertTrue(0 != osm.hashCode());
-	}
-
 	public void testVisit() {
 		osm.visit(new Visitor(){
Index: test/org/openstreetmap/josm/plugins/PluginExceptionTest.java
===================================================================
--- test/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 266)
+++ test/org/openstreetmap/josm/plugins/PluginExceptionTest.java	(revision 267)
@@ -9,5 +9,5 @@
 		PluginException e = new PluginException(new PluginProxy(new String(), null), "42", barEx);
 		assertEquals(barEx, e.getCause());
-		assertEquals("42", e.getName());
+		assertEquals("42", e.name);
 	}
 
Index: test/org/openstreetmap/josm/plugins/PluginInformationTest.java
===================================================================
--- test/org/openstreetmap/josm/plugins/PluginInformationTest.java	(revision 266)
+++ test/org/openstreetmap/josm/plugins/PluginInformationTest.java	(revision 267)
@@ -1,23 +1,101 @@
 package org.openstreetmap.josm.plugins;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.jar.JarInputStream;
 
 import junit.framework.TestCase;
 
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Preferences;
+
 public class PluginInformationTest extends TestCase {
+
+	@Override protected void setUp() throws Exception {
+	    super.setUp();
+	    Main.pref = new Preferences(){
+        	@Override public Collection<String> getAllPossiblePreferenceDirs() {
+        		return Arrays.asList(new String[]{getClass().getResource("..").getFile()});
+            }
+        };
+	}
 
 	public void testConstructorExtractsAttributesFromManifest() throws Exception {
 		PluginInformation info = new PluginInformation(new File(getClass().getResource("simple.jar").getFile()));
 		String s = getClass().getResource(".").getFile();
-		
-		assertEquals(4, info.libraries.size());
-		assertEquals(s+"foo", info.libraries.get(1).getFile());
-		assertEquals(s+"bar", info.libraries.get(2).getFile());
-		assertEquals(s+"C:/Foo%20and%20Bar", info.libraries.get(3).getFile());
-		
-		assertEquals("imi", info.author);
-		assertEquals("Simple", info.className);
-		assertEquals("Simpler", info.description);
-		assertEquals(true, info.early);
+        assertEquals(4, info.libraries.size());
+        assertEquals(s+"foo", info.libraries.get(1).getFile());
+        assertEquals(s+"bar", info.libraries.get(2).getFile());
+        assertEquals(s+"C:/Foo%20and%20Bar", info.libraries.get(3).getFile());
+        
+        assertEquals("imi", info.author);
+        assertEquals("Simple", info.className);
+        assertEquals("Simpler", info.description);
+        assertEquals(true, info.early);
+    }
+
+	public void testConstructorRequiresJarWithManifest() throws Exception {
+		try {
+	        new PluginInformation(new File(getClass().getResource("no_manifest.jar").getFile()));
+	        fail("Exception because missing manifest excpected");
+        } catch (PluginException e) {
+        }
+    }
+	
+	public void testConstructorWithInputStream() throws Exception {
+		JarInputStream f = new JarInputStream(getClass().getResourceAsStream("simple.jar"));
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		f.getManifest().write(out);
+
+		PluginInformation info = new PluginInformation(null, "simple", new ByteArrayInputStream(out.toByteArray()));
+        assertEquals("Only the 3 external classpaths are added (as we are using bootstrap classpath for plugin",
+        		3, info.libraries.size());
+    }
+	
+	public void testLoadClassInstantiatePlugin() throws Exception {
+		PluginInformation info = new PluginInformation(new File(getClass().getResource("working.jar").getFile()));
+		ClassLoader cl = new URLClassLoader(new URL[]{getClass().getResource("working.jar")});
+		assertNotNull(info.load(info.loadClass(cl)));
+    }
+	
+	// This is so the bugtracker always detect coding problems as "plugin problems"
+	public void testLoadThrowsPluginExceptionOnRuntimeException() throws Exception {
+		PluginInformation info = new PluginInformation(new File(getClass().getResource("working.jar").getFile()));
+		try {
+	        info.load(null);
+	        fail("Exception excpected because null-Class");
+        } catch (PluginException e) {
+        }
+        try {
+        	info.loadClass(null);
+        	fail("Exception excpected because null-ClassLoader");
+        } catch (PluginException e) {
+        }
+    }
+	
+	public void testFindPluginReturnsInformationFromBootstrapClasspath() throws Exception {
+	    PluginInformation info = PluginInformation.findPlugin("test_simple");
+	    assertEquals("Simpler", info.description);
+    }
+	
+	public void testFindPluginReturnsFromPreferencesDirs() throws Exception {
+	    PluginInformation info = PluginInformation.findPlugin("simple");
+	    assertEquals("Simpler", info.description);
+    }
+	
+	public void testFindPluginForUnknownReturnsNull() throws Exception {
+		assertNull(PluginInformation.findPlugin("asdf"));
+	}
+
+	public void testPluginLocationsReturnModifiedPreferenceLocations() throws Exception {
+	    setUp();
+	    Collection<String> locations = PluginInformation.getPluginLocations();
+	    assertEquals(1, locations.size());
+	    assertTrue(locations.iterator().next().endsWith("/plugins"));
     }
 }
Index: test/org/openstreetmap/josm/plugins/test_simple/MANIFEST.MF
===================================================================
--- test/org/openstreetmap/josm/plugins/test_simple/MANIFEST.MF	(revision 267)
+++ test/org/openstreetmap/josm/plugins/test_simple/MANIFEST.MF	(revision 267)
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Created-By: 1.5.0_07 (Sun Microsystems Inc.)
+Plugin-Class: Simple
+Plugin-Description: Simpler
+
Index: test/org/openstreetmap/josm/tools/XmlObjectParserTest.java
===================================================================
--- test/org/openstreetmap/josm/tools/XmlObjectParserTest.java	(revision 266)
+++ test/org/openstreetmap/josm/tools/XmlObjectParserTest.java	(revision 267)
@@ -52,34 +52,4 @@
 	}
 
-	public void testManyTags() throws Exception {
-		StringBuilder b = new StringBuilder("<all>");
-		for (int i = 0; i < 50000; ++i) {
-			if (Math.random() > 0.5) {
-				b.append("<foo bar='blob");
-				b.append(i);
-				b.append("'/>");
-			} else {
-				b.append("<foo><bar>yuppel");
-				b.append(i);
-				b.append("</bar></foo>");
-			}
-		}
-		b.append("</all>");
-
-		System.gc();
-		long memBefore = Runtime.getRuntime().freeMemory();
-		parser = createParser(b.toString());
-		Thread.sleep(300);
-		System.gc();
-		long memAfter = Runtime.getRuntime().freeMemory();
-		assertTrue("2MB should be more than enough. "+(memAfter-memBefore), memAfter-memBefore < 2*1024*1024);
-
-		for (int i = 0; i < 50000; ++i) {
-			Foo f = (Foo)parser.next();
-			assertTrue(f.bar.equals("blob"+i) || f.bar.equals("yuppel"+i));
-		}
-		assertFalse(parser.hasNext());
-	}
-
 	public void testIterable() throws Exception {
 		parser = createParser("<xml><foo bar='yo'/><foo bar='yo'/><foo bar='yo'/></xml>");
