@@ -69,7 +69,7 @@ public void setUp() throws Exception {
6969 public void tearDown () throws Exception {
7070 client .release ();
7171 }
72- //issue 169, loop the eval query more than 150 times and should not stuck
72+ // loop the eval query more than 150 times and should not stuck
7373 @ Test
7474 public void test1MultipleEvalQueries () throws Exception {
7575
@@ -84,7 +84,8 @@ public void test1MultipleEvalQueries() throws Exception {
8484 docMgr .write ("/binary4mbdoc" ,handle1 );
8585 String query = "declare variable $myInteger as xs:integer external;"
8686 + "(fn:doc()/binary(),$myInteger,xdmp:database-name(xdmp:database()))" ;
87- for (int i =0 ; i <=20 ;i ++){
87+ long sizeOfBinary =docMgr .read ("/binary4mbdoc" ,new InputStreamHandle ()).getByteLength ();
88+ for (int i =0 ; i <=330 ;i ++){
8889 ServerEvaluationCall evl = client .newServerEval ().xquery (query );
8990 evl .addVariable ("myInteger" , (int )i );
9091 EvalResultIterator evr = evl .eval ();
@@ -94,7 +95,7 @@ public void test1MultipleEvalQueries() throws Exception {
9495 assertEquals ("itration number" ,i ,er .getNumber ().intValue ());
9596 }else if (er .getType ().equals (Type .BINARY )){
9697 FileHandle readHandle1 = new FileHandle ();
97- assertEquals ("size of the binary " ,er .get (readHandle1 ).get ().length (),docMgr . read ( "/binary4mbdoc" , new InputStreamHandle ()). getByteLength () );
98+ assertEquals ("size of the binary " ,er .get (readHandle1 ).get ().length (),sizeOfBinary );
9899
99100 }else if (er .getType ().equals (Type .STRING )){
100101 assertEquals ("database name " ,"TestEvalXqueryWithTransDB" ,er .getString ());
0 commit comments