Revision 7586
Added by ben leinfelder over 11 years ago
metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/ApplicationControllerIT.java | ||
---|---|---|
1 | 1 |
package edu.ucsb.nceas.metacat.index; |
2 | 2 |
|
3 |
import static org.junit.Assert.assertEquals; |
|
4 | 3 |
import static org.junit.Assert.assertTrue; |
5 | 4 |
|
6 | 5 |
import java.util.List; |
7 | 6 |
|
8 | 7 |
import org.dataone.cn.indexer.parser.IDocumentSubprocessor; |
9 | 8 |
import org.dataone.cn.indexer.parser.ScienceMetadataDocumentSubprocessor; |
10 |
import org.dataone.configuration.Settings; |
|
11 | 9 |
import org.junit.Test; |
12 | 10 |
|
13 | 11 |
public class ApplicationControllerIT { |
14 |
public static final String pathToHazelcastFile = "../lib/hazelcast.xml"; |
|
15 | 12 |
|
16 | 13 |
/** |
17 | 14 |
* Test lookup from default properties file |
18 | 15 |
*/ |
19 | 16 |
@Test |
20 | 17 |
public void testConstructor() { |
21 |
Settings.getConfiguration().setProperty("dataone.hazelcast.configFilePath", pathToHazelcastFile); |
|
22 | 18 |
ApplicationController controller = new ApplicationController(); |
23 | 19 |
List<SolrIndex> list = controller.getSolrIndexes(); |
24 | 20 |
assertTrue(list.size() == 1); |
metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexIT.java | ||
---|---|---|
23 | 23 |
import org.apache.solr.common.params.SolrParams; |
24 | 24 |
import org.apache.solr.core.CoreContainer; |
25 | 25 |
import org.apache.solr.servlet.SolrRequestParsers; |
26 |
import org.dataone.configuration.Settings; |
|
27 | 26 |
import org.dataone.service.types.v1.SystemMetadata; |
28 | 27 |
import org.dataone.service.util.TypeMarshaller; |
29 |
import org.junit.Ignore; |
|
30 | 28 |
import org.junit.Test; |
31 | 29 |
import org.xml.sax.SAXException; |
32 | 30 |
|
... | ... | |
118 | 116 |
}*/ |
119 | 117 |
|
120 | 118 |
private SolrIndex generateSolrIndex() throws Exception { |
121 |
Settings.getConfiguration().setProperty("dataone.hazelcast.configFilePath", ApplicationControllerIT.pathToHazelcastFile); |
|
122 | 119 |
ApplicationController controller = new ApplicationController(); |
123 | 120 |
List<SolrIndex> list = controller.getSolrIndexes(); |
124 | 121 |
SolrIndex[] solrIndexesarray = list.toArray(new SolrIndex[list.size()]); |
Also available in: Unified diff
rely on Settings loaded from test resources config rather than hardcoding the paths in code. https://projects.ecoinformatics.org/ecoinfo/issues/5918