LocalStorage { public LocalObject load(String pid, File foxml) { DigitalObject dobj = FoxmlUtils.unmarshal(new StreamSource(foxml), DigitalObject.class); LocalObject result = new LocalObject(pid, foxml, dobj); return result; }  LocalObject load(String pid, File foxml); LocalObject create(); LocalObject create(String pid); LocalObject create(DigitalObject dobj); LocalObject create(File foxml, DigitalObject dobj); LocalObject create(File foxml); LocalObject create(String pid, File foxml);  }
@Test public void testLoad() throws Exception { File foxml = tmp.newFile(); String pid = "PID"; DigitalObject dobj = FoxmlUtils.createFoxml(pid); FoxmlUtils.marshal(new StreamResult(foxml), dobj, true); assertTrue(foxml.length() > 0); LocalStorage instance = new LocalStorage(); LocalObject result = instance.load(pid, foxml); assertLocalObject(result); assertEquals(pid, result.getPid()); assertEquals(pid, result.getDigitalObject().getPID()); assertEquals(foxml, result.getFoxml()); }