Project

General

Profile

« Previous | Next » 

Revision 7571

Added by Jing Tao over 11 years ago

Set the hazelcast.xml path for the test.

View differences:

metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/ApplicationControllerTest.java
11 11
import org.junit.Test;
12 12

  
13 13
public class ApplicationControllerTest {
14
    public static final String pathToHazelcastFile = "../lib/hazelcast.xml";
14 15
    
15 16
    /**
16 17
     * Test lookup from default properties file
17 18
     */
18 19
    @Test
19 20
    public void testConstructor() {
21
        Settings.getConfiguration().setProperty("dataone.hazelcast.configFilePath", pathToHazelcastFile);
20 22
        ApplicationController controller = new ApplicationController();
21 23
        List<SolrIndex> list = controller.getSolrIndexes();
22 24
        assertTrue(list.size() == 1);
metacat-index/src/test/java/edu/ucsb/nceas/metacat/index/SolrIndexTest.java
17 17
import org.apache.solr.common.SolrDocumentList;
18 18
import org.apache.solr.common.params.SolrParams;
19 19
import org.apache.solr.servlet.SolrRequestParsers;
20
import org.dataone.configuration.Settings;
20 21
import org.dataone.service.types.v1.SystemMetadata;
21 22
import org.dataone.service.util.TypeMarshaller;
22 23
import org.junit.Test;
......
26 27
    private static final String SYSTEMMETAFILEPATH = "src/test/resources/eml-system-meta-example.xml";
27 28
    private static final String EMLFILEPATH = "src/test/resources/eml-example.xml";
28 29
    private static final String id = "urn:uuid:606a19dd-b531-4bf4-b5a5-6d06c3d39098";
30
   
29 31
    
30 32
    /**
31 33
     * Test building index for an insert.
......
51 53
    }
52 54
    
53 55
    private SolrIndex generateSolrIndex() throws Exception {
56
        Settings.getConfiguration().setProperty("dataone.hazelcast.configFilePath", ApplicationControllerTest.pathToHazelcastFile);
54 57
        ApplicationController controller = new ApplicationController();
55 58
        List<SolrIndex> list = controller.getSolrIndexes();
56 59
        SolrIndex[] solrIndexesarray = list.toArray(new SolrIndex[list.size()]);

Also available in: Unified diff