How to test a database connection?
I don't see anything in Database or DatabaseConnection specifically. In a pinch you can just run a query that you know won't throw an exception in a Drupal site:

try {
  db_set_active('mymoduleDB');
  db_query('SELECT COUNT(nid) FROM {node}');
}
catch (\PDOException $e) {
  // Berate the user.
}
// PHP5.5+ only
finally {
  db_set_active('default');
}