camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1342885 - in /camel/trunk: components/camel-amqp/ components/camel-amqp/src/main/java/org/apache/camel/component/amqp/ components/camel-amqp/src/test/java/org/apache/camel/component/amqp/ components/camel-amqp/src/test/resources/ parent/ p...
Date Sat, 26 May 2012 11:19:15 GMT
Author: davsclaus
Date: Sat May 26 11:19:15 2012
New Revision: 1342885

URL: http://svn.apache.org/viewvc?rev=1342885&view=rev
Log:
CAMEL-5186: Upgraded to qpid 0.16 and 0.14 for osgi

Added:
    camel/trunk/components/camel-amqp/src/test/resources/config.xml
    camel/trunk/components/camel-amqp/src/test/resources/log4j.xml
    camel/trunk/components/camel-amqp/src/test/resources/passwd
    camel/trunk/components/camel-amqp/src/test/resources/virtualhosts.xml
Modified:
    camel/trunk/components/camel-amqp/pom.xml
    camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
    camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
    camel/trunk/components/camel-amqp/src/test/resources/log4j.properties
    camel/trunk/parent/pom.xml
    camel/trunk/platforms/karaf/features/pom.xml

Modified: camel/trunk/components/camel-amqp/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/pom.xml?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/components/camel-amqp/pom.xml (original)
+++ camel/trunk/components/camel-amqp/pom.xml Sat May 26 11:19:15 2012
@@ -55,33 +55,17 @@
       <artifactId>qpid-common</artifactId>
       <version>${qpid-version}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.mina</groupId>
-      <artifactId>mina-core</artifactId>
-      <version>1.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.4</version>
-    </dependency>
 
     <!-- testing -->
     <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-test</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-configuration</groupId>
-      <artifactId>commons-configuration</artifactId>
-      <version>1.4</version>
+      <groupId>org.apache.qpid</groupId>
+      <artifactId>qpid-broker</artifactId>
+      <version>${qpid-version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>backport-util-concurrent</groupId>
-      <artifactId>backport-util-concurrent</artifactId>
-      <version>3.1</version>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -109,27 +93,4 @@
     </plugins>
   </build>
 
-  <!--
-    It's necessary to explicitly include the mina-filter-ssl dependency
-    when using the ibm jdk as well.
-  -->
-  <profiles>
-    <profile>
-      <id>ibmjdk</id>
-      <activation>
-        <property>
-          <name>java.vendor</name>
-          <value>IBM Corporation</value>
-        </property>
-      </activation> 
-      <dependencies>
-        <dependency>
-          <groupId>org.apache.mina</groupId>
-          <artifactId>mina-filter-ssl</artifactId>
-          <version>1.0.1</version>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-  </profiles>
 </project>

Modified: camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
(original)
+++ camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
Sat May 26 11:19:15 2012
@@ -31,7 +31,6 @@ import org.apache.qpid.url.URLSyntaxExce
 public class AMQPComponent extends JmsComponent {
 
     public AMQPComponent() {
-        init();
     }
 
     public AMQPComponent(JmsConfiguration configuration) {
@@ -40,10 +39,8 @@ public class AMQPComponent extends JmsCo
 
     public AMQPComponent(CamelContext context) {
         super(context);
-        init();
     }
 
-
     public AMQPComponent(AMQConnectionFactory connectionFactory) {
         setConnectionFactory(connectionFactory);
     }
@@ -53,12 +50,4 @@ public class AMQPComponent extends JmsCo
         return new AMQPComponent(connectionFactory);
     }
 
-    /**
-     * Let's install the default connection factory
-     */
-    private void init() {
-        AMQConnectionFactory connectionFactory = new AMQConnectionFactory();
-        setConnectionFactory(connectionFactory);
-    }
-
 }

Modified: camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
(original)
+++ camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
Sat May 26 11:19:15 2012
@@ -20,12 +20,9 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.apache.commons.lang.SerializationUtils;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.junit.AfterClass;
+import org.apache.qpid.server.Broker;
+import org.apache.qpid.server.BrokerOptions;
 import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent;
@@ -33,70 +30,15 @@ import static org.apache.camel.component
 /**
  * @version 
  */
-@Ignore("AMQP testing is a bit unstable")
 public class AMQPRouteTest extends CamelTestSupport {
     protected MockEndpoint resultEndpoint;
+    protected Broker broker;
     
-    @BeforeClass
-    public static void startBroker() throws Exception {
-        // create an in-JVM broker
-        try {
-            TransportConnection.createVMBroker(1);
-        } catch (Exception e) {
-            // fails the first time, so create it again
-            TransportConnection.createVMBroker(1);
-        }
-    }
-    
-    @AfterClass
-    public static void shutdownBroker() {
-        TransportConnection.killVMBroker(1);
-    }
-    
-
     @Test
     public void testJmsRouteWithTextMessage() throws Exception {
         String expectedBody = "Hello there!";
 
-        boolean windows = System.getProperty("os.name").startsWith("Windows");
-
-        if (windows) {
-            // it could sometimes send it twice so we expect at least 1 msg
-            resultEndpoint.expectedMinimumMessageCount(1);
-        } else {
-            resultEndpoint.expectedBodiesReceived(expectedBody);
-        }
-
-        resultEndpoint.message(0).header("cheese").isEqualTo(123);
-
-        sendExchange(expectedBody);
-        
-        if (windows) {
-            // send the message twice to walk around the AMQP's drop first message issue
on Windows box
-            sendExchange(expectedBody);
-        }
-
-        resultEndpoint.assertIsSatisfied();
-    }
-
-    @Test
-    public void testJmsRouteWithObjectMessage() throws Exception {
-        PurchaseOrder expectedBody = new PurchaseOrder("Beer", 10);
-
-        resultEndpoint.expectedBodiesReceived(expectedBody);
-        resultEndpoint.message(0).header("cheese").isEqualTo(123);
-
-        sendExchange(expectedBody);
-
-        resultEndpoint.assertIsSatisfied();
-    }
-
-    @Test
-    public void testJmsRouteWithByteArrayMessage() throws Exception {
-        PurchaseOrder aPO = new PurchaseOrder("Beer", 10);
-        byte[] expectedBody = SerializationUtils.serialize(aPO);
-
-        resultEndpoint.expectedBodiesReceived(expectedBody);
+        resultEndpoint.expectedMessageCount(1);
         resultEndpoint.message(0).header("cheese").isEqualTo(123);
 
         sendExchange(expectedBody);
@@ -105,29 +47,38 @@ public class AMQPRouteTest extends Camel
     }
 
     protected void sendExchange(final Object expectedBody) {
-        template.sendBodyAndHeader("amqp:queue:test.a", expectedBody, "cheese", 123);
+        template.sendBodyAndHeader("amqp:queue:ping", expectedBody, "cheese", 123);
     }
 
-
     @Before
     public void setUp() throws Exception {
+        BrokerOptions options = new BrokerOptions();
+        options.setConfigFile("src/test/resources/config.xml");
+        options.setLogConfigFile("src/test/resources/log4j.xml");
+
+        broker = new Broker();
+        broker.startup(options);
+
         super.setUp();
         resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class);
     }
 
+    @Override
+    public void tearDown() throws Exception {
+        broker.shutdown();
+        super.tearDown();
+    }
+
     protected CamelContext createCamelContext() throws Exception {
         CamelContext camelContext = super.createCamelContext();
-
-        camelContext.addComponent("amqp", amqpComponent("amqp://guest:guest@/test?brokerlist='vm://:1'"));
-
+        camelContext.addComponent("amqp", amqpComponent("amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'"));
         return camelContext;
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("amqp:test.a").to("amqp:test.b");
-                from("amqp:test.b").to("mock:result");
+                from("amqp:queue:ping").to("mock:result");
             }
         };
     }

