Revision 6211
Added by ben leinfelder over 13 years ago
test/edu/ucsb/nceas/metacattest/MetaCatServletTest.java | ||
---|---|---|
104 | 104 |
suite.addTest(new MetaCatServletTest("initialize")); |
105 | 105 |
suite.addTest(new MetaCatServletTest("testLterReferralLogin")); |
106 | 106 |
suite.addTest(new MetaCatServletTest("testLterReferralLoginFail")); |
107 |
// the pisco referral isn't working in test environment, so commenting out the tests |
|
108 |
// suite.addTest(new MetaCatServletTest("testPiscoReferralLogin")); |
|
109 |
// suite.addTest(new MetaCatServletTest("testPiscoReferralLoginFail")); |
|
107 |
suite.addTest(new MetaCatServletTest("testOtherReferralLogin")); |
|
108 |
suite.addTest(new MetaCatServletTest("testOtherReferralLoginFail")); |
|
110 | 109 |
suite.addTest(new MetaCatServletTest("testNCEASLoginFail")); |
111 | 110 |
// Should put a login successfully at the end of login test |
112 | 111 |
// So insert or update can have cookie. |
... | ... | |
119 | 118 |
suite.addTest(new MetaCatServletTest("testInsertXMLDocument", serial)); |
120 | 119 |
suite.addTest(new MetaCatServletTest("testReadXMLDocumentXMLFormat", serial)); |
121 | 120 |
suite.addTest(new MetaCatServletTest("testUpdateXMLDocument", serial)); |
122 |
|
|
121 |
|
|
123 | 122 |
suite.addTest(new MetaCatServletTest("testReadXMLDocumentHTMLFormat", serial)); |
124 | 123 |
suite.addTest(new MetaCatServletTest("testReadXMLDocumentZipFormat", serial)); |
125 |
|
|
124 |
|
|
126 | 125 |
suite.addTest(new MetaCatServletTest("testDeleteXMLDocument", serial)); |
127 | 126 |
|
128 | 127 |
// test delete using GUID |
... | ... | |
140 | 139 |
suite |
141 | 140 |
.addTest(new MetaCatServletTest("testInsertNonWellFormedXMLDocument", |
142 | 141 |
serial)); |
143 |
|
|
142 |
|
|
144 | 143 |
suite.addTest(new MetaCatServletTest("testLogOut")); |
145 | 144 |
|
146 | 145 |
return suite; |
... | ... | |
206 | 205 |
*/ |
207 | 206 |
public void testLterReferralLoginFail() { |
208 | 207 |
debug("\nRunning: testLterReferralLoginFail test"); |
209 |
String user = "uid=jtao,o=LTER,dc=ecoinformatics,dc=org"; |
|
210 |
String passwd = "qVyGpveb"; |
|
208 |
String user = null; |
|
209 |
String passwd = "wrong"; |
|
210 |
try { |
|
211 |
user = PropertyService.getProperty("test.lterUser"); |
|
212 |
} catch (PropertyNotFoundException pnfe) { |
|
213 |
fail("Could not find property: " + pnfe.getMessage()); |
|
214 |
} |
|
211 | 215 |
assertTrue(!logIn(user, passwd)); |
212 | 216 |
// assertTrue( withProtocol.getProtocol().equals("http")); |
213 | 217 |
} |
214 | 218 |
|
215 | 219 |
/** |
216 |
* Test the login to pisco succesfully
|
|
220 |
* Test the login to Other succesfully
|
|
217 | 221 |
*/ |
218 |
public void testPiscoReferralLogin() {
|
|
219 |
debug("\nRunning: testPiscoReferralLogin test");
|
|
222 |
public void testOtherReferralLogin() {
|
|
223 |
debug("\nRunning: testOtherReferralLogin test");
|
|
220 | 224 |
String user = null; |
221 | 225 |
String passwd = null; |
222 | 226 |
try { |
223 |
user = PropertyService.getProperty("test.piscoUser");
|
|
224 |
passwd = PropertyService.getProperty("test.piscoPassword");
|
|
227 |
user = PropertyService.getProperty("test.referralUser");
|
|
228 |
passwd = PropertyService.getProperty("test.referralPassword");
|
|
225 | 229 |
} catch (PropertyNotFoundException pnfe) { |
226 | 230 |
fail("Could not find property: " + pnfe.getMessage()); |
227 | 231 |
} |
228 |
debug("logging in pisco user: " + user + ":" + passwd);
|
|
232 |
debug("logging in Other user: " + user + ":" + passwd);
|
|
229 | 233 |
assertTrue(logIn(user, passwd)); |
230 | 234 |
// assertTrue( withProtocol.getProtocol().equals("http")); |
231 | 235 |
} |
232 | 236 |
|
233 | 237 |
/** |
234 |
* Test the login to pisco failed
|
|
238 |
* Test the login to Other failed
|
|
235 | 239 |
*/ |
236 |
public void testPiscoReferralLoginFail() { |
|
237 |
debug("\nRunning: testPiscoReferralLoginFail test"); |
|
238 |
String user = "uid=tao,o=PISCO,dc=ecoinformatics,dc=org"; |
|
239 |
String passwd = "hello"; |
|
240 |
public void testOtherReferralLoginFail() { |
|
241 |
debug("\nRunning: testOtherReferralLoginFail test"); |
|
242 |
String user = null; |
|
243 |
String passwd = "wrong"; |
|
244 |
try { |
|
245 |
user = PropertyService.getProperty("test.referralUser"); |
|
246 |
} catch (PropertyNotFoundException pnfe) { |
|
247 |
fail("Could not find property: " + pnfe.getMessage()); |
|
248 |
} |
|
240 | 249 |
assertTrue(!logIn(user, passwd)); |
241 | 250 |
// assertTrue( withProtocol.getProtocol().equals("http")); |
242 | 251 |
} |
... | ... | |
480 | 489 |
String response = getMetacatString(prop); |
481 | 490 |
debug("Login Message: " + response); |
482 | 491 |
boolean connected = false; |
483 |
if (response.indexOf("<login>") != -1) { |
|
492 |
if (response != null && response.indexOf("<login>") != -1) {
|
|
484 | 493 |
connected = true; |
485 | 494 |
} else { |
486 | 495 |
|
Also available in: Unified diff
do not use pisco for referral testing (merge from 1.9.5)