camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r551906 - in /activemq/camel/trunk/components/camel-jbi/src: main/java/org/apache/camel/component/jbi/ test/java/org/apache/camel/component/jbi/ test/resources/ test/resources/org/apache/camel/component/jbi/su3-src/ test/resources/org/apach...
Date Fri, 29 Jun 2007 14:12:11 GMT
Author: jstrachan
Date: Fri Jun 29 07:12:04 2007
New Revision: 551906

URL: http://svn.apache.org/viewvc?view=rev&rev=551906
Log:
improved the test cases to cover all of the URI styles as well as tidying things up a tad

Added:
    activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java
  (contents, props changed)
      - copied, changed from r551851, activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/CamelJbiEndpointIntegrationTest.java
    activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java
  (with props)
    activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java
  (with props)
    activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java
  (contents, props changed)
      - copied, changed from r551851, activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/IntegrationTest.java
    activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su4-src/
    activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su4-src/camel-context.xml
      - copied unchanged from r551851, activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml
Removed:
    activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/CamelJbiEndpointIntegrationTest.java
Modified:
    activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
    activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiEndpoint.java
    activemq/camel/trunk/components/camel-jbi/src/test/resources/log4j.properties
    activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml

Modified: activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java?view=diff&rev=551906&r1=551905&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
(original)
+++ activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiComponent.java
Fri Jun 29 07:12:04 2007
@@ -175,7 +175,7 @@
             QName service = null;
             String endpoint = null;
             if (endpointUri.startsWith("name:")) {
-                endpoint = endpointUri.substring("endpoint:".length());
+                endpoint = endpointUri.substring("name:".length());
                 service = CamelJbiEndpoint.SERVICE_NAME;
             }
             else if (endpointUri.startsWith("endpoint:")) {

Modified: activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiEndpoint.java?view=diff&rev=551906&r1=551905&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiEndpoint.java
(original)
+++ activemq/camel/trunk/components/camel-jbi/src/main/java/org/apache/camel/component/jbi/CamelJbiEndpoint.java
Fri Jun 29 07:12:04 2007
@@ -30,7 +30,7 @@
  * @version $Revision: 426415 $
  */
 public class CamelJbiEndpoint extends ProviderEndpoint {
-    public static final QName SERVICE_NAME = new QName("http://camel.apache.org/service",
"CamelEndpointComponent");
+    public static final QName SERVICE_NAME = new QName("http://activemq.apache.org/camel/schema/jbi",
"endpoint");
 
     private static final transient Log log = LogFactory.getLog(CamelJbiEndpoint.class);
     private Endpoint camelEndpoint;

Copied: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java
(from r551851, activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/CamelJbiEndpointIntegrationTest.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java?view=diff&rev=551906&p1=activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/CamelJbiEndpointIntegrationTest.java&r1=551851&p2=activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/CamelJbiEndpointIntegrationTest.java
(original)
+++ activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java
Fri Jun 29 07:12:04 2007
@@ -25,7 +25,7 @@
 /**
  * @version $Revision: 1.1 $
  */
-public class CamelJbiEndpointIntegrationTest extends IntegrationTest {
+public class JbiEndpointUsingEndpointUriIntegrationTest extends NonJbiCamelEndpointsIntegrationTest
{
     /*
     * @see TestCase#setUp()
     */

Propchange: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingEndpointUriIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java?view=auto&rev=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java
(added)
+++ activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java
Fri Jun 29 07:12:04 2007
@@ -0,0 +1,44 @@
+/**
+ *
+ * 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.camel.component.jbi;
+
+import org.apache.servicemix.client.ServiceMixClient;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class JbiEndpointUsingNameUriIntegrationTest extends NonJbiCamelEndpointsIntegrationTest
{
+    /*
+    * @see TestCase#setUp()
+    */
+    @Override
+    protected void setUp() throws Exception {
+        suName = "su4";
+        super.setUp();
+    }
+
+    protected void configureExchange(ServiceMixClient client, MessageExchange exchange) {
+        ServiceEndpoint endpoint = client.getContext().getEndpoint(CamelJbiEndpoint.SERVICE_NAME,
"cheese");
+        assertNotNull("Should have a Camel endpoint exposed in JBI!", endpoint);
+        exchange.setEndpoint(endpoint);
+    }
+}
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingNameUriIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java?view=auto&rev=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java
(added)
+++ activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java
Fri Jun 29 07:12:04 2007
@@ -0,0 +1,42 @@
+/**
+ *
+ * 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.camel.component.jbi;
+
+import org.apache.servicemix.client.ServiceMixClient;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.xml.namespace.QName;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class JbiEndpointUsingServiceUriIntegrationTest extends NonJbiCamelEndpointsIntegrationTest
{
+    /*
+    * @see TestCase#setUp()
+    */
+    @Override
+    protected void setUp() throws Exception {
+        suName = "su3";
+        super.setUp();
+    }
+
+    protected void configureExchange(ServiceMixClient client, MessageExchange exchange) {
+        QName serviceQName = new QName("http://foo.bar.org", "myService");
+        exchange.setService(serviceQName);
+    }
+}
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/JbiEndpointUsingServiceUriIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java
(from r551851, activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/IntegrationTest.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java?view=diff&rev=551906&p1=activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/IntegrationTest.java&r1=551851&p2=activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/IntegrationTest.java
(original)
+++ activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java
Fri Jun 29 07:12:04 2007
@@ -35,8 +35,8 @@
 /**
  * @version $Revision: 1.1 $
  */
-public class IntegrationTest extends TestCase {
-    private static final transient Log log = LogFactory.getLog(IntegrationTest.class);
+public class NonJbiCamelEndpointsIntegrationTest extends TestCase {
+    private static final transient Log log = LogFactory.getLog(NonJbiCamelEndpointsIntegrationTest.class);
     protected String suName = "su1";
     protected JBIContainer container = new JBIContainer();
     private File tempRootDir;
@@ -101,7 +101,7 @@
         if (!tempTemp.mkdirs()) {
             fail("Unable to create temporary working root directory [" + tempTemp.getAbsolutePath()
+ "]");
         }
-        System.out.println("Using temporary root directory [" + tempRootDir.getAbsolutePath()
+ "]");
+        log.info("Using temporary root directory [" + tempRootDir.getAbsolutePath() + "]");
 
         container.setRootDir(tempRootDir.getAbsolutePath());
         container.setMonitorInstallationDirectory(false);
@@ -134,7 +134,7 @@
     }
 
     public static boolean deleteDir(File dir) {
-        System.out.println("Deleting directory : " + dir.getAbsolutePath());
+        log.info("Deleting directory : " + dir.getAbsolutePath());
         if (dir.isDirectory()) {
             String[] children = dir.list();
             for (int i = 0; i < children.length; i++) {

Propchange: activemq/camel/trunk/components/camel-jbi/src/test/java/org/apache/camel/component/jbi/NonJbiCamelEndpointsIntegrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/components/camel-jbi/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/resources/log4j.properties?view=diff&rev=551906&r1=551905&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/resources/log4j.properties (original)
+++ activemq/camel/trunk/components/camel-jbi/src/test/resources/log4j.properties Fri Jun
29 07:12:04 2007
@@ -21,7 +21,7 @@
 #
 # The logging properties used during tests..
 #
-log4j.rootLogger=INFO, stdout
+log4j.rootLogger=INFO, out
 
 log4j.logger.org.springframework=INFO
 log4j.logger.org.apache.activemq=INFO
@@ -39,5 +39,5 @@
 log4j.appender.out=org.apache.log4j.FileAppender
 log4j.appender.out.layout=org.apache.log4j.PatternLayout
 log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
-log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.file=target/camel-test.log
 log4j.appender.out.append=true

Modified: activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml?view=diff&rev=551906&r1=551905&r2=551906
==============================================================================
--- activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml
(original)
+++ activemq/camel/trunk/components/camel-jbi/src/test/resources/org/apache/camel/component/jbi/su3-src/camel-context.xml
Fri Jun 29 07:12:04 2007
@@ -30,7 +30,7 @@
   -->
   <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
     <route>
-      <from uri="jbi:name:cheese"/>
+      <from uri="jbi:service:http://foo.bar.org/myService"/>
       <to uri="queue:b"/>
     </route>
   </camelContext>



Mime
View raw message