diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-11-28 12:19:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-28 12:19:03 +0100 |
commit | d1a7a0173da71f1ee40e2b3cc74396fe7747b4c8 (patch) | |
tree | 0b46feabc69cf7f0020406c34e650d8a74414ec3 /sonar-db/src/test | |
parent | 6e0ca554a198d0ad7393f4b4fecfbf2cfcf44d34 (diff) | |
download | sonarqube-d1a7a0173da71f1ee40e2b3cc74396fe7747b4c8.tar.gz sonarqube-d1a7a0173da71f1ee40e2b3cc74396fe7747b4c8.zip |
Speed-up drop of DB table on Oracle
Diffstat (limited to 'sonar-db/src/test')
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java b/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java index 1855803dcc3..4003cd443be 100644 --- a/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java +++ b/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java @@ -327,4 +327,14 @@ public class DatabaseUtilsTest { assertThat(buildLikeValue("like-\\_%/-value", AFTER)).isEqualTo(escapedValue + wildcard); assertThat(buildLikeValue("like-\\_%/-value", BEFORE_AND_AFTER)).isEqualTo(wildcard + escapedValue + wildcard); } + + @Test + public void tableExists_returns_true_if_table_is_referenced_in_db_metadata() throws Exception { + try (Connection connection = dbTester.openConnection()) { + assertThat(DatabaseUtils.tableExists("SCHEMA_MIGRATIONS", connection)).isTrue(); + assertThat(DatabaseUtils.tableExists("schema_migrations", connection)).isTrue(); + assertThat(DatabaseUtils.tableExists("schema_MIGRATIONS", connection)).isTrue(); + assertThat(DatabaseUtils.tableExists("foo", connection)).isFalse(); + } + } } |