aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/test/java
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-12-03 15:25:09 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-12-04 11:03:30 +0100
commit9a86ee019c97e81e698e8387d7bc4ff106b8f05b (patch)
tree7cdd0ec47a7c68303bd5f7664ac44efc4c58a6bb /sonar-db/src/test/java
parent41959b471deb06e239e11f9fd5774db913182216 (diff)
downloadsonarqube-9a86ee019c97e81e698e8387d7bc4ff106b8f05b.tar.gz
sonarqube-9a86ee019c97e81e698e8387d7bc4ff106b8f05b.zip
SONAR-6925 add missing index on ce_activity.is_last_key
Diffstat (limited to 'sonar-db/src/test/java')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
index 564f413c29a..8b94ef241bd 100644
--- a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
@@ -73,11 +73,18 @@ public class CeActivityDaoTest {
insert("TASK_2", REPORT, "PROJECT_2", CeActivityDto.Status.SUCCESS);
assertThat(underTest.selectByUuid(db.getSession(), "TASK_2").get().getIsLast()).isTrue();
- // two tasks on PROJECT_1, the more recent one is TASK_3
+ // two tasks on PROJECT_1, the most recent one is TASK_3
insert("TASK_3", REPORT, "PROJECT_1", CeActivityDto.Status.FAILED);
assertThat(underTest.selectByUuid(db.getSession(), "TASK_1").get().getIsLast()).isFalse();
assertThat(underTest.selectByUuid(db.getSession(), "TASK_2").get().getIsLast()).isTrue();
assertThat(underTest.selectByUuid(db.getSession(), "TASK_3").get().getIsLast()).isTrue();
+
+ // inserting a cancelled task does not change the last task
+ insert("TASK_4", REPORT, "PROJECT_1", CeActivityDto.Status.CANCELED);
+ assertThat(underTest.selectByUuid(db.getSession(), "TASK_1").get().getIsLast()).isFalse();
+ assertThat(underTest.selectByUuid(db.getSession(), "TASK_2").get().getIsLast()).isTrue();
+ assertThat(underTest.selectByUuid(db.getSession(), "TASK_3").get().getIsLast()).isTrue();
+ assertThat(underTest.selectByUuid(db.getSession(), "TASK_4").get().getIsLast()).isFalse();
}
@Test