Added: camel/trunk/components/camel-amqp/src/test/resources/config.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/resources/config.xml?rev=1342885&view=auto
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/resources/config.xml (added)
+++ camel/trunk/components/camel-amqp/src/test/resources/config.xml Sat May 26 11:19:15 2012
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.
+-->
+<broker>
+  <prefix>target</prefix>
+  <work>work</work>
+  <conf>src/test/resources</conf>
+
+  <plugin-directory>target</plugin-directory>
+  <cache-directory>target/cache</cache-directory>
+
+  <connector>
+    <port>5672</port>
+    <socketReceiveBuffer>262144</socketReceiveBuffer>
+    <socketSendBuffer>262144</socketSendBuffer>
+  </connector>
+  <management>
+    <enabled>false</enabled>
+    <jmxport>
+      <registryServer>8999</registryServer>
+      <!--
+       If unspecified, connectorServer defaults to 100 + registryServer port.
+      <connectorServer>9099</connectionServer>
+      -->
+    </jmxport>
+    <ssl>
+      <enabled>false</enabled>
+      <!-- Update below path to your keystore location. -->
+      <keyStorePath>${conf}/qpid.keystore</keyStorePath>
+      <keyStorePassword>password</keyStorePassword>
+    </ssl>
+  </management>
+  <advanced>
+    <framesize>65535</framesize>
+    <locale>en_US</locale>
+  </advanced>
+
+  <security>
+    <pd-auth-manager>
+      <principal-database>
+        <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
+        <attributes>
+          <attribute>
+            <name>passwordFile</name>
+            <value>${conf}/passwd</value>
+          </attribute>
+        </attributes>
+      </principal-database>
+    </pd-auth-manager>
+
+    <!-- By default, all authenticated users have permissions to perform all actions -->
+
+    <!-- ACL Example
+         This example illustrates securing the both Management (JMX) and Messaging.
+    <acl>${conf}/broker_example.acl</acl>
+    -->
+
+    <msg-auth>false</msg-auth>
+  </security>
+
+  <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
+
+  <queue>
+    <auto_register>true</auto_register>
+  </queue>
+
+</broker>
+
+

Modified: camel/trunk/components/camel-amqp/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/resources/log4j.properties?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-amqp/src/test/resources/log4j.properties Sat May 26 11:19:15
2012
@@ -20,7 +20,7 @@
 #
 log4j.rootLogger=INFO, out
 
