Revision 9252
Added by Jing Tao over 9 years ago
test/edu/ucsb/nceas/metacattest/IdentifierManagerTest.java | ||
---|---|---|
1487 | 1487 |
} |
1488 | 1488 |
|
1489 | 1489 |
public void testQuerySystemMetadata() throws Exception { |
1490 |
String nodeIdStr="rtgf:test:ert"; |
|
1490 | 1491 |
Date startTime = null; |
1491 | 1492 |
Date endTime = null; |
1492 | 1493 |
ObjectFormatIdentifier objectFormatId = null; |
... | ... | |
1512 | 1513 |
objectFormatId, nodeId, start, count, identifier, isSID); |
1513 | 1514 |
int size3 = list.sizeObjectInfoList(); |
1514 | 1515 |
assertTrue(size3==0); |
1516 |
|
|
1517 |
Session session = getTestSession(); |
|
1518 |
Identifier guid = new Identifier(); |
|
1519 |
guid.setValue(generateDocumentId()); |
|
1520 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
|
1521 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object); |
|
1522 |
nodeId.setValue(nodeIdStr); |
|
1523 |
sysmeta.setAuthoritativeMemberNode(nodeId); |
|
1524 |
String sid1= "sid."+System.nanoTime(); |
|
1525 |
Identifier seriesId = new Identifier(); |
|
1526 |
seriesId.setValue(sid1); |
|
1527 |
System.out.println("the first sid is "+seriesId.getValue()); |
|
1528 |
sysmeta.setSeriesId(seriesId); |
|
1529 |
MNodeService.getInstance(request).create(session, guid, object, sysmeta); |
|
1530 |
Thread.sleep(5000); |
|
1531 |
list = IdentifierManager.getInstance().querySystemMetadata(startTime, endTime, |
|
1532 |
objectFormatId, nodeId, start, count, identifier, isSID); |
|
1533 |
int size4 = list.sizeObjectInfoList(); |
|
1534 |
assertTrue(size4 > 0); |
|
1515 | 1535 |
} |
1516 | 1536 |
|
1517 | 1537 |
/** |
Also available in: Unified diff
Insert a document with different authoritative node id. So we can test querySystemMetadata by more cases.