cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/9] cxf git commit: Also use derby for driver tests
Date Wed, 07 Jun 2017 17:54:08 GMT
Also use derby for driver tests


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f89f2d7e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f89f2d7e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f89f2d7e

Branch: refs/heads/3.1.x-fixes
Commit: f89f2d7ee64188bbde9a7c019b2831922fa66540
Parents: f83208e
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu May 25 22:39:41 2017 +0200
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Jun 7 12:36:10 2017 -0400

----------------------------------------------------------------------
 rt/ws/rm/pom.xml                                              | 5 +++++
 .../java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java | 4 ++++
 .../ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java    | 7 ++++---
 .../org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml    | 4 +++-
 .../cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml  | 4 ++--
 .../cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml | 5 ++++-
 6 files changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/pom.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/pom.xml b/rt/ws/rm/pom.xml
index 851419b..cc44ec3 100644
--- a/rt/ws/rm/pom.xml
+++ b/rt/ws/rm/pom.xml
@@ -132,6 +132,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
         	<groupId>org.apache.derby</groupId>
         	<artifactId>derby</artifactId>
         	<scope>test</scope>

http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
index e3cfa0b..c101112 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
@@ -834,6 +834,10 @@ public class RMTxStore implements RMStore {
     
     protected void createTables() throws SQLException {
         Connection con = verifyConnection();
+        if (con == null) {
+            LOG.warning("Skip creating tables as we have no connection.");
+            return;
+        }
         Statement stmt = null;
         
         try {

http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java
index 967b00d..6fa941d 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStoreConfigurationTest.java
@@ -41,11 +41,11 @@ public class RMTxStoreConfigurationTest extends Assert {
         assertNotNull(manager);
         RMTxStore store = (RMTxStore)manager.getStore();
         assertNotNull(store);
-        assertNull("Connection should be null", store.getConnection());
-        assertEquals("org.apache.derby.jdbc.NoDriver", store.getDriverClassName());
+        assertNotNull("Connection should be null", store.getConnection());
+        assertEquals("org.apache.derby.jdbc.EmbeddedDriver", store.getDriverClassName());
         assertEquals("scott", store.getUserName());
         assertEquals("tiger", store.getPassword());
-        assertEquals("jdbc:derby://localhost:1527/rmdb;create=true", store.getUrl());
+        assertEquals("jdbc:derby:target/wsrmdb3;create=true", store.getUrl());
         assertNull("schema should be unset", store.getSchemaName());
     }
    
@@ -64,6 +64,7 @@ public class RMTxStoreConfigurationTest extends Assert {
 
     @Test
     public void testSetCustomTableExistsState2() {
+        RMTxStore.deleteDatabaseFiles("target/wsrmdb5", true);
         SpringBusFactory factory = new SpringBusFactory();
         Bus bus = factory.createBus("org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml");
         RMManager manager = bus.getExtension(RMManager.class);

http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml
index 5e2fe1b..149bdb9 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-bean.xml
@@ -24,5 +24,7 @@
             <ref bean="testStore"/>
         </wsrm-mgr:store>
     </wsrm-mgr:rmManager>
-    <wsrm-mgr:jdbcStore id="testStore" userName="scott" password="tiger" url="jdbc:derby://localhost:1527/rmdb;create=true"
driverClassName="org.apache.derby.jdbc.NoDriver"/>
+    <wsrm-mgr:jdbcStore id="testStore" userName="scott" password="tiger" 
+    	url="jdbc:derby:target/wsrmdb3;create=true"
+    	driverClassName="org.apache.derby.jdbc.EmbeddedDriver"/>
 </beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml
index 59e4bd5..d4596a6 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean.xml
@@ -27,8 +27,8 @@
     <bean id="testStore" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore">
         <property name="userName" value="scott"/>
         <property name="password" value="abc123"/>
-        <property name="driverClassName" value="org.apache.derby.jdbc.NoDriver"/>
-        <property name="url" value="jdbc:custom://localhost:1527/rmdb;create=true"/>
+        <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+        <property name="url" value="jdbc:derby:target/wsrmdb4;create=true"/>
         <property name="tableExistsState" value="I6000"/>
     </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/f89f2d7e/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml
index 2e3b200..ddd8165 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-custom-error-bean2.xml
@@ -24,5 +24,8 @@
             <ref bean="testStore"/>
         </wsrm-mgr:store>
     </wsrm-mgr:rmManager>
-    <wsrm-mgr:jdbcStore id="testStore" userName="scott" password="abc123" driverClassName="org.apache.derby.jdbc.NoDriver"
url="jdbc:custom://localhost:1527/rmdb;create=true" tableExistsState="I6000"/>
+    <wsrm-mgr:jdbcStore id="testStore" userName="scott" password="abc123" 
+    	driverClassName="org.apache.derby.jdbc.EmbeddedDriver" 
+    	url="jdbc:derby:target/wsrmdb5;create=true" 
+    	tableExistsState="I6000"/>
 </beans>


Mime
View raw message