diff options
author | Eric Hartmann <hartmann.eric@gmail.com> | 2018-09-06 10:53:40 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-09-07 20:20:56 +0200 |
commit | 5d1312c8e4e88d83be93fb52d388876e04f13de3 (patch) | |
tree | f0ca6b442d3a7e9ba0157d81fcd0797fa55b749b /server | |
parent | 1c7800cc1eb2efb6cdace6c25e149c9eb0021c51 (diff) | |
download | sonarqube-5d1312c8e4e88d83be93fb52d388876e04f13de3.tar.gz sonarqube-5d1312c8e4e88d83be93fb52d388876e04f13de3.zip |
SONAR-11196 Minimal Oracle driver is now 12.2
In order to use Connection#getSchema
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java | 4 | ||||
-rw-r--r-- | server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java | 31 |
2 files changed, 23 insertions, 12 deletions
diff --git a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java b/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java index d39d632f798..4b510e29f4c 100644 --- a/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java +++ b/server/sonar-db-core/src/main/java/org/sonar/db/DatabaseChecker.java @@ -97,9 +97,9 @@ public class DatabaseChecker implements Startable { String driverVersion = connection.getMetaData().getDriverVersion(); String[] parts = StringUtils.split(driverVersion, "."); int intVersion = Integer.parseInt(parts[0]) * 100 + Integer.parseInt(parts[1]); - if (intVersion < 1102) { + if (intVersion < 1200) { throw MessageException.of(String.format( - "Unsupported Oracle driver version: %s. Minimal supported version is 11.2.", driverVersion)); + "Unsupported Oracle driver version: %s. Minimal supported version is 12.1.", driverVersion)); } } } diff --git a/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java b/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java index ad496abfe6c..abe98089ee5 100644 --- a/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java +++ b/server/sonar-db-core/src/test/java/org/sonar/db/DatabaseCheckerTest.java @@ -47,12 +47,19 @@ public class DatabaseCheckerTest { public LogTester logTester = new LogTester(); @Test - public void requires_oracle_driver_11_2() throws Exception { - Database db = mockDb(new Oracle(), 11, 2, "11.2.0.0.1"); + public void requires_oracle_driver_12_2() throws Exception { + Database db = mockDb(new Oracle(), 11, 2, "18.3.0.0.0"); + new DatabaseChecker(db).start(); + + db = mockDb(new Oracle(), 11, 2, "12.2.0.1.0"); new DatabaseChecker(db).start(); // no error - db = mockDb(new Oracle(), 11, 2, "11.3.1"); + db = mockDb(new Oracle(), 11, 2, "12.1.0.2.0"); + new DatabaseChecker(db).start(); + // no error + + db = mockDb(new Oracle(), 11, 2, "12.1.0.1.0"); new DatabaseChecker(db).start(); // no error @@ -65,30 +72,34 @@ public class DatabaseCheckerTest { new DatabaseChecker(db).start(); fail(); } catch (MessageException e) { - assertThat(e).hasMessage("Unsupported Oracle driver version: 11.1.0.2. Minimal supported version is 11.2."); + assertThat(e).hasMessage("Unsupported Oracle driver version: 11.1.0.2. Minimal supported version is 12.1."); } } @Test public void requires_oracle_11g_or_greater() throws Exception { // oracle 11.0 is ok - Database db = mockDb(new Oracle(), 11, 0, "11.2.0.0.1"); + Database db = mockDb(new Oracle(), 11, 0, "12.1.0.1.0"); new DatabaseChecker(db).start(); - // oracle 11.1 is ok - db = mockDb(new Oracle(), 11, 1, "11.2.0.0.1"); + // oracle 11.1 is noit + db = mockDb(new Oracle(), 11, 1, "12.1.0.1.0"); new DatabaseChecker(db).start(); // oracle 11.2 is ok - db = mockDb(new Oracle(), 11, 2, "11.2.0.0.1"); + db = mockDb(new Oracle(), 11, 2, "12.1.0.1.0"); new DatabaseChecker(db).start(); // oracle 12 is ok - db = mockDb(new Oracle(), 12, 0, "11.2.0.0.1"); + db = mockDb(new Oracle(), 12, 0, "12.1.0.1.0"); + new DatabaseChecker(db).start(); + + // oracle 18 is ok + db = mockDb(new Oracle(), 18, 0, "18.3.0.0.0"); new DatabaseChecker(db).start(); // oracle 10 is not supported - db = mockDb(new Oracle(), 10, 2, "11.2.0.0.1"); + db = mockDb(new Oracle(), 10, 2, "12.1.0.1.0"); try { new DatabaseChecker(db).start(); fail(); |