File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
server/src/test/java/org/apache/calcite/avatica/ha Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 5252import java .util .concurrent .Executors ;
5353import java .util .concurrent .Future ;
5454
55+ import static org .hamcrest .CoreMatchers .containsString ;
56+ import static org .hamcrest .CoreMatchers .either ;
57+ import static org .hamcrest .MatcherAssert .assertThat ;
5558import static org .junit .Assert .assertEquals ;
5659import static org .junit .Assert .assertFalse ;
5760import static org .junit .Assert .assertNotEquals ;
@@ -317,9 +320,10 @@ public void testConnectionPropertiesCreateStatementAfterDisconnect() throws Exce
317320 stmt .execute ("SELECT count(1) FROM " + tableName );
318321 } catch (Exception e ) {
319322 assertTrue (e instanceof SQLException );
320- assertTrue (
321- e .getMessage ().toLowerCase (Locale .ROOT ).contains ("connection refused" )
322- || e .getMessage ().toLowerCase (Locale .ROOT ).contains ("connection abort" ));
323+ assertThat (e .getMessage ().toLowerCase (Locale .ROOT ), either (
324+ containsString ("connection refused" ))
325+ .or (containsString ("connection abort" ))
326+ .or (containsString ("connection reset" )));
323327 }
324328
325329 // Create statement with conn - Fails with HttpHostConnectException.
You can’t perform that action at this time.
0 commit comments