You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2019/02/04 12:38:58 UTC

[karaf] branch master updated: [KARAF-6129] Upgrade to PAX JDBC 1.3.3

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bfa022  [KARAF-6129] Upgrade to PAX JDBC 1.3.3
     new b7ed754  Merge pull request #750 from jbonofre/KARAF-6129
7bfa022 is described below

commit 7bfa0228fda226e8a531c91a140f7e6e4384124e
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Mon Feb 4 06:43:02 2019 +0100

    [KARAF-6129] Upgrade to PAX JDBC 1.3.3
---
 .../src/main/feature/feature.xml                         |  2 +-
 .../src/test/java/org/apache/karaf/itests/XATest.java    | 14 +++++++-------
 ....datasource-derby.cfg => org.ops4j.datasource-h2.cfg} | 16 ++++++++--------
 pom.xml                                                  |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/examples/karaf-jdbc-example/karaf-jdbc-example-features/src/main/feature/feature.xml b/examples/karaf-jdbc-example/karaf-jdbc-example-features/src/main/feature/feature.xml
index f7e2e70..f757422 100644
--- a/examples/karaf-jdbc-example/karaf-jdbc-example-features/src/main/feature/feature.xml
+++ b/examples/karaf-jdbc-example/karaf-jdbc-example-features/src/main/feature/feature.xml
@@ -24,7 +24,7 @@
 
     <feature name="karaf-jdbc-example-provider" version="${project.version}">
         <config name="org.ops4j.datasource-karaf-example">
-            osgi.jdbc.driver.class=org.apache.derby.jdbc.EmbeddedDriver
+            osgi.jdbc.driver.name=derby
             dataSourceName=jdbc/karaf-example
             url=jdbc:derby:data/example/derby;create=true
         </config>
diff --git a/itests/test/src/test/java/org/apache/karaf/itests/XATest.java b/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
index 4854ab1..b55db68 100644
--- a/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
+++ b/itests/test/src/test/java/org/apache/karaf/itests/XATest.java
@@ -60,7 +60,7 @@ public class XATest extends KarafTestSupport {
         result.add(editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresBoot",
                 "instance,package,log,ssh,framework,system,eventadmin,feature,shell,management,service,jaas,deployer,diagnostic,wrap,bundle,config,kar,aries-blueprint,artemis,jms,pax-jms-artemis"));
         result.add(replaceConfigurationFile("etc/org.ops4j.connectionfactory-artemis.cfg", getConfigFile("/org/apache/karaf/itests/features/org.ops4j.connectionfactory-artemis.cfg")));
-        result.add(replaceConfigurationFile("etc/org.ops4j.datasource-derby.cfg", getConfigFile("/org/apache/karaf/itests/features/org.ops4j.datasource-derby.cfg")));
+        result.add(replaceConfigurationFile("etc/org.ops4j.datasource-h2.cfg", getConfigFile("/org/apache/karaf/itests/features/org.ops4j.datasource-h2.cfg")));
         result.add(replaceConfigurationFile("etc/xa-test-camel.xml", getConfigFile("/org/apache/karaf/itests/features/xa-test-camel.xml")));
         if (JavaVersionUtil.getMajorVersion() >= 9) {
             //need asm 6.x which support java9plus to run this test
@@ -76,9 +76,9 @@ public class XATest extends KarafTestSupport {
         Thread.sleep(10000);//wait and until artemis server up
         System.out.println(executeCommand("jms:info artemis"));
 
-        System.out.println("== Installing Derby");
+        System.out.println("== Installing H2");
         featureService.installFeature("jdbc", NO_AUTO_REFRESH);
-        featureService.installFeature("pax-jdbc-derby", NO_AUTO_REFRESH);
+        featureService.installFeature("pax-jdbc-h2", NO_AUTO_REFRESH);
         featureService.installFeature("pax-jdbc-pool-transx", NO_AUTO_REFRESH);
 
         System.out.println(" ");
@@ -98,15 +98,15 @@ public class XATest extends KarafTestSupport {
 
         System.out.println(executeCommand("camel:route-list"));
 
-        System.out.println("== Creating tables in Derby");
-        System.out.println(executeCommand("jdbc:execute derby CREATE TABLE messages (id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, message VARCHAR(1024) NOT NULL, CONSTRAINT primary_key PRIMARY KEY (id))"));
+        System.out.println("== Creating tables in H2");
+        System.out.println(executeCommand("jdbc:execute h2 CREATE TABLE messages (id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY, message VARCHAR(1024) NOT NULL, CONSTRAINT primary_key PRIMARY KEY (id))"));
 
-        System.out.println("== Sending a message in Artemis broker that should be consumed by Camel route and inserted into the Derby database");
+        System.out.println("== Sending a message in Artemis broker that should be consumed by Camel route and inserted into the H2 database");
         System.out.println(executeCommand("jms:send artemis MyQueue 'the-message'"));
 
         Thread.sleep(5000);
 
-        String output = executeCommand("jdbc:query derby select * from messages");
+        String output = executeCommand("jdbc:query h2 select * from messages");
         System.err.println(output);
 
         assertContains("the-message", output);
diff --git a/itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-derby.cfg b/itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-h2.cfg
similarity index 82%
rename from itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-derby.cfg
rename to itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-h2.cfg
index 64ade0b..ab9433e 100644
--- a/itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-derby.cfg
+++ b/itests/test/src/test/resources/org/apache/karaf/itests/features/org.ops4j.datasource-h2.cfg
@@ -17,11 +17,11 @@
 #
 ################################################################################
 
-osgi.jdbc.driver.name = derby
-osgi.jndi.service.name = derby
-osgi.jdbc.driver.class = org.apache.derby.jdbc.EmbeddedDriver
-url = jdbc:derby:data/derby/test;create=true
-pool = transx
-xa = true
-user = sa
-password =
+osgi.jdbc.driver.name=H2
+osgi.jndi.service.name=h2
+dataSourceName=h2
+url=jdbc:h2:h2
+pool=transx
+xa=true
+user=sa
+password=
diff --git a/pom.xml b/pom.xml
index 867a4d9..84c2fec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -289,7 +289,7 @@
         <pax.url.version>2.6.1</pax.url.version>
         <pax.web.version>7.2.7</pax.web.version>
         <pax.tinybundle.version>3.0.0</pax.tinybundle.version>
-        <pax.jdbc.version>1.3.2</pax.jdbc.version>
+        <pax.jdbc.version>1.3.3</pax.jdbc.version>
         <pax.jms.version>1.0.3</pax.jms.version>
         <pax.transx.version>0.4.2</pax.transx.version>