From 8c33609f2b1d044e40e06f96ce98868fe864abf6 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Tue, 18 Oct 2016 20:05:11 -0400 Subject: [PATCH] Test debugging around receive() in AbstractBinderTests --- .../cloud/stream/binder/AbstractBinderTests.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-cloud-stream-binder-test/src/main/java/org/springframework/cloud/stream/binder/AbstractBinderTests.java b/spring-cloud-stream-binder-test/src/main/java/org/springframework/cloud/stream/binder/AbstractBinderTests.java index 8172b0193..8e859420f 100644 --- a/spring-cloud-stream-binder-test/src/main/java/org/springframework/cloud/stream/binder/AbstractBinderTests.java +++ b/spring-cloud-stream-binder-test/src/main/java/org/springframework/cloud/stream/binder/AbstractBinderTests.java @@ -18,6 +18,8 @@ package org.springframework.cloud.stream.binder; import java.util.UUID; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.junit.After; import org.junit.Test; @@ -50,6 +52,8 @@ import static org.assertj.core.api.Assertions.assertThat; @SuppressWarnings("unchecked") public abstract class AbstractBinderTests, CP, PP>, CP extends ConsumerProperties, PP extends ProducerProperties> { + protected final Log logger = LogFactory.getLog(this.getClass()); + protected B testBinder; /** @@ -74,7 +78,11 @@ public abstract class AbstractBinderTests receive(PollableChannel channel, int additionalMultiplier) { - return channel.receive((int) (1000 * timeoutMultiplier * additionalMultiplier)); + long startTime = System.currentTimeMillis(); + Message receive = channel.receive((int) (1000 * timeoutMultiplier * additionalMultiplier)); + long elapsed = System.currentTimeMillis() - startTime; + logger.debug("receive() took " + elapsed / 1000 + " seconds"); + return receive; } @Test