Revision 8745
Added by ben leinfelder over 10 years ago
test/edu/ucsb/nceas/metacat/dataone/MNodeServiceTest.java | ||
---|---|---|
1276 | 1276 |
|
1277 | 1277 |
// clean up |
1278 | 1278 |
bagFile.delete(); |
1279 |
|
|
1280 |
// test the ORE lookup |
|
1281 |
List<Identifier> oreIds = MNodeService.getInstance(request).lookupOreFor(metadataId, true); |
|
1282 |
assertTrue(oreIds.contains(resourceMapId)); |
|
1279 | 1283 |
|
1280 | 1284 |
} catch (Exception e) { |
1281 | 1285 |
e.printStackTrace(); |
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
1848 | 1848 |
String pid = guid.getValue(); |
1849 | 1849 |
List<Identifier> retList = null; |
1850 | 1850 |
try { |
1851 |
String query = "fl=id,resourceMap&wt=xml&q=-obsoletedBy:*+resourceMap:*+id:\"" + pid + "\"";;
|
|
1851 |
String query = "fl=id,resourceMap&wt=xml&q=-obsoletedBy:[* TO *]+resourceMap:[* TO *]+id:\"" + pid + "\"";
|
|
1852 | 1852 |
if (includeObsolete) { |
1853 |
query = "fl=id,resourceMap&wt=xml&q=resourceMap:*+id:\"" + pid + "\"";
|
|
1853 |
query = "fl=id,resourceMap&wt=xml&q=resourceMap:[* TO *]+id:\"" + pid + "\"";
|
|
1854 | 1854 |
} |
1855 | 1855 |
|
1856 | 1856 |
InputStream results = this.query("solr", query); |
Also available in: Unified diff
correct the ORE lookup query syntax and add junit assertion to check that it continues to function as expected. https://projects.ecoinformatics.org/ecoinfo/issues/6529