Exemplo n.º 1
0
 /**
  * Checks if an exception yields one of the specified error codes.
  *
  * @param ex exception
  * @param error expected errors
  */
 protected static void check(final QueryException ex, final Err... error) {
   if (error.length == 0) Util.notexpected("No error code specified");
   final String msg = ex.getMessage();
   boolean found = false;
   for (final Err e : error) found |= msg.contains(e.code());
   if (!found) {
     fail("'" + error[0].code() + "' not contained in '" + msg + "'.");
   }
 }