if(e.getCause() == null) {\r
throw e;\r
}\r
- if(!(e.getCause() instanceof ConnectException) && !(e.getCause() instanceof SocketTimeoutException)) {\r
+ if((e.getCause() instanceof ConnectException) || (e.getCause() instanceof SocketTimeoutException)) {\r
+ assertTrue("Only allowing ConnectException with 'timed out' as message here, but had: " + e,\r
+ e.getCause().getMessage().contains("timed out"));\r
+ } else if (e.getCause() instanceof RuntimeException) {\r
+ assertTrue("Only allowing RuntimeException with 'This site is cur' as message here, but had: " + e,\r
+ e.getCause().getMessage().contains("This site is cur"));\r
+ } else {\r
throw e;\r
}\r
- assertTrue("Only allowing ConnectException with 'timed out' as message here, but had: " + e,\r
- e.getCause().getMessage().contains("timed out"));\r
}\r
\r
// verify\r