summaryrefslogtreecommitdiffstats
path: root/sonar-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-core/src')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java6
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java3
2 files changed, 9 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java b/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java
index 7554ac76a6d..9436593103d 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java
@@ -20,6 +20,7 @@
package org.sonar.core.persistence;
import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import java.util.Date;
@@ -79,4 +80,9 @@ public class SemaphoreDto {
this.updatedAt = updatedAt;
return this;
}
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this);
+ }
}
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
index 4ca936bec4b..e7d8a5572e0 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
@@ -70,12 +70,14 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
@Test
public void create_and_acquire_semaphore() throws Exception {
+ LOG.info("create_and_acquire_semaphore");
SemaphoreDao dao = new SemaphoreDao(getMyBatis());
Lock lock = dao.acquire("foo", 60);
assertThat(lock.isAcquired()).isTrue();
assertThat(lock.getDurationSinceLocked()).isNull();
SemaphoreDto semaphore = selectSemaphore("foo");
+ LOG.info("semaphore : "+ semaphore);
assertThat(semaphore).isNotNull();
assertThat(semaphore.getName()).isEqualTo("foo");
assertThat(isRecent(semaphore.getCreatedAt())).isTrue();
@@ -239,6 +241,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
LOG.info("**** Now : "+ now);
Date dateInTheFuture = DateUtils.addDays(date, 1);
LOG.info("**** DateInTheFuture : "+ dateInTheFuture);
+ LOG.info("date.before(now) -> " + date.before(now) + " && dateInTheFuture.after(now) -> "+ dateInTheFuture.after(now));
return date.before(now) && dateInTheFuture.after(now);
}