Project

General

Profile

« Previous | Next » 

Revision 4126

Added by daigle over 16 years ago

Use qualified test properties

View differences:

test/edu/ucsb/nceas/metacattest/OnlineDataAccessTest.java
62 62
	static {
63 63
		try {
64 64
		    metacatUrl = SystemUtil.getServletURL();
65
			username = PropertyService.getProperty("mcuser");
66
			password = PropertyService.getProperty("mcpassword");
67
			anotheruser = PropertyService.getProperty("mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
65
			username = PropertyService.getProperty("test.mcuser");
66
			password = PropertyService.getProperty("test.mcpassword");
67
			anotheruser = PropertyService.getProperty("test.mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("test.mcanotherpassword");
69 69
		} catch (PropertyNotFoundException pnfe) {
70 70
			System.err.println("Could not get property in static block: " 
71 71
					+ pnfe.getMessage());
test/edu/ucsb/nceas/metacattest/AccessControlTest.java
63 63
	static {
64 64
		try {
65 65
		    metacatUrl = SystemUtil.getServletURL();
66
			username = PropertyService.getProperty("mcuser");
67
			password = PropertyService.getProperty("mcpassword");
68
			anotheruser = PropertyService.getProperty("mcanotheruser");
69
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
66
			username = PropertyService.getProperty("test.mcuser");
67
			password = PropertyService.getProperty("test.mcpassword");
68
			anotheruser = PropertyService.getProperty("test.mcanotheruser");
69
			anotherpassword = PropertyService.getProperty("test.mcanotherpassword");
70 70
		} catch (PropertyNotFoundException pnfe) {
71 71
			System.err.println("Could not get property in static block: " 
72 72
					+ pnfe.getMessage());
test/edu/ucsb/nceas/metacattest/NonAsciiCharacterTest.java
62 62
	static {
63 63
		try {
64 64
		    metacatUrl = SystemUtil.getServletURL();
65
			username = PropertyService.getProperty("mcuser");
66
			password = PropertyService.getProperty("mcpassword");
67
			anotheruser = PropertyService.getProperty("mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
65
			username = PropertyService.getProperty("test.mcuser");
66
			password = PropertyService.getProperty("test.mcpassword");
67
			anotheruser = PropertyService.getProperty("test.mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("test.mcanotherpassword");
69 69
		} catch (PropertyNotFoundException pnfe) {
70 70
			System.err.println("Could not get property in static block: " 
71 71
					+ pnfe.getMessage());
test/edu/ucsb/nceas/metacattest/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
		}
test/edu/ucsb/nceas/metacattest/InlineDataAccessTest.java
62 62
	static {
63 63
		try {
64 64
		    metacatUrl = SystemUtil.getServletURL();
65
			username = PropertyService.getProperty("mcuser");
66
			password = PropertyService.getProperty("mcpassword");
67
			anotheruser = PropertyService.getProperty("mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
65
			username = PropertyService.getProperty("test.mcuser");
66
			password = PropertyService.getProperty("test.mcpassword");
67
			anotheruser = PropertyService.getProperty("test.mcanotheruser");
68
			anotherpassword = PropertyService.getProperty("test.mcanotherpassword");
69 69
		} catch (PropertyNotFoundException pnfe) {
70 70
			System.err.println("Could not get property in static block: " 
71 71
					+ pnfe.getMessage());
test/edu/ucsb/nceas/metacattest/client/MetacatClientTest.java
74 74
	private static String anotherpassword;
75 75
	static {
76 76
		try {
77
		    metacatUrl = SystemUtil.getServletURL();
78
			username = PropertyService.getProperty("mcuser");
79
			password = PropertyService.getProperty("mcpassword");
80
			anotheruser = PropertyService.getProperty("mcanotheruser");
81
			anotherpassword = PropertyService.getProperty("mcanotherpassword");
77
		    metacatUrl = PropertyService.getProperty("test.metacat.url");
78
			username = PropertyService.getProperty("test.mcuser");
79
			password = PropertyService.getProperty("test.mcpassword");
80
			anotheruser = PropertyService.getProperty("test.mcanotheruser");
81
			anotherpassword = PropertyService.getProperty("test.mcanotherpassword");
82 82
		} catch (PropertyNotFoundException pnfe) {
83 83
			System.err.println("Could not get property in static block: " 
84 84
					+ pnfe.getMessage());

Also available in: Unified diff