1 |
7542
|
tao
|
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 |
7582
|
leinfelder
|
public class ApplicationControllerIT {
|
12 |
7542
|
tao
|
|
13 |
|
|
/**
|
14 |
|
|
* Test lookup from default properties file
|
15 |
|
|
*/
|
16 |
|
|
@Test
|
17 |
7613
|
tao
|
public void testConstructor() throws Exception {
|
18 |
8129
|
tao
|
String springConfigFile = "/index-processor-context.xml";
|
19 |
7784
|
tao
|
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 |
7542
|
tao
|
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 |
|
|
}
|