Revision 4126
Added by daigle almost 16 years ago
MetaCatServletTest.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
package edu.ucsb.nceas.metacattest; |
28 | 28 |
|
29 |
import edu.ucsb.nceas.metacat.*; |
|
30 | 29 |
import edu.ucsb.nceas.metacat.service.PropertyService; |
31 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
|
32 | 30 |
import edu.ucsb.nceas.utilities.HttpMessage; |
33 |
import edu.ucsb.nceas.utilities.Options; //import edu.ucsb.nceas.morpho.framework.*; |
|
34 | 31 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
35 | 32 |
import junit.framework.Test; |
36 | 33 |
import junit.framework.TestCase; |
... | ... | |
51 | 48 |
private String serialNumber; |
52 | 49 |
private static final Log log = LogFactory |
53 | 50 |
.getLog("edu.ucsb.nceas.metacattest.MetaCatServletTest"); |
54 |
/* Initialize Options*/
|
|
51 |
/* Initialize properties*/
|
|
55 | 52 |
static { |
56 | 53 |
try { |
57 |
metacatURL = SystemUtil.getServletURL();
|
|
58 |
Options.initialize(new File("build/tests/metacat.properties"));
|
|
54 |
PropertyService.getInstance("build/tests");
|
|
55 |
metacatURL = PropertyService.getProperty("test.metacat.url");
|
|
59 | 56 |
} catch (Exception e) { |
60 | 57 |
System.err.println("Exception in initialize option in MetacatServletNetTest " |
61 | 58 |
+ e.getMessage()); |
... | ... | |
176 | 173 |
String user = null; |
177 | 174 |
String passwd = null; |
178 | 175 |
try { |
179 |
user = PropertyService.getProperty("lteruser"); |
|
180 |
passwd = PropertyService.getProperty("lterpassword"); |
|
176 |
user = PropertyService.getProperty("test.lteruser");
|
|
177 |
passwd = PropertyService.getProperty("test.lterpassword");
|
|
181 | 178 |
} catch (PropertyNotFoundException pnfe) { |
182 | 179 |
fail("Could not find property: " + pnfe.getMessage()); |
183 | 180 |
} |
... | ... | |
202 | 199 |
String user = null; |
203 | 200 |
String passwd = null; |
204 | 201 |
try { |
205 |
user = PropertyService.getProperty("piscouser"); |
|
206 |
passwd = PropertyService.getProperty("piscopassword"); |
|
202 |
user = PropertyService.getProperty("test.piscouser");
|
|
203 |
passwd = PropertyService.getProperty("test.piscopassword");
|
|
207 | 204 |
} catch (PropertyNotFoundException pnfe) { |
208 | 205 |
fail("Could not find property: " + pnfe.getMessage()); |
209 | 206 |
} |
Also available in: Unified diff
Use qualified test properties