-log4j.logger.org.apache.activemq.spring=WARN
+#log4j.logger.org.apache.qpid=DEBUG
 
 # CONSOLE appender not used by default
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
@@ -34,4 +34,3 @@ log4j.appender.out.layout.ConversionPatt
 log4j.appender.out.file=target/camel-amqp-test.log
 log4j.appender.out.append=true
 
-log4j.logger.org.apache.camel=DEBUG

Added: camel/trunk/components/camel-amqp/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/resources/log4j.xml?rev=1342885&view=auto
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/resources/log4j.xml (added)
+++ camel/trunk/components/camel-amqp/src/test/resources/log4j.xml Sat May 26 11:19:15 2012
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
+<log4j:configuration>
+  <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d{ABSOLUTE}
+      %5p %c{1} - %m%n"/>
+    </layout>
+  </appender>
+  <root>
+    <priority value="info"></priority>
+    <appender-ref ref="stdout"/>
+  </root>
+</log4j:configuration>
\ No newline at end of file

Added: camel/trunk/components/camel-amqp/src/test/resources/passwd
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/resources/passwd?rev=1342885&view=auto
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/resources/passwd (added)
+++ camel/trunk/components/camel-amqp/src/test/resources/passwd Sat May 26 11:19:15 2012
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+guest:guest
+client:guest
+server:guest
+admin:admin
+

Added: camel/trunk/components/camel-amqp/src/test/resources/virtualhosts.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-amqp/src/test/resources/virtualhosts.xml?rev=1342885&view=auto
==============================================================================
--- camel/trunk/components/camel-amqp/src/test/resources/virtualhosts.xml (added)
+++ camel/trunk/components/camel-amqp/src/test/resources/virtualhosts.xml Sat May 26 11:19:15
2012
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.
+-->
+<virtualhosts>
+    <default>test</default>
+    <virtualhost>
+        <name>test</name>
+        <test>
+            <store>
+                <class>org.apache.qpid.server.store.MemoryMessageStore</class>
+            </store>
+            <queues>
+                <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
+                <maximumMessageCount>50</maximumMessageCount>
+                <queue>
+                    <name>queue</name>
+                    <queue>
+                        <exchange>amq.direct</exchange>
+                        <maximumQueueDepth>4235264</maximumQueueDepth>
+                        <!-- 4Mb -->
+                        <maximumMessageSize>2117632</maximumMessageSize>
+                        <!-- 2Mb -->
+                        <maximumMessageAge>600000</maximumMessageAge>
+                        <!-- 10 mins -->
+                    </queue>
+                </queue>
+                <queue>
+                    <name>ping</name>
+                    <ping>
+                        <exchange>amq.direct</exchange>
+                        <maximumQueueDepth>4235264</maximumQueueDepth>
+                        <!-- 4Mb -->
+                        <maximumMessageSize>2117632</maximumMessageSize>
+                        <!-- 2Mb -->
+                        <maximumMessageAge>600000</maximumMessageAge>
+                        <!-- 10 mins -->
+                    </ping>
+                </queue>
+            </queues>
+        </test>
+    </virtualhost>
+</virtualhosts>
+
+

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Sat May 26 11:19:15 2012
@@ -149,7 +149,7 @@
     <pax-logging-version>1.5.3</pax-logging-version>
     <pojosr-version>0.1.8</pojosr-version>
     <protobuf-version>2.3.0</protobuf-version>
-    <qpid-version>0.12</qpid-version>
+    <qpid-version>0.16</qpid-version>
     <quartz-version>1.8.5</quartz-version>
     <quickfix-version>1.5.1</quickfix-version>
     <restlet-version>2.0.11</restlet-version>
@@ -201,7 +201,7 @@
       org.springframework.*;version="[3,4)",
       org.apache.commons.logging.*;version="[1.1,2)",
       org.apache.cxf.*;version="[2.4,2.7)",
-      org.apache.qpid.*;version="[0.12,0.13)",
+      org.apache.qpid.*;version="[0.14,1)",
       org.apache.abdera.*;version="[0.4,2)",
       org.apache.commons.httpclient.*;version="[3.1,4.0)",
       org.apache.velocity.*;version="[1.6.2,2)",

Modified: camel/trunk/platforms/karaf/features/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/pom.xml?rev=1342885&r1=1342884&r2=1342885&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/pom.xml (original)
+++ camel/trunk/platforms/karaf/features/pom.xml Sat May 26 11:19:15 2012
@@ -102,7 +102,7 @@
       <oscache-bundle-version>2.4_5</oscache-bundle-version>
       <protobuf-java-bundle-version>2.3.0_3</protobuf-java-bundle-version>
       <quartz-bundle-version>1.8.6_1</quartz-bundle-version>
-      <qpid-bundle-version>0.12_2</qpid-bundle-version>
+      <qpid-bundle-version>0.14_1</qpid-bundle-version>
       <quickfix-bundle-version>1.5.1_2</quickfix-bundle-version>
       <regexp-bundle-version>1.3_3</regexp-bundle-version>
       <rhino-bundle-version>1.7R2_3</rhino-bundle-version>



Mime
View raw message