Revision 4503
Added by daigle about 16 years ago
test/edu/ucsb/nceas/metacatnettest/MetaCatServletNetTest.java | ||
---|---|---|
109 | 109 |
//create random number for docid, so it can void repeat |
110 | 110 |
number = Math.random() * 100000; |
111 | 111 |
serial = Integer.toString(((new Double(number)).intValue())); |
112 |
logMetacat.info("serial: " + serial);
|
|
112 |
logMetacat.debug("serial: " + serial);
|
|
113 | 113 |
suite.addTest(new MetaCatServletNetTest("testInsertXMLDocument", serial)); |
114 | 114 |
suite.addTest(new MetaCatServletNetTest("testReadXMLDocumentXMLFormat", serial)); |
115 | 115 |
suite.addTest(new MetaCatServletNetTest("testUpdateXMLDocument", serial)); |
... | ... | |
184 | 184 |
debug("\nRunning: testInsertXMLDocument test"); |
185 | 185 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
186 | 186 |
+ PropertyService.getProperty("document.accNumSeparator") + "1"; |
187 |
logMetacat.info("insert docid: " + name);
|
|
187 |
logMetacat.debug("insert docid: " + name);
|
|
188 | 188 |
String content = "<?xml version=\"1.0\"?>" |
189 | 189 |
+ "<!DOCTYPE acl PUBLIC \"-//ecoinformatics.org//" |
190 | 190 |
+ "eml-access-2.0.0beta6//EN\" \"http://pine.nceas.ucsb." |
... | ... | |
195 | 195 |
+ "<permission>all</permission>" + "</allow>" + "<allow>" |
196 | 196 |
+ "<principal>public</principal>" + "<permission>read</permission>" |
197 | 197 |
+ "</allow>" + "</acl>"; |
198 |
logMetacat.info("xml document: " + content);
|
|
198 |
logMetacat.debug("xml document: " + content);
|
|
199 | 199 |
assertTrue(handleXMLDocument(content, name, "insert")); |
200 | 200 |
|
201 | 201 |
} |
... | ... | |
208 | 208 |
debug("\nRunning: testInsertInvalidateXMLDocument test"); |
209 | 209 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
210 | 210 |
+ PropertyService.getProperty("document.accNumSeparator") + "1"; |
211 |
logMetacat.info("insert docid: " + name);
|
|
211 |
logMetacat.debug("insert docid: " + name);
|
|
212 | 212 |
String content = "<?xml version=\"1.0\"?>" |
213 | 213 |
+ "<acl authSystem=\"knb\" order=\"allowFirst\">" + "<identifier>" + name |
214 | 214 |
+ "</identifier>" + "<allow>" |
... | ... | |
216 | 216 |
+ "<permission>all</permission>" + "</allow>" + "<allow>" |
217 | 217 |
+ "<principal>public</principal>" + "<permission>read</permission>" |
218 | 218 |
+ "</allow>" + "</acl>"; |
219 |
logMetacat.info("xml document: " + content);
|
|
219 |
logMetacat.debug("xml document: " + content);
|
|
220 | 220 |
assertTrue(handleXMLDocument(content, name, "insert")); |
221 | 221 |
} |
222 | 222 |
|
... | ... | |
228 | 228 |
debug("\nRunning: testInsertNonWellFormedXMLDocument test"); |
229 | 229 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
230 | 230 |
+ PropertyService.getProperty("document.accNumSeparator") + "1"; |
231 |
logMetacat.info("insert non well-formed docid: " + name);
|
|
231 |
logMetacat.debug("insert non well-formed docid: " + name);
|
|
232 | 232 |
String content = "<?xml version=\"1.0\"?>" |
233 | 233 |
+ "<acl authSystem=\"knb\" order=\"allowFirst\">" + "<identifier>" + name |
234 | 234 |
+ "</identifier>" + "<allow>" |
... | ... | |
237 | 237 |
+ "<principal>public</principal>" + "<permission>read</permission>" |
238 | 238 |
+ "</allow>"; |
239 | 239 |
|
240 |
logMetacat.info("xml document: " + content);
|
|
240 |
logMetacat.debug("xml document: " + content);
|
|
241 | 241 |
assertTrue(!handleXMLDocument(content, name, "insert")); |
242 | 242 |
} |
243 | 243 |
|
... | ... | |
281 | 281 |
debug("\nRunning: testUpdateXMLDocument test"); |
282 | 282 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
283 | 283 |
+ PropertyService.getProperty("document.accNumSeparator") + "2"; |
284 |
logMetacat.info("update docid: " + name);
|
|
284 |
logMetacat.debug("update docid: " + name);
|
|
285 | 285 |
String content = "<?xml version=\"1.0\"?>" |
286 | 286 |
+ "<!DOCTYPE acl PUBLIC \"-//ecoinformatics.org//" |
287 | 287 |
+ "eml-access-2.0.0beta6//EN\" \"http://pine.nceas.ucsb." |
... | ... | |
292 | 292 |
+ "<permission>all</permission>" + "</allow>" + "<allow>" |
293 | 293 |
+ "<principal>public</principal>" + "<permission>read</permission>" |
294 | 294 |
+ "</allow>" + "</acl>"; |
295 |
logMetacat.info("xml document: " + content);
|
|
295 |
logMetacat.debug("xml document: " + content);
|
|
296 | 296 |
assertTrue(handleXMLDocument(content, name, "update")); |
297 | 297 |
|
298 | 298 |
} |
... | ... | |
304 | 304 |
debug("\nRunning: testInertDataFile test"); |
305 | 305 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
306 | 306 |
+ PropertyService.getProperty("document.accNumSeparator") + "1"; |
307 |
logMetacat.info("insert data file docid: " + name);
|
|
308 |
logMetacat.info("insert data file ");
|
|
307 |
logMetacat.debug("insert data file docid: " + name);
|
|
308 |
logMetacat.debug("insert data file ");
|
|
309 | 309 |
File hello = new File("test/jones.204.22.xml"); |
310 | 310 |
|
311 | 311 |
assertTrue(insertDataFile(name, hello)); |
... | ... | |
318 | 318 |
debug("\nRunning: testDeleteXMLDocument test"); |
319 | 319 |
String name = "john" + PropertyService.getProperty("document.accNumSeparator") + serialNumber |
320 | 320 |
+ PropertyService.getProperty("document.accNumSeparator") + "2"; |
321 |
logMetacat.info("delete docid: " + name);
|
|
321 |
logMetacat.debug("delete docid: " + name);
|
|
322 | 322 |
assertTrue(handleDeleteFile(name)); |
323 | 323 |
|
324 | 324 |
} |
... | ... | |
348 | 348 |
|
349 | 349 |
// Now contact metacat |
350 | 350 |
String response = getMetacatString(prop); |
351 |
logMetacat.info("Login Message: " + response);
|
|
351 |
logMetacat.debug("Login Message: " + response);
|
|
352 | 352 |
boolean connected = false; |
353 | 353 |
if (response.indexOf("<login>") != -1) { |
354 | 354 |
connected = true; |
... | ... | |
374 | 374 |
prop.put("qformat", "xml"); |
375 | 375 |
|
376 | 376 |
String response = getMetacatString(prop); |
377 |
logMetacat.info("Logout Message: " + response);
|
|
377 |
logMetacat.debug("Logout Message: " + response);
|
|
378 | 378 |
edu.ucsb.nceas.morpho.framework.HttpMessage.setCookie(null); |
379 | 379 |
|
380 | 380 |
if (response.indexOf("<logout>") != -1) { |
... | ... | |
432 | 432 |
prop.put("docid", docid); |
433 | 433 |
|
434 | 434 |
String message = getMetacatString(prop); |
435 |
logMetacat.info("Insert or Update Message: " + message);
|
|
435 |
logMetacat.debug("Insert or Update Message: " + message);
|
|
436 | 436 |
if (message.indexOf("<error>") != -1) {//there was an error |
437 | 437 |
|
438 | 438 |
return false; |
... | ... | |
453 | 453 |
prop.put("docid", name); |
454 | 454 |
|
455 | 455 |
String message = getMetacatString(prop); |
456 |
logMetacat.info("Delete Message: " + message);
|
|
456 |
logMetacat.debug("Delete Message: " + message);
|
|
457 | 457 |
if (message.indexOf("<error>") != -1) {//there was an error |
458 | 458 |
|
459 | 459 |
return false; |
Also available in: Unified diff
Change info log messages to be debug.