Revision 8848
Added by Lauren Walker over 10 years ago
test/edu/ucsb/nceas/metacat/dataone/InsertORETest.java | ||
---|---|---|
34 | 34 |
import java.io.ByteArrayInputStream; |
35 | 35 |
import java.io.ByteArrayOutputStream; |
36 | 36 |
import java.io.File; |
37 |
import java.io.FileReader; |
|
38 |
import java.io.FileInputStream; |
|
37 | 39 |
import java.io.FileOutputStream; |
38 | 40 |
import java.io.IOException; |
39 | 41 |
import java.io.InputStream; |
... | ... | |
252 | 254 |
sysmeta = createSystemMetadata(composeActivityId, session.getSubject(), dataObject4); |
253 | 255 |
MNodeService.getInstance(request).create(session, composeActivityId, dataObject4, sysmeta); |
254 | 256 |
// metadata file |
255 |
InputStream metadataObject = new ByteArrayInputStream(metadataId.getValue().getBytes("UTF-8")); |
|
256 |
sysmeta = createSystemMetadata(metadataId, session.getSubject(), metadataObject); |
|
257 |
String testfile = "test/eml-sample.xml"; |
|
258 |
InputStream metadataObject = new FileInputStream(testfile); |
|
259 |
sysmeta = createSystemMetadata(metadataId, session.getSubject(), null); |
|
260 |
sysmeta.setFormatId(ObjectFormatCache.getInstance().getFormat("eml://ecoinformatics.org/eml-2.1.0").getFormatId()); |
|
257 | 261 |
MNodeService.getInstance(request).create(session, metadataId, metadataObject, sysmeta); |
258 | 262 |
|
259 | 263 |
// save the ORE object |
Also available in: Unified diff
In InsertORETest: Set the format ID of the metadata object to an EML formatId so that it gets indexed correctly.