Revision 9495
Added by Jing Tao almost 9 years ago
test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java | ||
---|---|---|
1378 | 1378 |
ObjectFormatIdentifier format = new ObjectFormatIdentifier(); |
1379 | 1379 |
format.setValue("application/bagit-097"); |
1380 | 1380 |
InputStream bagStream = MNodeService.getInstance(request).getPackage(session, format, pid); |
1381 |
File bagFile = File.createTempFile("bagit.", ".zip"); |
|
1381 |
/*File bagFile = File.createTempFile("bagit.", ".zip");
|
|
1382 | 1382 |
IOUtils.copy(bagStream, new FileOutputStream(bagFile)); |
1383 | 1383 |
BagFactory bagFactory = new BagFactory(); |
1384 | 1384 |
Bag bag = bagFactory.createBag(bagFile); |
... | ... | |
1392 | 1392 |
assertTrue(IOUtils.contentEquals(result, object)); |
1393 | 1393 |
|
1394 | 1394 |
// clean up |
1395 |
bagFile.delete(); |
|
1395 |
bagFile.delete();*/
|
|
1396 | 1396 |
|
1397 |
} catch(InvalidRequest e) { |
|
1398 |
|
|
1397 | 1399 |
} catch (Exception e) { |
1398 | 1400 |
e.printStackTrace(); |
1399 | 1401 |
fail("Unexpected error: " + e.getMessage()); |
Also available in: Unified diff
The getPackage method should throw an exception since the id is a data object.