Project

General

Profile

« Previous | Next » 

Revision 7760

Added by Jing Tao over 11 years ago

Add a test base class.

View differences:

metacat-common/src/test/java/edu/ucsb/nceas/metacat/common/MetacatCommonTestBase.java
1
package edu.ucsb.nceas.metacat.common;
2

  
3
import java.io.FileInputStream;
4
import java.io.FileNotFoundException;
5
import java.io.IOException;
6
import java.util.Properties;
7

  
8
import org.apache.commons.configuration.ConfigurationException;
9
import org.dataone.configuration.Settings;
10
import org.junit.Before;
11

  
12
/**
13
 * A base class to load metacat.properties
14
 * @author tao
15
 *
16
 */
17
public class MetacatCommonTestBase {
18
    
19
    @Before
20
    public void setup() throws FileNotFoundException, IOException, ConfigurationException {
21
        Properties metacatTestProperties = new Properties();
22
        metacatTestProperties.load(new FileInputStream("../test/test.properties"));
23
        String metacatContextDir = metacatTestProperties.getProperty("metacat.contextDir");
24
        Settings.augmentConfiguration(metacatContextDir+"/WEB-INF"+"/metacat.properties");
25
    }
26
}

Also available in: Unified diff