@@ -302,7 +302,17 @@ public static void tearDownAfterClass() throws Exception {
302
302
deleteUserRole ("ForbiddenRole" );
303
303
deleteRESTUser ("ForbiddenUser" );
304
304
305
- associateRESTServerWithDB (modServerName , "Documents" );
305
+ associateRESTServerWithDB (modServerName , "App-Services" );
306
+
307
+ associateRESTServerWithDB (restServerName , "Documents" );
308
+ associateRESTServerWithModuleDB (restServerName , "Modules" );
309
+
310
+ deleteDB (dbName );
311
+ deleteForest (fNames [0 ]);
312
+ deleteDB (dbNameMod );
313
+ deleteForest (fNamesMod [0 ]);
314
+ deleteDB ("TestDynamicIngest-modules" );
315
+ deleteForest ("TestDynamicIngest-modules-1" );
306
316
// release client
307
317
dbclient .release ();
308
318
}
@@ -829,17 +839,16 @@ public void TestBulkAnnotationSize() throws Exception {
829
839
}
830
840
}
831
841
832
- // Verify errors from sjs module back to client. TODO Fix this test once Git # 1264 is addressed.
833
- @ Ignore
842
+ // Verify errors from sjs module back to client.
843
+ @ Test
834
844
public void TestIngestEgressOnJsonDocsError () throws Exception {
835
845
System .out .println ("Running TestIngestEgressOnJsonDocsError" );
836
846
StringBuilder batchResults = new StringBuilder ();
837
- StringBuilder err = new StringBuilder ();
838
847
848
+ StringBuilder retryBuf = new StringBuilder ();
839
849
try {
840
850
int startBatchIdx = 0 ;
841
851
int maxDocSize = 5 ;
842
- StringBuilder retryBuf = new StringBuilder ();
843
852
844
853
ObjectMapper om = new ObjectMapper ();
845
854
File apiFile = new File (ApiConfigDirPath + JsonIngestConfigName + ".api" );
@@ -897,7 +906,7 @@ public void TestIngestEgressOnJsonDocsError() throws Exception {
897
906
(retryCount , throwable , callContext )
898
907
-> {
899
908
retryBuf .append (throwable .getMessage ());
900
- return IOEndpoint .BulkIOEndpointCaller .ErrorDisposition .SKIP_CALL ;
909
+ return IOEndpoint .BulkIOEndpointCaller .ErrorDisposition .STOP_ALL_CALLS ;
901
910
};
902
911
903
912
outputBulkCaller .setOutputListener (record -> {
@@ -906,33 +915,19 @@ public void TestIngestEgressOnJsonDocsError() throws Exception {
906
915
String s = mapper .readValue (record , ObjectNode .class ).toString ();
907
916
batchResults .append (s );
908
917
} catch (IOException e ) {
909
- err .append (e .getMessage ());
910
918
e .printStackTrace ();
911
919
}
912
920
}
913
921
);
914
922
outputBulkCaller .setErrorListener (errorListener );
915
923
outputBulkCaller .awaitCompletion ();
916
- System .out .println ("Error buffer is " + retryBuf .toString ());
917
- System .out .println ("Unloader completed in TestIngestEgressOnJsonDocsError" );
918
-
919
924
} catch (Exception e ) {
920
925
e .printStackTrace ();
921
- err .append (e .getMessage ());
922
926
}
923
927
finally {
924
- String res = batchResults .toString ();
925
- // # of root elements should be 5.
926
- System .out .println ("Batch results from TestIngestEgressOnJsonDocs " + res );
927
-
928
- assertTrue ("No of docs egressed incorrect. Expected 5." , (res .split ("\\ btitle\\ b" ).length -1 ) == 5 );
929
- assertTrue ("No of docs egressed incorrect. Expected only 1 wrote word." , (res .split ("\\ bwrote\\ b" ).length - 1 ) == 1 );
930
- assertTrue ("No of docs egressed incorrect. Expected only 1 described word." , (res .split ("\\ bdescribed\\ b" ).length - 1 ) == 1 );
931
- assertTrue ("No of docs egressed incorrect. Expected only 1 groundbreaking word." , (res .split ("\\ bgroundbreaking\\ b" ).length - 1 ) == 1 );
932
- assertTrue ("No of docs egressed incorrect. Expected only 1 intellectual word." , (res .split ("\\ bintellectual\\ b" ).length - 1 ) == 1 );
933
- assertTrue ("No of docs egressed incorrect. Expected only 1 unfortunately word." , (res .split ("\\ bunfortunately\\ b" ).length - 1 ) == 1 );
934
- assertTrue ("Unexpected Errors during egress. Should not have any errors." , err .toString ().isEmpty ());
935
- System .out .println ("End of TestIngestEgressOnJsonDocs" );
928
+ assertTrue ("Error returned incorrect" , retryBuf .toString ().contains ("Internal Server Error." ));
929
+ System .out .println ("Error buffer is " + retryBuf .toString ());
930
+ System .out .println ("Unloader completed in TestIngestEgressOnJsonDocsError" );
936
931
}
937
932
}
938
933
0 commit comments