diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-10-09 17:01:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-10-10 09:23:06 +0200 |
commit | e6bb0c9a13e5c477c5402ca476d1a8b8eb159cf3 (patch) | |
tree | b45afcb9b1745eebf29418d97079bdd296b43984 /server | |
parent | dbfde91e6ece5439eecc7f1b9586ee601453a248 (diff) | |
download | sonarqube-e6bb0c9a13e5c477c5402ca476d1a8b8eb159cf3.tar.gz sonarqube-e6bb0c9a13e5c477c5402ca476d1a8b8eb159cf3.zip |
SONAR-11310 fix Oracle support in CeActivityDaoTest
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java index eef82b7b76d..25ae96b6c2b 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java @@ -321,7 +321,18 @@ public class CeActivityDaoTest { private AbstractListAssert<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>> assertIsLastAndMainIsLastFieldsOf(String taskUuid) { return assertThat(db.select("select is_last as \"IS_LAST\", main_is_last as \"MAIN_IS_LAST\" from ce_activity where uuid='" + taskUuid + "'")) - .extracting(t -> (Boolean) t.get("IS_LAST"), t -> (Boolean) t.get("MAIN_IS_LAST")); + .extracting(t -> toBoolean(t.get("IS_LAST")), t -> toBoolean(t.get("MAIN_IS_LAST"))); + } + + private static boolean toBoolean(Object o) { + if (o instanceof Boolean) { + return (Boolean) o; + } + if (o instanceof Long) { + Long longBoolean = (Long) o; + return longBoolean.equals(1L); + } + throw new IllegalArgumentException("Unsupported object type returned for boolean: " + o.getClass()); } @Test |