Project

General

Profile

« Previous | Next » 

Revision 4127

Added by daigle about 16 years ago

Replace Options class with PropertyService and create PropertyService using log directory name instead of servlet context

View differences:

SitemapTest.java
32 32

  
33 33
import edu.ucsb.nceas.metacat.DBConnectionPool;
34 34
import edu.ucsb.nceas.metacat.Sitemap;
35
import edu.ucsb.nceas.metacat.util.SystemUtil;
36
import edu.ucsb.nceas.utilities.Options;
37
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
35
import edu.ucsb.nceas.metacat.service.PropertyService;
36
import edu.ucsb.nceas.metacat.service.ServiceException;
38 37

  
39 38
import junit.framework.TestCase;
40 39

  
......
44 43
 * @author Matt Jones
45 44
 */
46 45
public class SitemapTest extends TestCase {
47
	
48
	private static String propertyFileName;
49
	static {
50
		try {
51
			propertyFileName = SystemUtil.getContextDir() + "/WEB-INF/metacat.properties";
52
			// "/usr/share/tomcat5.5/webapps/knb/WEB-INF/metacat.properties";
53
		} catch (PropertyNotFoundException pnfe) {
54 46

  
55
		}
56
	}
57

  
58 47
    private String directoryName = "/tmp/sitemaps";
59 48

  
60 49
    /**
......
63 52
    protected void setUp() throws Exception {
64 53
        super.setUp();
65 54
        try {
66
            File propertyFile = new File(propertyFileName);
67
            Options options = Options.initialize(propertyFile);
55
  		  	PropertyService.getInstance("build/tests");
68 56
            DBConnectionPool pool = DBConnectionPool.getInstance();
69
        } catch (FileNotFoundException e) {
70
            fail(e.getMessage());
71
        } catch (IOException e) {
72
            fail(e.getMessage());
57
        } catch (ServiceException se) {
58
            fail(se.getMessage());
73 59
        }
74 60
    }
75 61

  

Also available in: Unified diff