activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r390376 - in /incubator/activemq/trunk/activemq-core/src/test: java/org/apache/activemq/perf/ resources/org/apache/activemq/perf/
Date Fri, 31 Mar 2006 09:07:17 GMT
Author: rajdavies
Date: Fri Mar 31 01:07:15 2006
New Revision: 390376

URL: http://svn.apache.org/viewcvs?rev=390376&view=rev
Log:
fixed some issues with measuring durable topic subscriber performance

Added:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
    incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/perf/kahaBroker.xml
Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java

Added: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java?rev=390376&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
(added)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
Fri Mar 31 01:07:15 2006
@@ -0,0 +1,47 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed 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 org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.xbean.BrokerFactoryBean;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+/**
+ * @version $Revision: 1.3 $
+ */
+public class KahaDurableTopicTest extends SimpleDurableTopicTest {
+    
+    protected BrokerService createBroker() throws Exception{
+        Resource resource=new ClassPathResource( "org/apache/activemq/perf/kahaBroker.xml");
+        BrokerFactoryBean factory=new BrokerFactoryBean(resource);
+        factory.afterPropertiesSet();
+        BrokerService result=factory.getBroker();
+        result.start();
+        return result;
+    }
+
+    
+
+    
+
+}
\ No newline at end of file

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java?rev=390376&r1=390375&r2=390376&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
Fri Mar 31 01:07:15 2006
@@ -34,6 +34,7 @@
     protected PerfRate rate=new PerfRate();
     public PerfConsumer(ConnectionFactory fac,Destination dest,String consumerName) throws
JMSException{
         connection=fac.createConnection();
+        connection.setClientID(consumerName);
         Session s=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
         if(dest instanceof Topic&&consumerName!=null&&consumerName.length()>0){
             consumer=s.createDurableSubscriber((Topic) dest,consumerName);

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java?rev=390376&r1=390375&r2=390376&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
Fri Mar 31 01:07:15 2006
@@ -36,9 +36,4 @@
         return new PerfConsumer(fac,dest,"subs:"+number);
     }
     
-    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
-        ActiveMQConnectionFactory cf = super.createConnectionFactory();
-        cf.setClientID(getName());
-        return cf;
-    }
 }

Added: incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/perf/kahaBroker.xml
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/perf/kahaBroker.xml?rev=390376&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/perf/kahaBroker.xml
(added)
+++ incubator/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/perf/kahaBroker.xml
Fri Mar 31 01:07:15 2006
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2005-2006 The Apache Software Foundation
+   
+    Licensed 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.
+-->
+<beans xmlns="http://activemq.org/config/1.0">
+  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+  <broker brokerName="broker" persistent="true" useShutdownHook="false">
+    <transportConnectors>
+      <transportConnector uri="tcp://localhost:61616"/>
+    </transportConnectors>
+    <persistenceAdapter>
+      <kahaPersistentAdaptor dir = "activemq-data"/>
+    </persistenceAdapter>
+  </broker>
+
+</beans>
+



Mime
View raw message