Index: test/edu/ucsb/nceas/metacat/dataone/CrudServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/CrudServiceTest.java	(nonexistent)
+++ test/edu/ucsb/nceas/metacat/dataone/CrudServiceTest.java	(revision 5335)
@@ -0,0 +1,87 @@
+/**
+ *  '$RCSfile$'
+ *  Copyright: 2010 Regents of the University of California and the
+ *              National Center for Ecological Analysis and Synthesis
+ *  Purpose: To test the Access Controls in metacat by JUnit
+ *
+ *   '$Author: berkley $'
+ *     '$Date: 2010-05-03 14:26:08 -0700 (Fri, 14 Aug 2009) $'
+ * '$Revision: 5027 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.dataone;
+
+import java.util.*;
+import java.io.*;
+
+import edu.ucsb.nceas.MCTestCase;
+import edu.ucsb.nceas.metacat.client.MetacatAuthException;
+import edu.ucsb.nceas.metacat.client.MetacatException;
+import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
+import edu.ucsb.nceas.metacat.dataone.CrudService;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * A JUnit test for testing the dataone CrudService class
+ */
+public class CrudServiceTest extends MCTestCase 
+{
+  /**
+   * consstructor for the test
+   */
+  public CrudServiceTest(String name)
+  {
+    super(name);
+  }
+  
+  /**
+	 * Establish a testing framework by initializing appropriate objects
+	 */
+	public void setUp() throws Exception 
+	{
+		super.setUp();
+	}
+
+	/**
+	 * Release any objects after tests are complete
+	 */
+	public void tearDown() 
+	{
+	}
+
+	/**
+	 * Create a suite of tests to be run together
+	 */
+	public static Test suite() 
+	{
+		TestSuite suite = new TestSuite();
+		suite.addTest(new CrudServiceTest("initialize"));
+
+		return suite;
+	}
+
+	/**
+	 * Run an initial test that always passes to check that the test harness is
+	 * working.
+	 */
+	public void initialize() 
+	{
+		assertTrue(1 == 1);
+	}
+  
+}
Index: test/edu/ucsb/nceas/metacattest/IdentifierManagerTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/IdentifierManagerTest.java	(revision 5334)
+++ test/edu/ucsb/nceas/metacattest/IdentifierManagerTest.java	(revision 5335)
@@ -105,20 +105,60 @@
     
     /**
      * Test that we are able to create mappings from guids to localIds, and that
-     * improperly formatted docids generate the proper exceptions.
+     * improperly formatted docids generate the proper exceptions.  This also tests
+     * getLocalId() and getGUID()
      */
     public void testCreateMapping() {
-        IdentifierManager im = IdentifierManager.getInstance();
-        String docid = insertTestDocument();
-        im.createMapping("test:"+docid, docid);
-        try {
-            assertEquals(im.getLocalId("test:"+docid), docid);
+       try
+       {
+            IdentifierManager im = IdentifierManager.getInstance();
+            String docid = insertTestDocument();
+            String guid = "test:" + docid;
+            im.createMapping(guid, docid);
+            String guiddocid = docid.substring(0, docid.length() - 2);
+            System.out.println("guiddocid: " + guiddocid);
+            String guid2 = im.getGUID(guiddocid, 1);
+            assertTrue(guid2.equals(guid));
+            String docid2 = im.getLocalId(guid);
+            assertTrue(docid.equals(docid2));
         } catch (McdbDocNotFoundException e) {
-            fail("createMapping failed to create proper localId from guid.");
+            e.printStackTrace();
+            fail("createMapping failed to create proper localId from guid: " + e.getMessage());
         }
     }
+    
+    /**
+     * test createSystemMetadataMapping and getSystemMetadataId
+     */
+    public void testCreateSystemMetadataMapping()
+    {
+        try
+        {
+            IdentifierManager im = IdentifierManager.getInstance();
+            String docid = insertTestDocument();
+            String guid = "test:" + docid;
+            im.createSystemMetadataMapping(guid, docid);
+            String docid2 = im.getSystemMetadataId(guid);
+            assertTrue(docid2.equals(docid));
+        } catch (McdbDocNotFoundException e) {
+          e.printStackTrace();
+          fail("createSystemMetadataMapping failed to create proper localId from guid: " + e.getMessage());
+        }
+    }
+    
+    /**
+     * test the local id creation
+     */
+    public void testGenerateLocalId() {
+      IdentifierManager im = IdentifierManager.getInstance();
+      String localid = im.generateLocalId("mynewid.1.3.3.2", 1);
+      System.out.println("localid: " + localid);
+      assertTrue(localid != null);
+    }
 
-    /** Insert a test document, returning the docid that was used. */
+    /** 
+     * Insert a test document, returning the docid that was used. 
+     */
     private String insertTestDocument() {
         String accessBlock = getAccessBlock("public", true, true,
                 false, false, false);
