Project

General

Profile

« Previous | Next » 

Revision 8648

test that obsoleted objects remain indexed, but are marked as obsoleted. https://projects.ecoinformatics.org/ecoinfo/issues/6424

View differences:

metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexIT.java
108 108
       String result = doQuery(solrIndex.getSolrServer());
109 109
       assertTrue(result.contains("version1"));
110 110
       assertTrue(result.contains("version2"));
111
       
112
       // have to re-index the older version
113
       Identifier obsoletedPid = systemMetadata.getObsoletes();
114
       SystemMetadata obsoletedSystemMetadata = TypeMarshaller.unmarshalTypeFromFile(SystemMetadata.class, SYSTEMMETAFILEPATH);
115
       assertTrue(obsoletedSystemMetadata.getIdentifier().getValue().equals(obsoletedPid.getValue()));
116
       obsoletedSystemMetadata.setObsoletedBy(pid);
117
       InputStream obsoletedEmlInputStream = new FileInputStream(new File(EMLFILEPATH));  
118
       solrIndex.update(obsoletedPid, obsoletedSystemMetadata, obsoletedEmlInputStream);
119
       
120
       // old version should be marked as obsoleted and not returned
121
       result = doQuery(solrIndex.getSolrServer(), "&fq=-obsoletedBy:*");
122
       assertTrue(!result.contains("version1"));
123
       assertTrue(result.contains("version2"));
111 124
    }
112 125
    
113 126
    /**

Also available in: Unified diff