Revision 9261
Added by Jing Tao over 9 years ago
test/edu/ucsb/nceas/metacattest/SchemaRegistryTest.java | ||
---|---|---|
183 | 183 |
new HashMap<String, String>()); |
184 | 184 |
|
185 | 185 |
String testDocument = getTestDocument(testFileLocation + goodSchemaXMLFile); |
186 |
|
|
186 |
System.out.println(""+testDocument); |
|
187 | 187 |
// login |
188 | 188 |
debug("logging in as: username=" + username + " password=" + password); |
189 | 189 |
m.login(username, password); |
190 | 190 |
|
191 |
Thread.sleep(2000); |
|
191 | 192 |
// insert document. We expect to succeed. |
192 | 193 |
insertDocid(newdocid + ".1", testDocument, SUCCESS, false); |
193 | 194 |
|
... | ... | |
273 | 274 |
String newdocid2 = generateDocid(); |
274 | 275 |
insertDocid(newdocid2 + ".1", testDocument, SUCCESS, false); |
275 | 276 |
|
277 |
Thread.sleep(2000); |
|
278 |
|
|
276 | 279 |
// Check the db for registered schemas. We should find two and only |
277 | 280 |
// two. |
278 | 281 |
debug("Checking db for registered schemas"); |
... | ... | |
338 | 341 |
// insert document. We expect to fail with a MetacatException because the schemaLocation |
339 | 342 |
// does not exist. |
340 | 343 |
insertDocidExpectException(newdocid1 + ".1", testDocument, "Failed to read schema document"); |
341 |
|
|
344 |
Thread.sleep(2000); |
|
345 |
|
|
342 | 346 |
// Check the db for registered schemas. We should find none. |
343 | 347 |
debug("Checking db for registered schemas"); |
344 | 348 |
Vector<Hashtable<String,Object>> sqlResults = |
... | ... | |
427 | 431 |
// does not exist. |
428 | 432 |
insertDocidExpectException(newdocid1 + ".1", testDocument, "is not allowed to appear in element"); |
429 | 433 |
|
434 |
Thread.sleep(2000); |
|
435 |
|
|
430 | 436 |
// Check the db for registered schemas. We should find none. |
431 | 437 |
debug("Checking db for registered schemas"); |
432 | 438 |
Vector<Hashtable<String,Object>> sqlResults = |
... | ... | |
517 | 523 |
// because the xml does not conform to the schema |
518 | 524 |
insertDocidExpectException(newdocid2 + ".1", testDocument2, "is not allowed to appear in element"); |
519 | 525 |
|
526 |
Thread.sleep(2000); |
|
520 | 527 |
// Check the db for registered schemas. We should find none. |
521 | 528 |
debug("Checking db for registered schemas"); |
522 | 529 |
Vector<Hashtable<String,Object>> sqlResults = |
... | ... | |
592 | 599 |
String newdocid2 = generateDocid(); |
593 | 600 |
insertDocid(newdocid2 + ".1", testDocument, SUCCESS, false); |
594 | 601 |
|
602 |
Thread.sleep(2000); |
|
603 |
|
|
595 | 604 |
// Check the db for registered schemas. We should find two and only |
596 | 605 |
// two. |
597 | 606 |
debug("Checking db for registered schemas"); |
... | ... | |
673 | 682 |
// insert document. We expect to succeed. |
674 | 683 |
insertDocid(newdocid + ".1", testDocument, SUCCESS, false); |
675 | 684 |
|
685 |
Thread.sleep(2000); |
|
686 |
|
|
687 |
|
|
676 | 688 |
debug("Checking db for registered schemas"); |
677 | 689 |
Vector<Hashtable<String,Object>> sqlResults = |
678 | 690 |
dbSelect(getRegisteredIncludedTestSchemaSql, |
Also available in: Unified diff
Add some thread sleeping time to make checking wait the process.