diff options
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java b/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java index 1eff8a1316..1f261dfc90 100644 --- a/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java +++ b/branches/sca-java-1.5.1/modules/binding-gdata-runtime/src/test/java/org/apache/tuscany/sca/binding/gdata/GoogleContactsServiceTestCase.java @@ -116,11 +116,33 @@ public class GoogleContactsServiceTestCase { //System.out.println("postedEntryID: " + postedEntryID ); //Before deletion - Entry entry00 = testService.clientGetEntry(postedEntryID); - //System.out.println("Before Deleteion: " + entry00.getId()); + for (int i = 0; i < 5; i++) { // make 5 attempts because of timing issues + try { + Entry entry00 = testService.clientGetEntry(postedEntryID); + //System.out.println("Before Deletion: " + entry00.getId()); + break; // get was successful + } catch (Exception e) { + if (i < 4) { + System.out.println("Get failed, retrying..."); + } else { + throw e; // final attempt, give up + } + } + } //Delete this entry - testService.clientDelete(postedEntryID); + for (int i = 0; i < 5; i++) { // make 5 attempts because of timing issues + try { + testService.clientDelete(postedEntryID); + break; // delete was successful + } catch (Exception e) { + if (i < 4) { + System.out.println("Delete failed, retrying..."); + } else { + throw e; // final attempt, give up + } + } + } //Worked: this newly posted entry did not appear in the contact list //But we need a Junit assertion here |