Tweak a very old unit test for ETHREEOH-220 as advised by Derek, by wrapping one part in a retrying helper

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23299 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-10-27 12:09:41 +00:00
parent 2c64a45a44
commit 46f2687483

View File

@@ -644,12 +644,22 @@ public class TaggingServiceImplTest extends TestCase
*/
public void testETHREEOH_220() throws Exception
{
UserTransaction tx = this.transactionService.getUserTransaction();
tx.begin();
// Add tag scope to a folder, then add a non-ASCII (unicode)
// tag onto the folder
transactionService.getRetryingTransactionHelper().doInTransaction(
new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
taggingService.addTagScope(folder);
taggingService.addTag(folder, TAG_I18N);
return null;
}
}, false, true
);
this.taggingService.addTagScope(this.folder);
this.taggingService.addTag(this.folder, TAG_I18N);
tx = asyncOccurs.awaitExecution(tx);
// Wait for the tagging service to process the tag change
UserTransaction tx = asyncOccurs.awaitExecution(null);
// Get the tag from the node
List<String> tags = this.taggingService.getTags(this.folder);
@@ -1336,7 +1346,8 @@ public class TaggingServiceImplTest extends TestCase
{
synchronized (waitForExecutionLock) {
// Have things begin working
tx.commit();
if(tx != null)
tx.commit();
// Always wait 25ms
waitForExecutionLock.wait(25);