You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/11/22 15:30:24 UTC

svn commit: r1205018 [2/2] - in /camel/trunk: apache-camel/ apache-camel/src/main/descriptors/ camel-core/src/main/java/org/apache/camel/component/file/ camel-core/src/main/java/org/apache/camel/converter/jaxp/ camel-core/src/test/java/org/apache/camel...

Added: camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java?rev=1205018&view=auto
==============================================================================
--- camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java (added)
+++ camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java Tue Nov 22 14:30:16 2011
@@ -0,0 +1,77 @@
+/**
+ * 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.stax.model;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
+public final class RecordsUtil {
+
+    private RecordsUtil() {
+        // no-op
+    }
+
+    public static void createXMLFile() {
+        File in = new File("target/in/records.xml");
+        if (in.exists()) {
+            return;
+        } else {
+            if (!in.getParentFile().exists() && !in.getParentFile().mkdirs()) {
+                throw new RuntimeException("can't create " + in.getParent());
+            }
+        }
+
+        Records records = new Records();
+        for (int i = 0; i < 10; i++) {
+            Record record = new Record();
+            record.setKey(Integer.toString(i));
+            record.setValue("#" + i);
+            records.getRecord().add(record);
+        }
+
+        Marshaller marshaller;
+        try {
+            JAXBContext jaxbCtx = JAXBContext.newInstance(Records.class.getPackage().getName());
+            marshaller = jaxbCtx.createMarshaller();
+        } catch (JAXBException e) {
+            throw new RuntimeException(e);
+        }
+
+        FileWriter writer = null;
+        try {
+            writer = new FileWriter(in);
+            marshaller.marshal(records, writer);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        } catch (JAXBException e) {
+            throw new RuntimeException(e);
+        } finally {
+            if (writer != null) {
+                try {
+                    writer.flush();
+                    writer.close();
+                } catch (IOException e) {
+                    // no-op
+                }
+            }
+        }
+    }
+}

Propchange: camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-stax/src/test/java/org/apache/camel/component/stax/model/RecordsUtil.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-stax/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stax/src/test/resources/log4j.properties?rev=1205018&view=auto
==============================================================================
--- camel/trunk/components/camel-stax/src/test/resources/log4j.properties (added)
+++ camel/trunk/components/camel-stax/src/test/resources/log4j.properties Tue Nov 22 14:30:16 2011
@@ -0,0 +1,35 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for testing
+#
+log4j.rootLogger=INFO, file
+
+#log4j.logger.org.apache.camel.component.stax=DEBUG
+
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
+#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.file.file=target/camel-stax-test.log
\ No newline at end of file

Propchange: camel/trunk/components/camel-stax/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-stax/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-stax/src/test/resources/log4j.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: camel/trunk/components/camel-stax/src/test/resources/org/apache/camel/component/stax/model/jaxb.index
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stax/src/test/resources/org/apache/camel/component/stax/model/jaxb.index?rev=1205018&view=auto
==============================================================================
--- camel/trunk/components/camel-stax/src/test/resources/org/apache/camel/component/stax/model/jaxb.index (added)
+++ camel/trunk/components/camel-stax/src/test/resources/org/apache/camel/component/stax/model/jaxb.index Tue Nov 22 14:30:16 2011
@@ -0,0 +1,20 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+Orders
+Order
+Records
+Record

Added: camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd?rev=1205018&view=auto
==============================================================================
--- camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd (added)
+++ camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd Tue Nov 22 14:30:16 2011
@@ -0,0 +1,33 @@
+<?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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="records">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="record" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="record">
+    <xs:complexType>
+      <xs:attribute name="key" use="required" type="xs:string"/>
+      <xs:attribute name="value" use="required" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>

Propchange: camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-stax/src/test/resources/xsd/records.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: camel/trunk/components/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/pom.xml?rev=1205018&r1=1205017&r2=1205018&view=diff
==============================================================================
--- camel/trunk/components/pom.xml (original)
+++ camel/trunk/components/pom.xml Tue Nov 22 14:30:16 2011
@@ -131,6 +131,7 @@
     <module>camel-spring-security</module>
     <module>camel-spring-ws</module>
     <module>camel-sql</module>
+    <module>camel-stax</module>
     <module>camel-stream</module>
     <module>camel-stringtemplate</module>
     <module>camel-syslog</module>

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1205018&r1=1205017&r2=1205018&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Tue Nov 22 14:30:16 2011
@@ -701,6 +701,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-stax</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-stream</artifactId>
         <version>${project.version}</version>
       </dependency>

Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1205018&r1=1205017&r2=1205018&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original)
+++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Tue Nov 22 14:30:16 2011
@@ -633,6 +633,10 @@
     <feature version='${pom.version}'>camel-core</feature>
     <bundle>mvn:org.apache.camel/camel-sql/${pom.version}</bundle>
   </feature>
+  <feature name='camel-stax' version='${pom.version}' resolver='(obr)' start-level='50'>
+    <feature version='${pom.version}'>camel-core</feature>
+    <bundle>mvn:org.apache.camel/camel-stax/${pom.version}</bundle>
+  </feature>
   <feature name='camel-stream' version='${pom.version}' resolver='(obr)' start-level='50'>
     <feature version='${pom.version}'>camel-core</feature>
     <bundle>mvn:org.apache.camel/camel-stream/${pom.version}</bundle>

Copied: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStAXTest.java (from r1204884, camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStreamTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStAXTest.java?p2=camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStAXTest.java&p1=camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStreamTest.java&r1=1204884&r2=1205018&rev=1205018&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStreamTest.java (original)
+++ camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelStAXTest.java Tue Nov 22 14:30:16 2011
@@ -23,9 +23,9 @@ import org.ops4j.pax.exam.junit.Configur
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 
 @RunWith(JUnit4TestRunner.class)
-public class CamelStreamTest extends AbstractFeatureTest {
+public class CamelStAXTest extends AbstractFeatureTest {
 
-    public static final String COMPONENT = extractName(CamelStreamTest.class);
+    public static final String COMPONENT = "stax";
 
     @Test
     public void test() throws Exception {