You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2012/09/09 16:09:37 UTC

svn commit: r1382505 - in /camel/trunk: examples/camel-example-etl/ examples/camel-example-etl/src/main/resources/ examples/camel-example-tracer/ examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/ examples/camel-example-tracer...

Author: cmueller
Date: Sun Sep  9 14:09:37 2012
New Revision: 1382505

URL: http://svn.apache.org/viewvc?rev=1382505&view=rev
Log:
CAMEL-4734: Consolidate the database vendors in our unit tests

Added:
    camel/trunk/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java
Modified:
    camel/trunk/examples/camel-example-etl/pom.xml
    camel/trunk/examples/camel-example-etl/src/main/resources/features.xml
    camel/trunk/examples/camel-example-tracer/pom.xml
    camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml
    camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml
    camel/trunk/parent/pom.xml

Modified: camel/trunk/examples/camel-example-etl/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-etl/pom.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-etl/pom.xml (original)
+++ camel/trunk/examples/camel-example-etl/pom.xml Sun Sep  9 14:09:37 2012
@@ -137,6 +137,7 @@
   </build>
 
   <profiles>
+    <!-- Hibernate - Derby -->
     <profile>
       <id>hibernate</id>
       <properties>
@@ -164,6 +165,7 @@
       </dependencies>
     </profile>
     
+    <!-- OpenJPA - Derby -->
     <profile>
       <id>openjpa</id>
       <activation>
@@ -228,7 +230,7 @@
       </dependencies>
     </profile>
 
-    <!-- EclipseLink - HSQLDB -->
+    <!-- EclipseLink - Derby -->
     <profile>
       <id>eclipselink</id>
       <build>
@@ -261,7 +263,5 @@
         </repository>
       </repositories>
     </profile>
-
   </profiles>
-
 </project>

Modified: camel/trunk/examples/camel-example-etl/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-etl/src/main/resources/features.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-etl/src/main/resources/features.xml (original)
+++ camel/trunk/examples/camel-example-etl/src/main/resources/features.xml Sun Sep  9 14:09:37 2012
@@ -20,7 +20,6 @@
     <repository>mvn:org.apache.camel.karaf/apache-camel/${project.version}/xml/features</repository>
 
     <feature name='openjpa-feature' version='${project.version}'>
-       <bundle>wrap:mvn:hsqldb/hsqldb/1.8.0.7</bundle> 
        <bundle>mvn:org.eclipse.persistence/javax.persistence/1.2.0</bundle>
        <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.antlr/1.2.0</bundle>
        <bundle>mvn:org.eclipse.persistence/org.eclipse.persistence.asm/1.2.0</bundle>

Modified: camel/trunk/examples/camel-example-tracer/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-tracer/pom.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-tracer/pom.xml (original)
+++ camel/trunk/examples/camel-example-tracer/pom.xml Sun Sep  9 14:09:37 2012
@@ -1,5 +1,4 @@
 <?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
@@ -16,98 +15,94 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>examples</artifactId>
+    <version>2.11-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-example-tracer</artifactId>
+  <packaging>bundle</packaging>
+  <name>Camel :: Example :: Tracer</name>
+  <description>An example showing how to persist Camel trace event messages using JPA</description>
+
+  <properties>
+    <camel.osgi.export.pkg>org.apache.camel.example.tracer</camel.osgi.export.pkg>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-jpa</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-stream</artifactId>
+    </dependency>
+
+    <!-- lets use log4j -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>
+
+    <!-- lets use hibernate by default -->
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-entitymanager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.1_spec</artifactId>
+    </dependency>
+
+    <!-- testing -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>target/classes/features.xml</file>
+                  <type>xml</type>
+                  <classifier>features</classifier>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
+      <!-- Allows the example to be run via 'mvn camel:run' -->
+      <plugin>
         <groupId>org.apache.camel</groupId>
