@Test public void testAddDevice() throws Exception { String owner = "junit"; String log = "testAddDevice_log"; String model = "proarc:device"; Device expected = new Device(); expected.setLabel("testAddDevice"); Device result = repository.addDevice(owner, model, expected.getLabel(), log); expected.setId(result.getId()); assertDeviceEquals(expected, result); assertNotNull(result.getId()); List<Device> found = repository.find(result.getId()); assertDeviceEquals(expected, found); }
public Device addDevice(String owner, String model, String label, String log) throws DeviceException { UUID uuid = UUID.randomUUID(); String pid = DEVICE_ID_PREFIX + uuid.toString(); try { return addDevice(pid, owner, model, label, log); } catch (DigitalObjectException ex) { throw new DeviceException(pid, ex); } }
DeviceRepository { public Device addDevice(String owner, String model, String label, String log) throws DeviceException { UUID uuid = UUID.randomUUID(); String pid = DEVICE_ID_PREFIX + uuid.toString(); try { return addDevice(pid, owner, model, label, log); } catch (DigitalObjectException ex) { throw new DeviceException(pid, ex); } } }
DeviceRepository { public Device addDevice(String owner, String model, String label, String log) throws DeviceException { UUID uuid = UUID.randomUUID(); String pid = DEVICE_ID_PREFIX + uuid.toString(); try { return addDevice(pid, owner, model, label, log); } catch (DigitalObjectException ex) { throw new DeviceException(pid, ex); } } DeviceRepository(RemoteStorage remoteStorage); }
DeviceRepository { public Device addDevice(String owner, String model, String label, String log) throws DeviceException { UUID uuid = UUID.randomUUID(); String pid = DEVICE_ID_PREFIX + uuid.toString(); try { return addDevice(pid, owner, model, label, log); } catch (DigitalObjectException ex) { throw new DeviceException(pid, ex); } } DeviceRepository(RemoteStorage remoteStorage); Device addDevice(String owner, String model, String label, String log); boolean deleteDevice(String id, String log); List<Device> find(String id); List<Device> find(String id, boolean fetchDescription, int offset); Device update(Device update, String log); List<Device> findAllDevices(int offset); static XmlStreamEditor getMixDescriptionEditor(FedoraObject robj); static XmlStreamEditor getPremisDescriptionEditor(FedoraObject robj); XmlStreamEditor getDescriptionEditor(String id); Mets repairNkComplexType(Mets mets); }
DeviceRepository { public Device addDevice(String owner, String model, String label, String log) throws DeviceException { UUID uuid = UUID.randomUUID(); String pid = DEVICE_ID_PREFIX + uuid.toString(); try { return addDevice(pid, owner, model, label, log); } catch (DigitalObjectException ex) { throw new DeviceException(pid, ex); } } DeviceRepository(RemoteStorage remoteStorage); Device addDevice(String owner, String model, String label, String log); boolean deleteDevice(String id, String log); List<Device> find(String id); List<Device> find(String id, boolean fetchDescription, int offset); Device update(Device update, String log); List<Device> findAllDevices(int offset); static XmlStreamEditor getMixDescriptionEditor(FedoraObject robj); static XmlStreamEditor getPremisDescriptionEditor(FedoraObject robj); XmlStreamEditor getDescriptionEditor(String id); Mets repairNkComplexType(Mets mets); static final String DESCRIPTION_DS_ID; static final String AUDIODESCRIPTION_DS_ID; static final String DESCRIPTION_DS_LABEL; static final String AUDIO_DESCRIPTION_DS_LABEL; static final String METAMODEL_ID; static final String METAMODEL_AUDIODEVICE_ID; static final String METAMODEL_ID_LABEL; static final String METAMODEL_AUDIODEVICE_ID_LABEL; }