Index: test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java
===================================================================
--- test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java	(revision 6754)
+++ test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java	(revision 6755)
@@ -25,32 +25,26 @@
 
 package edu.ucsb.nceas.metacat.dataone;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.math.BigInteger;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
 import java.util.Date;
 
 import org.apache.wicket.protocol.http.MockHttpServletRequest;
 import org.dataone.client.ObjectFormatCache;
-import org.dataone.service.util.Constants;
-import org.dataone.service.util.TypeMarshaller;
-import org.dataone.service.types.v1.util.ObjectFormatServiceImpl;
 import org.dataone.service.types.v1.AccessPolicy;
 import org.dataone.service.types.v1.AccessRule;
 import org.dataone.service.types.v1.Checksum;
 import org.dataone.service.types.v1.Identifier;
 import org.dataone.service.types.v1.NodeReference;
-import org.dataone.service.types.v1.ObjectFormatList;
 import org.dataone.service.types.v1.Permission;
 import org.dataone.service.types.v1.Session;
 import org.dataone.service.types.v1.Subject;
 import org.dataone.service.types.v1.SystemMetadata;
+import org.dataone.service.types.v1.util.ChecksumUtil;
+import org.dataone.service.types.v1.util.ObjectFormatServiceImpl;
+import org.dataone.service.util.Constants;
 
 import edu.ucsb.nceas.MCTestCase;
 import edu.ucsb.nceas.metacat.client.Metacat;
@@ -95,10 +89,7 @@
         session.setSubject(subject);
         return session;
 	}
-	
-	
-	
-	
+
 	/**
 	 * Run an initial test that always passes to check that the test harness is
 	 * working.
@@ -108,42 +99,8 @@
 	    printTestHeader("initialize");
 		assertTrue(1 == 1);
 	}
-		
-    private static String checksum(InputStream is) throws NoSuchAlgorithmException, IOException {
-        byte[] buffer = new byte[1024];
-        MessageDigest complete = MessageDigest.getInstance("MD5");
-        int numRead;
-
-        do {
-            numRead = is.read(buffer);
-            if (numRead > 0) {
-                complete.update(buffer, 0, numRead);
-            }
-        } while (numRead != -1);
-
-        // rest to beginning -- not all streams support this
-        is.reset();
-        
-        String csStr = getHex(complete.digest());
-        return csStr;
-    }
 	
 	/**
-     * convert a byte array to a hex string
-     */
-    private static String getHex(byte[] raw) {
-        final String HEXES = "0123456789ABCDEF";
-        if (raw == null) {
-            return null;
-        }
-        final StringBuilder hex = new StringBuilder(2 * raw.length);
-        for (final byte b : raw) {
-            hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
-        }
-        return hex.toString();
-    }
-	
-	/**
 	 * create system metadata with a specified id
 	 */
 	public SystemMetadata createSystemMetadata(Identifier id, Subject owner, InputStream object)
@@ -155,14 +112,14 @@
         sm.setIdentifier(id);
         sm.setFormatId(ObjectFormatCache.getInstance().getFormat("application/octet-stream").getFormatId());
         // create the checksum
-        String checksumS = "test";
+        Checksum checksum = new Checksum();
+        String ca = "MD5";
+        checksum.setValue("test");
+        checksum.setAlgorithm(ca);
+        // actually generate one
         if (object != null) {
-        	checksumS = checksum(object);
+            checksum = ChecksumUtil.checksum(object, ca);
         }
-        String ca = "MD5";
-        Checksum checksum = new Checksum();
-        checksum.setValue(checksumS);
-        checksum.setAlgorithm(ca);
         sm.setChecksum(checksum);
         // set the size
         sm.setSize(new BigInteger("0"));
@@ -203,10 +160,9 @@
 				// probably missing the doc
 			}
 			if (is == null) {
-				ObjectFormatList formats = ObjectFormatServiceImpl.getInstance().listFormats();
-				ByteArrayOutputStream out = new ByteArrayOutputStream();
-				TypeMarshaller.marshalTypeToOutputStream(formats, out);
-				Reader xmlDocument = new InputStreamReader(new ByteArrayInputStream(out.toByteArray()));
+				// get the default from d1_common
+				InputStream formats = ObjectFormatServiceImpl.getInstance().getObjectFormatFile();
+				Reader xmlDocument = new InputStreamReader(formats);
 				m.insert(ObjectFormatService.OBJECT_FORMAT_DOCID + ".1", xmlDocument, null);
 			}
 			m.logout();