-        <artifactId>examples</artifactId>
-        <version>2.11-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>camel-example-tracer</artifactId>
-    <packaging>bundle</packaging>
-    <name>Camel :: Example :: Tracer</name>
-    <description>An example showing how to persist Camel trace event messages using JPA</description>
-
-    <properties>
-      <camel.osgi.export.pkg>org.apache.camel.example.tracer</camel.osgi.export.pkg>
-    </properties>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-jpa</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-stream</artifactId>
-        </dependency>
-
-        <!-- lets use log4j -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-        </dependency>
-
-        <!-- lets use hibernate by default -->
-        <dependency>
-            <groupId>org.hibernate</groupId>
-            <artifactId>hibernate-entitymanager</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.hsqldb</groupId>
-            <artifactId>hsqldb</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-jta_1.1_spec</artifactId>
-        </dependency>
-
-        <!-- testing -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-    <build>
-		<plugins>
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>build-helper-maven-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>attach-artifacts</id>
-						<phase>package</phase>
-						<goals>
-							<goal>attach-artifact</goal>
-						</goals>
-						<configuration>
-							<artifacts>
-								<artifact>
-									<file>target/classes/features.xml</file>
-									<type>xml</type>
-									<classifier>features</classifier>
-								</artifact>
-							</artifacts>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-
-            <!-- Allows the example to be run via 'mvn camel:run' -->
-            <plugin>
-                <groupId>org.apache.camel</groupId>
-                <artifactId>camel-maven-plugin</artifactId>
-                <version>${project.version}</version>
-            </plugin>
-        </plugins>
-    </build>
-
+        <artifactId>camel-maven-plugin</artifactId>
+        <version>${project.version}</version>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Added: camel/trunk/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java?rev=1382505&view=auto
==============================================================================
--- camel/trunk/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java (added)
+++ camel/trunk/examples/camel-example-tracer/src/main/java/org/apache/camel/example/tracer/FixedDerbyDialect.java Sun Sep  9 14:09:37 2012
@@ -0,0 +1,33 @@
+/**
+ * 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.example.tracer;
+
+import java.sql.Types;
+
+import org.hibernate.dialect.DerbyDialect;
+
+/**
+ * See https://hibernate.onjira.com/browse/HHH-7264 for details
+ *
+ */
+public class FixedDerbyDialect extends DerbyDialect {
+
+    public FixedDerbyDialect() {
+        super();
+        registerColumnType(Types.CLOB, "clob");
+    }
+}

Modified: camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml (original)
+++ camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/persistence.xml Sun Sep  9 14:09:37 2012
@@ -24,18 +24,14 @@
     <class>org.apache.camel.processor.interceptor.jpa.JpaTraceEventMessage</class>
 
     <properties>
-      <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
-      <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
-      <property name="hibernate.connection.username" value="sa"/>
-      <property name="hibernate.connection.password" value=""/>
-      <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:camel_tracer"/>
+      <property name="hibernate.dialect" value="org.apache.camel.example.tracer.FixedDerbyDialect"/>
+      <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+      <property name="hibernate.connection.url" value="jdbc:derby:target/derby;create=true"/>
       <property name="hibernate.hbm2ddl.auto" value="create"/>
 
       <!-- debugging flags -->
-      <!--
-            <property name="hibernate.show_sql" value="true"/>
-            <property name="hibernate.format_sql" value="true"/>
-      -->
+      <!-- <property name="hibernate.show_sql" value="true"/>
+      <property name="hibernate.format_sql" value="true"/> -->
     </properties>
 
   </persistence-unit>

Modified: camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml (original)
+++ camel/trunk/examples/camel-example-tracer/src/main/resources/META-INF/spring/camel-context.xml Sun Sep  9 14:09:37 2012
@@ -121,17 +121,4 @@
     <property name="persistenceUnitName" value="tracer"/>
   </bean>
   <!-- END SNIPPET: e2 -->
-
-  <!-- let's show a simple UI to browse the database -->
-  <bean id="databaseExplorer" class="org.apache.camel.spring.util.MainRunner" lazy-init="false">
-    <property name="main" value="org.hsqldb.util.DatabaseManagerSwing"/>
-    <property name="args">
-      <list>
-        <value>--url</value>
-        <value>jdbc:hsqldb:mem:camel_tracer</value>
-      </list>
-    </property>
-    <property name="delay" value="2000"/>
-  </bean>
-
 </beans>

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1382505&r1=1382504&r2=1382505&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Sun Sep  9 14:09:37 2012
@@ -144,7 +144,6 @@
     <hbase-version>0.90.5</hbase-version>
     <hibernate-validator-bundle-version>4.1.0.Final_3</hibernate-validator-bundle-version>
     <hibernate-version>3.6.10.Final</hibernate-version>
-    <hsqldb-version>2.2.8</hsqldb-version>
     <httpunit-version>1.7</httpunit-version>
     <httpcore4-version>4.2.1</httpcore4-version> <!-- FIXME cmueller: rename to httpcore4-version -->
     <httpclient4-version>4.2.1</httpclient4-version> <!-- FIXME cmueller: rename to commons-httpclient4-version -->