From 2ebdd42622807564e81f8b0bd4a62d689bfc1ce6 Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Fri, 21 Sep 2012 15:43:04 +0000 Subject: QPID-4311: throw exception if the test config requests a start delay greater than the imposed maximum time limit for the test. Add some additional logging, extract some variables for clarity. Work by Oleksandr Rudyy and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1388556 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/disttest/client/ProducerParticipantTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'qpid/java/perftests/src/test') diff --git a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java index ce36fdb9ad..cafb63d071 100644 --- a/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java +++ b/qpid/java/perftests/src/test/java/org/apache/qpid/disttest/client/ProducerParticipantTest.java @@ -145,6 +145,23 @@ public class ProducerParticipantTest extends TestCase verify(_delegate, atLeastOnce()).commitIfNecessary(SESSION_NAME1); } + public void testSendMessagesForDurationWithDelayExceedingDuration() throws Exception + { + final long duration = 100; + _command.setMaximumDuration(duration); + _command.setStartDelay(150); + + try + { + _producer.doIt(CLIENT_NAME); + fail("Exception should be thrown indicating configuration error"); + } + catch(DistributedTestException e) + { + assertEquals("Start delay must be less than maximum test duration", e.getMessage()); + } + } + public void testSendMessageBatches() throws Exception { final int batchSize = 3; -- cgit v1.2.1