Revision 4080
Added by daigle about 16 years ago
SitemapTest.java | ||
---|---|---|
31 | 31 |
import java.io.IOException; |
32 | 32 |
|
33 | 33 |
import edu.ucsb.nceas.metacat.DBConnectionPool; |
34 |
import edu.ucsb.nceas.metacat.MetaCatUtil; |
|
35 | 34 |
import edu.ucsb.nceas.metacat.Sitemap; |
35 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
|
36 | 36 |
import edu.ucsb.nceas.utilities.Options; |
37 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
|
37 | 38 |
|
38 | 39 |
import junit.framework.TestCase; |
39 | 40 |
|
... | ... | |
43 | 44 |
* @author Matt Jones |
44 | 45 |
*/ |
45 | 46 |
public class SitemapTest extends TestCase { |
46 |
/* Initialize Options*/ |
|
47 |
static |
|
48 |
{ |
|
49 |
try |
|
50 |
{ |
|
51 |
Options.initialize(new File("build/tests/metacat.properties")); |
|
52 |
MetaCatUtil.pathsForIndexing |
|
53 |
= MetaCatUtil.getOptionList(MetaCatUtil.getOption("indexPaths")); |
|
54 |
} |
|
55 |
catch(Exception e) |
|
56 |
{ |
|
57 |
System.err.println("Exception in initialize option in MetacatServletNetTest "+e.getMessage()); |
|
58 |
} |
|
59 |
} |
|
60 |
private String propertyFileName = |
|
61 |
MetaCatUtil.getOption("installDir") + "/WEB-INF/metacat.properties"; |
|
62 |
// "/usr/share/tomcat5.5/webapps/knb/WEB-INF/metacat.properties"; |
|
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) { |
|
63 | 54 |
|
55 |
} |
|
56 |
} |
|
57 |
|
|
64 | 58 |
private String directoryName = "/tmp/sitemaps"; |
65 | 59 |
|
66 | 60 |
/** |
... | ... | |
71 | 65 |
try { |
72 | 66 |
File propertyFile = new File(propertyFileName); |
73 | 67 |
Options options = Options.initialize(propertyFile); |
74 |
MetaCatUtil util = new MetaCatUtil(); |
|
75 | 68 |
DBConnectionPool pool = DBConnectionPool.getInstance(); |
76 | 69 |
} catch (FileNotFoundException e) { |
77 | 70 |
fail(e.getMessage()); |
Also available in: Unified diff
Merge 1.9 changes into Head