You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2016/10/31 19:27:53 UTC
qpid-jms git commit: NO-JIRA Some additional test cleanup.
Repository: qpid-jms
Updated Branches:
refs/heads/master ec04b3cb0 -> 03939f424
NO-JIRA Some additional test cleanup.
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/03939f42
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/03939f42
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/03939f42
Branch: refs/heads/master
Commit: 03939f424fa9df52ba8550272365346c6c7683a1
Parents: ec04b3c
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Oct 31 15:27:46 2016 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Oct 31 15:27:46 2016 -0400
----------------------------------------------------------------------
.../jms/bench/ProducerAndConsumerBench.java | 26 +++++++++++++-------
1 file changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/03939f42/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/bench/ProducerAndConsumerBench.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/bench/ProducerAndConsumerBench.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/bench/ProducerAndConsumerBench.java
index 6a607f2..80c3596 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/bench/ProducerAndConsumerBench.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/bench/ProducerAndConsumerBench.java
@@ -40,30 +40,38 @@ import org.apache.activemq.broker.region.policy.PolicyMap;
import org.apache.activemq.broker.region.policy.VMPendingQueueMessageStoragePolicy;
import org.apache.qpid.jms.JmsConnection;
import org.apache.qpid.jms.support.AmqpTestSupport;
+import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- */
@Ignore
public class ProducerAndConsumerBench extends AmqpTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(ProducerAndConsumerBench.class);
- public static final int payload = 64 * 1024;
- public static final int ioBuffer = 2 * payload;
- public static final int socketBuffer = 64 * payload;
+ public static final int PAYLOAD_SIZE = 64 * 1024;
+ public static final int ioBuffer = 2 * PAYLOAD_SIZE;
+ public static final int socketBuffer = 64 * PAYLOAD_SIZE;
- private final String payloadString = new String(new byte[payload]);
+ private final byte[] payload = new byte[PAYLOAD_SIZE];
private final int parallelProducer = 1;
private final int parallelConsumer = 1;
private final Vector<Throwable> exceptions = new Vector<Throwable>();
private ConnectionFactory factory;
- private final long NUM_SENDS = 100000;
+ private final long NUM_SENDS = 30000;
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+
+ for (int i = 0; i < PAYLOAD_SIZE; ++i) {
+ payload[i] = (byte) (i % 255);
+ }
+ }
@Test
public void testProduceConsume() throws Exception {
@@ -139,7 +147,7 @@ public class ProducerAndConsumerBench extends AmqpTestSupport {
while (count.getAndDecrement() > 0) {
BytesMessage message = session.createBytesMessage();
- message.writeBytes(payloadString.getBytes());
+ message.writeBytes(payload);
producer.send(message);
if ((count.get() % 10000) == 0) {
LOG.info("Sent message: {}", NUM_SENDS - count.get());
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org