You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2007/05/03 13:32:37 UTC

svn commit: r534799 - in /activemq/camel/trunk/camel-saxon: pom.xml src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java

Author: jstrachan
Date: Thu May  3 04:32:35 2007
New Revision: 534799

URL: http://svn.apache.org/viewvc?view=rev&rev=534799
Log:
fixed pom

Added:
    activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java   (with props)
Modified:
    activemq/camel/trunk/camel-saxon/pom.xml

Modified: activemq/camel/trunk/camel-saxon/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-saxon/pom.xml?view=diff&rev=534799&r1=534798&r2=534799
==============================================================================
--- activemq/camel/trunk/camel-saxon/pom.xml (original)
+++ activemq/camel/trunk/camel-saxon/pom.xml Thu May  3 04:32:35 2007
@@ -38,6 +38,13 @@
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-core</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+      <type>test-jar</type>
+      <optional>true</optional>
+      <scope>test</scope>
+    </dependency>
 
     <dependency>
       <groupId>org.springframework</groupId>

Added: activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java?view=auto&rev=534799
==============================================================================
--- activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java (added)
+++ activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java Thu May  3 04:32:35 2007
@@ -0,0 +1,70 @@
+/**
+ *
+ * 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.builder.saxon;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Endpoint;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.builder.xml.XPathBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision: 1.1 $
+ */
+public class XQueryFilterTest extends ContextTestSupport {
+    protected Endpoint<Exchange> startEndpoint;
+    protected MockEndpoint resultEndpoint;
+
+    public void testSendMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(1);
+
+        client.sendBody("direct:start", "<person name='James' city='London'/>");
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    public void testSendNotMatchingMessage() throws Exception {
+        resultEndpoint.expectedMessageCount(0);
+
+        client.sendBody("direct:start", "<person name='Hiram' city='Tampa'/>");
+
+
+        resultEndpoint.assertIsSatisfied();
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        startEndpoint = resolveMandatoryEndpoint("direct:start");
+        resultEndpoint = (MockEndpoint) resolveMandatoryEndpoint("mock:result");
+    }
+
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                // START SNIPPET: example
+                from("direct:start").filter(
+                        XPathBuilder.xpath("/person[@name='James']")
+                ).to("mock:result");
+                // END SNIPPET: example
+            }
+        };
+    }
+}

Propchange: activemq/camel/trunk/camel-saxon/src/test/java/org/apache/camel/builder/saxon/XQueryFilterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native