diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2012-12-03 15:06:20 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2012-12-03 15:06:20 +0100 |
commit | 0cb67472a6c270ae46f47ce5b97cc22673666222 (patch) | |
tree | 5b27afa8471140a705147a9390744c88b14a3408 /sonar-core/src | |
parent | 0362803787b669e66918d0b2e1b7a195f9e22eb6 (diff) | |
download | sonarqube-0cb67472a6c270ae46f47ce5b97cc22673666222.tar.gz sonarqube-0cb67472a6c270ae46f47ce5b97cc22673666222.zip |
SONAR-3306 Add logs to unit test
Diffstat (limited to 'sonar-core/src')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreDto.java | 6 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java | 3 |
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); } |