Revision 4127
Added by daigle about 16 years ago
EventLogTest.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package edu.ucsb.nceas.metacattest; |
25 | 25 |
|
26 |
import java.io.File; |
|
27 |
import java.io.FileNotFoundException; |
|
28 |
import java.io.IOException; |
|
29 | 26 |
import java.sql.Timestamp; |
30 | 27 |
import java.text.ParseException; |
31 | 28 |
import java.text.SimpleDateFormat; |
32 | 29 |
|
33 | 30 |
import edu.ucsb.nceas.metacat.DBConnectionPool; |
34 | 31 |
import edu.ucsb.nceas.metacat.EventLog; |
32 |
import edu.ucsb.nceas.metacat.service.PropertyService; |
|
33 |
import edu.ucsb.nceas.metacat.service.ServiceException; |
|
35 | 34 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
36 |
import edu.ucsb.nceas.utilities.Options; |
|
37 | 35 |
|
38 | 36 |
import junit.framework.TestCase; |
39 | 37 |
|
... | ... | |
44 | 42 |
*/ |
45 | 43 |
public class EventLogTest extends TestCase |
46 | 44 |
{ |
47 |
private String propertyFileName = null; |
|
48 | 45 |
|
49 | 46 |
protected void setUp() throws Exception |
50 | 47 |
{ |
51 |
propertyFileName = SystemUtil.getContextDir() + "/WEB-INF/metacat.properties"; |
|
52 | 48 |
|
53 | 49 |
super.setUp(); |
54 | 50 |
try { |
55 |
File propertyFile = new File(propertyFileName); |
|
56 |
Options options = Options.initialize(propertyFile); |
|
51 |
PropertyService.getInstance("build/tests"); |
|
57 | 52 |
DBConnectionPool pool = DBConnectionPool.getInstance(); |
58 |
} catch (FileNotFoundException e) { |
|
59 |
fail(e.getMessage()); |
|
60 |
} catch (IOException e) { |
|
61 |
fail(e.getMessage()); |
|
62 |
} |
|
53 |
} catch (ServiceException se) { |
|
54 |
fail(se.getMessage()); |
|
55 |
} |
|
63 | 56 |
} |
64 | 57 |
|
65 | 58 |
/** |
Also available in: Unified diff
Replace Options class with PropertyService and create PropertyService using log directory name instead of servlet context