Skip to content

Commit f9cebe4

Browse files
committed
Removing OBE test
This test was expecting to fail because of a previous bug that was fixed back November.
1 parent 715b04a commit f9cebe4

File tree

1 file changed

+1
-71
lines changed
  • marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/datamovement

1 file changed

+1
-71
lines changed
Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.marklogic.client.datamovement.functionaltests;
17+
package com.marklogic.client.fastfunctest.datamovement;
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -41,9 +41,6 @@
4141
import com.marklogic.client.query.QueryManager;
4242
import com.marklogic.client.query.StringQueryDefinition;
4343

44-
/**
45-
* This is a "fast" test but it's also brittle, with testOnBatchFailure failing intermittently.
46-
*/
4744
public class ExportListenerTest extends AbstractFunctionalTest {
4845

4946
private static DataMovementManager dmManager = null;
@@ -426,71 +423,4 @@ public void testPointInTimeQueryNonDeterministicSet() {
426423
// Doc count should be zero after both batchers are done.
427424
assertEquals(0, dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue());
428425
}
429-
430-
/*
431-
* Trigger batch failure by calling incorrect meta data values
432-
*/
433-
434-
@Test
435-
public void testOnBatchFailure() {
436-
String jsonDoc = "{" +
437-
"\"employees\": [" +
438-
"{ \"firstName\":\"Will\" , \"lastName\":\"Kirkham\" }," +
439-
"{ \"firstName\":\"Hus\" , \"lastName\":\"Wattan\" }," +
440-
"{ \"firstName\":\"Rod\" , \"lastName\":\"Mendez\" }]" +
441-
"}";
442-
443-
// Use WriteBatcher to write the files.
444-
WriteBatcher wbatcher = dmManager.newWriteBatcher();
445-
446-
wbatcher.withBatchSize(1000);
447-
StringHandle handle = new StringHandle();
448-
handle.set(jsonDoc);
449-
String uri = null;
450-
451-
// Insert 100 documents
452-
for (int i = 0; i < 100; i++) {
453-
uri = "lastname" + i + ".json";
454-
wbatcher.add(uri, handle);
455-
}
456-
wbatcher.flushAndWait();
457-
458-
List<String> docExporterList = Collections.synchronizedList(new ArrayList<String>());
459-
460-
QueryManager queryMgr = dbClient.newQueryManager();
461-
StringQueryDefinition querydef = queryMgr.newStringDefinition();
462-
querydef.setCriteria("Will AND Hus");
463-
StringBuilder onBatchFailureStr = new StringBuilder();
464-
465-
QueryBatcher exportBatcher = dmManager.newQueryBatcher(querydef)
466-
.withBatchSize(50)
467-
.onUrisReady(
468-
new ExportListener()
469-
.withMetadataCategory(DocumentManager.Metadata.METADATAVALUES)
470-
.onDocumentReady(doc -> {
471-
String uriOfDoc = doc.getUri();
472-
docExporterList.add(uriOfDoc);
473-
}
474-
)
475-
.onFailure((batch, throwable) -> {
476-
onBatchFailureStr.append("From onBatchFailure QA Exception");
477-
System.out.println("From onBatchFailure " + throwable.getMessage());
478-
System.out.println("From onBatchFailure QA Exception");
479-
}
480-
)
481-
)
482-
.onUrisReady(batch -> {
483-
System.out.println("Batch Numer is " + batch.getJobBatchNumber());
484-
})
485-
.onQueryFailure(exception -> {
486-
System.out.println("Exceptions thrown from testOnBatchFailure callback onQueryFailure");
487-
exception.printStackTrace();
488-
});
489-
dmManager.startJob(exportBatcher);
490-
491-
exportBatcher.awaitCompletion();
492-
493-
assertTrue(onBatchFailureStr.toString().contains("From onBatchFailure QA Exception"),
494-
"Unexpected exception: " + onBatchFailureStr);
495-
}
496426
}

0 commit comments

Comments
 (0)