|
33 | 33 | import com.couchbase.lite.mockserver.MockCheckpointGet; |
34 | 34 | import com.couchbase.lite.mockserver.MockCheckpointPut; |
35 | 35 | import com.couchbase.lite.mockserver.MockDispatcher; |
| 36 | +import com.couchbase.lite.mockserver.MockDocumentAllDocs; |
36 | 37 | import com.couchbase.lite.mockserver.MockDocumentBulkGet; |
37 | 38 | import com.couchbase.lite.mockserver.MockDocumentGet; |
38 | 39 | import com.couchbase.lite.mockserver.MockDocumentPut; |
@@ -364,11 +365,6 @@ public void testMockMultiplePullCouchDb() throws Exception { |
364 | 365 |
|
365 | 366 |
|
366 | 367 | public void testMockContinuousPullCouchDb() throws Exception { |
367 | | - |
368 | | - // TODO: (IMPORTANT, FORESTDB) lastSequence for checkpoint does not match and couase dead lock |
369 | | - // if(!isSQLiteDB()) |
370 | | - // fail("FORESTDB casues deadlock becasue of lastSequence mismatch for checkpoint"); |
371 | | - |
372 | 368 | boolean shutdownMockWebserver = true; |
373 | 369 | mockContinuousPull(shutdownMockWebserver, MockDispatcher.ServerType.COUCHDB); |
374 | 370 | } |
@@ -413,6 +409,9 @@ public Map<String, Object> mockSinglePull(boolean shutdownMockWebserver, MockDis |
413 | 409 | mockChangesFeed.add(new MockChangesFeed.MockChangedDoc(mockDoc2)); |
414 | 410 | dispatcher.enqueueResponse(MockHelper.PATH_REGEX_CHANGES, mockChangesFeed.generateMockResponse()); |
415 | 411 |
|
| 412 | + // Empty _all_docs response to pass unit tests |
| 413 | + dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS, new MockDocumentAllDocs()); |
| 414 | + |
416 | 415 | // doc1 response |
417 | 416 | MockDocumentGet mockDocumentGet = new MockDocumentGet(mockDoc1); |
418 | 417 | if (addAttachments) { |
@@ -584,6 +583,9 @@ public Map<String, Object> mockMultiplePull(boolean shutdownMockWebserver, MockD |
584 | 583 | MockResponse fakeChangesResponse = mockChangesFeed.generateMockResponse(); |
585 | 584 | dispatcher.enqueueResponse(MockHelper.PATH_REGEX_CHANGES, fakeChangesResponse); |
586 | 585 |
|
| 586 | + // Empty _all_docs response to pass unit tests |
| 587 | + dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS, new MockDocumentAllDocs()); |
| 588 | + |
587 | 589 | // doc1 response |
588 | 590 | Map<String, Object> doc1JsonMap = MockHelper.generateRandomJsonMap(); |
589 | 591 | MockDocumentGet mockDocumentGet = new MockDocumentGet() |
@@ -1827,6 +1829,9 @@ public void testChangesFeedWithPurgedDoc() throws Exception { |
1827 | 1829 | MockHelper.set404NotFoundJson(fakeCheckpointResponse); |
1828 | 1830 | dispatcher.enqueueResponse(MockHelper.PATH_REGEX_CHECKPOINT, fakeCheckpointResponse); |
1829 | 1831 |
|
| 1832 | + // Empty _all_docs response to pass unit tests |
| 1833 | + dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS, new MockDocumentAllDocs()); |
| 1834 | + |
1830 | 1835 | //add response to _changes request |
1831 | 1836 | // _changes response |
1832 | 1837 | MockChangesFeed mockChangesFeed = new MockChangesFeed(); |
@@ -3171,7 +3176,10 @@ public void testVerifyPullerInsertsDocsWithValidation() throws Exception { |
3171 | 3176 |
|
3172 | 3177 | // create mockwebserver and custom dispatcher |
3173 | 3178 | MockDispatcher dispatcher = new MockDispatcher(); |
| 3179 | + // Empty _all_docs response to pass unit tests |
| 3180 | + dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS, new MockDocumentAllDocs()); |
3174 | 3181 | MockWebServer server = MockHelper.getPreloadedPullTargetMockCouchDB(dispatcher, 2, 2); |
| 3182 | + |
3175 | 3183 | try { |
3176 | 3184 | server.play(); |
3177 | 3185 |
|
|
0 commit comments