You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2008/03/05 10:32:58 UTC
svn commit: r633799 - in
/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf:
SimpleNetworkTest.java SimpleNonPersistentQueueNetworkTest.java
Author: rajdavies
Date: Wed Mar 5 01:32:45 2008
New Revision: 633799
URL: http://svn.apache.org/viewvc?rev=633799&view=rev
Log:
Added non persistent queue network test
Added:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueNetworkTest.java
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java?rev=633799&r1=633798&r2=633799&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNetworkTest.java Wed Mar 5 01:32:45 2008
@@ -25,8 +25,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import junit.framework.TestCase;
-
public class SimpleNetworkTest extends SimpleTopicTest {
@@ -114,6 +112,7 @@
protected void configureProducerBroker(BrokerService answer,String uri) throws Exception {
answer.setBrokerName(PRODUCER_BROKER_NAME);
+ answer.setPersistent(false);
answer.setDeleteAllMessagesOnStartup(true);
NetworkConnector connector = answer.addNetworkConnector("static://"+consumerBindAddress);
connector.setDuplex(true);
Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueNetworkTest.java?rev=633799&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueNetworkTest.java (added)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueNetworkTest.java Wed Mar 5 01:32:45 2008
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.perf;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Session;
+
+public class SimpleNonPersistentQueueNetworkTest extends SimpleNetworkTest {
+
+ protected void setUp() throws Exception {
+ numberOfConsumers = 10;
+ numberofProducers = 10;
+ super.setUp();
+ }
+ protected PerfProducer createProducer(ConnectionFactory fac, Destination dest, int number, byte[] payload) throws JMSException {
+ PerfProducer pp = new PerfProducer(fac, dest, payload);
+ pp.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+ pp.setTimeToLive(1000);
+ return pp;
+ }
+
+ protected PerfConsumer createConsumer(ConnectionFactory fac, Destination dest, int number) throws JMSException {
+ PerfConsumer consumer = new PerfConsumer(fac, dest);
+ boolean enableAudit = numberOfConsumers <= 1;
+ System.out.println("Enable Audit = " + enableAudit);
+ consumer.setEnableAudit(enableAudit);
+ return consumer;
+ }
+
+ protected Destination createDestination(Session s, String destinationName) throws JMSException {
+ return s.createQueue(destinationName);
+ }
+}