1
|
package edu.ucsb.nceas.metacat.index;
|
2
|
|
3
|
import static org.junit.Assert.assertTrue;
|
4
|
|
5
|
import java.util.List;
|
6
|
|
7
|
import org.dataone.cn.indexer.parser.IDocumentSubprocessor;
|
8
|
import org.dataone.cn.indexer.parser.ScienceMetadataDocumentSubprocessor;
|
9
|
import org.junit.Test;
|
10
|
|
11
|
public class ApplicationControllerIT {
|
12
|
|
13
|
/**
|
14
|
* Test lookup from default properties file
|
15
|
*/
|
16
|
@Test
|
17
|
public void testConstructor() throws Exception {
|
18
|
String springConfigFile = "/index-processor-context.xml";
|
19
|
String metacatPropertyFile = null; //in this test, we use the test.properties file rather than metacat.properties file. so set it to be null.
|
20
|
ApplicationController controller = new ApplicationController(springConfigFile, metacatPropertyFile);
|
21
|
controller.initialize();
|
22
|
List<SolrIndex> list = controller.getSolrIndexes();
|
23
|
assertTrue(list.size() == 1);
|
24
|
SolrIndex[] solrIndexesarray = list.toArray(new SolrIndex[list.size()]);
|
25
|
SolrIndex index = solrIndexesarray[0];
|
26
|
List<IDocumentSubprocessor> subprocessors = index.getSubprocessors();
|
27
|
IDocumentSubprocessor[] subprocessorArray = subprocessors.toArray(new IDocumentSubprocessor[subprocessors.size()]);
|
28
|
assertTrue(subprocessorArray[0] instanceof ScienceMetadataDocumentSubprocessor);
|
29
|
}
|
30
|
|
31
|
}
|