Merge pull request #3555 from kaliy/adding_firebird_to_health_checking

* pr/3555:
  Polish
  Add firebird specific health query
pull/3666/head
Stephane Nicoll 9 years ago
commit a44c7883dd

@ -43,6 +43,7 @@ import org.springframework.util.StringUtils;
* @author Christian Dupuis
* @author Andy Wilkinson
* @author Stephane Nicoll
* @author Arthur Kalimullin
* @since 1.1.0
*/
public class DataSourceHealthIndicator extends AbstractHealthIndicator implements
@ -203,13 +204,22 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator implement
},
INFORMIX("Informix Dynamic Server", "select count(*) from systables");
INFORMIX("Informix Dynamic Server", "select count(*) from systables"),
FIREBIRD("Firebird", "SELECT 1 FROM RDB$DATABASE") {
@Override
protected boolean matchesProduct(String product) {
return super.matchesProduct(product)
|| product.toLowerCase().startsWith("firebird");
}
};
private final String product;
private final String query;
private Product(String product, String query) {
Product(String product, String query) {
this.product = product;
this.query = query;
}

@ -110,6 +110,8 @@ public class DataSourceHealthIndicatorTests {
assertThat(Product.forProduct("DB2/LINUXX8664"), equalTo(Product.DB2));
assertThat(Product.forProduct("Informix Dynamic Server"),
equalTo(Product.INFORMIX));
assertThat(Product.forProduct("Firebird 2.5.WI"), equalTo(Product.FIREBIRD));
assertThat(Product.forProduct("Firebird 2.1.LI"), equalTo(Product.FIREBIRD));
}
}

Loading…
Cancel
Save