You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/01/14 07:04:36 UTC

svn commit: r734342 - in /activemq/camel/trunk/components/camel-saxon/src/test: java/org/apache/camel/component/xslt/ resources/org/apache/camel/component/xslt/

Author: ningjiang
Date: Tue Jan 13 22:04:35 2009
New Revision: 734342

URL: http://svn.apache.org/viewvc?rev=734342&view=rev
Log:
CAMEL-1253 Added the unit tests for camel-xslt components

Added:
    activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/
    activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java   (with props)
    activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java   (with props)
    activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/
    activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml   (with props)

Added: activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java?rev=734342&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java (added)
+++ activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java Tue Jan 13 22:04:35 2009
@@ -0,0 +1,32 @@
+/**
+ * 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.xslt;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class SaxonInvalidXsltFileTest extends InvalidXsltFileTest {
+    
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("seda:a").to("xslt:org/apache/camel/component/xslt/invalid.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl");
+            }
+        };
+    }
+
+}

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

Propchange: activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonInvalidXsltFileTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java?rev=734342&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java (added)
+++ activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java Tue Jan 13 22:04:35 2009
@@ -0,0 +1,28 @@
+/**
+ * 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.xslt;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SaxonXsltRouteTest extends XsltRouteTest {
+    
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/xslt/camelXsltContext.xml");
+    }
+
+}

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

Propchange: activemq/camel/trunk/components/camel-saxon/src/test/java/org/apache/camel/component/xslt/SaxonXsltRouteTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml?rev=734342&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml (added)
+++ activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml Tue Jan 13 22:04:35 2009
@@ -0,0 +1,40 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- START SNIPPET: example -->
+  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
+    <route>
+      <from uri="direct:start"/>
+      <to uri="xslt:org/apache/camel/component/xslt/transform.xsl?transformerFactory=factory"/>
+      <multicast>
+        <bean ref="testBean"/>
+        <to uri="mock:result"/>
+      </multicast>
+    </route>
+  </camelContext>
+  <!-- END SNIPPET: example -->
+  
+  <bean id="testBean" class="org.apache.camel.component.xslt.TestBean" scope="singleton"/>
+  <bean id="factory" class="net.sf.saxon.TransformerFactoryImpl"/>
+</beans>

Propchange: activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-saxon/src/test/resources/org/apache/camel/component/xslt/camelXsltContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml