Skip to content

Commit 2415a69

Browse files
committed
updated the test to avoid sleep , since count is estimate and it will be an inconsistent if we wait
1 parent 8744d15 commit 2415a69

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test-complete/src/test/java/com/marklogic/client/functionaltest/TestJacksonDateTimeFormat.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
package com.marklogic.client.functionaltest;
1818

1919
import static org.junit.Assert.assertEquals;
20+
import static org.junit.Assert.assertFalse;
2021
import static org.junit.Assert.assertNotNull;
22+
import static org.junit.Assert.assertTrue;
2123

2224
import java.util.Calendar;
2325
import java.util.TimeZone;
@@ -34,6 +36,7 @@
3436
import com.marklogic.client.DatabaseClient;
3537
import com.marklogic.client.DatabaseClientFactory;
3638
import com.marklogic.client.DatabaseClientFactory.Authentication;
39+
import com.marklogic.client.ResourceNotFoundException;
3740
import com.marklogic.client.document.DocumentManager.Metadata;
3841
import com.marklogic.client.document.DocumentWriteSet;
3942
import com.marklogic.client.document.JSONDocumentManager;
@@ -360,15 +363,18 @@ public void testPOJORepoDeleteDateTime() {
360363
pojoReposProducts.delete(calTime);
361364
// Introduce a wait for the document to be deleted.
362365
try {
363-
Thread.sleep(5000);
364-
} catch (InterruptedException e) {
366+
artifact = pojoReposProducts.read(calTime);
367+
assertFalse("Test Expecting exception",true);
368+
} catch (ResourceNotFoundException e) {
365369
// TODO Auto-generated catch block
366-
e.printStackTrace();
370+
assertTrue("expected exception",true);
371+
}catch (Exception e){
372+
assertFalse("Test got unexpected",true);
367373
}
368374
// Validate the artifact read back.
369-
long count = pojoReposProducts.count();
370-
371-
assertEquals("Artifact with calendar as Id found - Delete did not work",0, count);
375+
// long count = pojoReposProducts.count();
376+
//
377+
// assertEquals("Artifact with calendar as Id found - Delete did not work",0, count);
372378
}
373379

374380
@Test

0 commit comments

Comments
 (0)