Revision 10296
Added by Jing Tao over 7 years ago
test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java | ||
---|---|---|
607 | 607 |
Identifier pid = |
608 | 608 |
MNodeService.getInstance(request).create(session, guid, object, sysmeta); |
609 | 609 |
|
610 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
610 | 611 |
SystemMetadata newSysMeta = createSystemMetadata(newPid, session.getSubject(), object); |
611 | 612 |
newSysMeta.setArchived(true); |
612 | 613 |
System.out.println("the pid is =======!!!!!!!!!!!! "+pid.getValue()); |
... | ... | |
625 | 626 |
//try to update an archived object and need to get an exception |
626 | 627 |
Identifier newPid2 = new Identifier(); |
627 | 628 |
newPid2.setValue("testUpdate." + (System.currentTimeMillis() + 2)); // ensure it is different from original |
629 |
object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
628 | 630 |
SystemMetadata newSysMeta2 = createSystemMetadata(newPid2, session.getSubject(), object); |
629 | 631 |
try { |
630 | 632 |
updatedPid = |
... | ... | |
1722 | 1724 |
|
1723 | 1725 |
Identifier newPid = new Identifier(); |
1724 | 1726 |
newPid.setValue("testCreateAndUpdate." + (System.currentTimeMillis() + 1)); // ensure it is different from original |
1727 |
object = new ByteArrayInputStream(FileUtils.readFileToByteArray(new File(unmatchingEncodingFilePath))); |
|
1725 | 1728 |
SystemMetadata newSysMeta = createSystemMetadata(newPid, session.getSubject(), object); |
1726 | 1729 |
|
1727 | 1730 |
// do the update |
Also available in: Unified diff
Reget the object inputstream in order to calculate the correct checksum.