camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r640963 - /activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java
Date Tue, 25 Mar 2008 20:07:13 GMT
Author: davsclaus
Date: Tue Mar 25 13:07:10 2008
New Revision: 640963

URL: http://svn.apache.org/viewvc?rev=640963&view=rev
Log:
Added unit test for mistyped URI

Modified:
    activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java

Modified: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java?rev=640963&r1=640962&r2=640963&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java
(original)
+++ activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaComponentTest.java
Tue Mar 25 13:07:10 2008
@@ -40,4 +40,16 @@
         }
     }
 
+    public void testMistypedProtocol() {
+        try {
+            // the protocol is mistyped as a colon is missing after tcp
+            template.setDefaultEndpointUri("mina:tcp//localhost:8080");
+            template.sendBody("mina:tcp//localhost:8080");
+            fail("Should have thrown a ResolveEndpointFailedException");
+        } catch (ResolveEndpointFailedException e) {
+            assertTrue("Should be an IAE exception", e.getCause() instanceof IllegalArgumentException);
+            assertEquals("Unrecognised MINA protocol: null for uri: mina:tcp//localhost:8080",
e.getCause().getMessage());
+        }
+    }
+
 }



Mime
View raw message