cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf git commit: Improve RMTXStore by using a real derby DataSource
Date Thu, 25 May 2017 20:14:23 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 35ab874f8 -> 4b23cab79


Improve RMTXStore by using a real derby DataSource


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

Branch: refs/heads/master
Commit: 4b23cab79851b073d9902e504081c13db31145cb
Parents: 35ab874
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu May 25 22:13:56 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Thu May 25 22:14:16 2017 +0200

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 rt/ws/rm/pom.xml                                |  5 +++
 .../jdbc/RMTxStoreConfigurationTest.java        | 46 +-------------------
 .../ws/rm/persistence/jdbc/txstore-ds-bean.xml  |  7 ++-
 .../ws/rm/persistence/jdbc/txstore-ds-bean2.xml |  5 ++-
 5 files changed, 17 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4b23cab7/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 14e79f9..86a086e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ target/
 velocity.log
 bin/
 node_modules/
+derby.log

http://git-wip-us.apache.org/repos/asf/cxf/blob/4b23cab7/rt/ws/rm/pom.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/pom.xml b/rt/ws/rm/pom.xml
index c512449..1746f3d 100644
--- a/rt/ws/rm/pom.xml
+++ b/rt/ws/rm/pom.xml
@@ -137,6 +137,11 @@
             <artifactId>jcl-over-slf4j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+        	<groupId>org.apache.derby</groupId>
+        	<artifactId>derby</artifactId>
+        	<scope>test</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

http://git-wip-us.apache.org/repos/asf/cxf/blob/4b23cab7/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 308d059..11f2ecb 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
@@ -19,12 +19,7 @@
 
 package org.apache.cxf.ws.rm.persistence.jdbc;
 
-import java.io.PrintWriter;
-import java.sql.Connection;
 import java.sql.SQLException;
-import java.util.logging.Logger;
-
-import javax.sql.DataSource;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
@@ -90,7 +85,7 @@ public class RMTxStoreConfigurationTest extends Assert {
 
         assertNotNull(store.getDataSource());
 
-        assertNull(store.getConnection());
+        assertNotNull(store.getConnection());
     }
 
     @Test
@@ -103,44 +98,7 @@ public class RMTxStoreConfigurationTest extends Assert {
 
         assertNotNull(store.getDataSource());
 
-        assertNull(store.getConnection());
+        assertNotNull(store.getConnection());
     }
 
-    static class TestDataSource implements DataSource {
-        public PrintWriter getLogWriter() throws SQLException {
-            return null;
-        }
-
-        public void setLogWriter(PrintWriter out) throws SQLException {
-        }
-
-        public void setLoginTimeout(int seconds) throws SQLException {
-        }
-
-        public int getLoginTimeout() throws SQLException {
-            return 0;
-        }
-
-        public <T> T unwrap(Class<T> iface) throws SQLException {
-            return null;
-        }
-
-        public boolean isWrapperFor(Class<?> iface) throws SQLException {
-            return false;
-        }
-
-        public Connection getConnection() throws SQLException {
-            // avoid creating a connection and tables at RMTxStore.init()
-            throw new SQLException("test");
-        }
-
-        public Connection getConnection(String username, String password) throws SQLException
{
-            // avoid creating a connection and tables at RMTxStore.init()
-            throw new SQLException("test");
-        }
-
-        public Logger getParentLogger() {
-            return null;
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4b23cab7/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml
index 9fe6b50..1f58f45 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean.xml
@@ -24,8 +24,11 @@
             <ref bean="testStore"/>
         </wsrm-mgr:store>
     </wsrm-mgr:rmManager>
-    <bean id="testStore" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore">
+    <bean id="testStore" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore" init-method="init"
destroy-method="destroy">
         <property name="dataSource" ref="testStoreDS"/>
     </bean>
-    <bean id="testStoreDS" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStoreConfigurationTest$TestDataSource"/>
+    <bean id="testStoreDS" class="org.apache.derby.jdbc.EmbeddedDataSource">
+    	<property name="databaseName" value="target/wsrmdb1"/>
+    	<property name="createDatabase" value="create"/>
+    </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/4b23cab7/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml
b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml
index bba8428..e5bcb45 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/jdbc/txstore-ds-bean2.xml
@@ -25,5 +25,8 @@
         </wsrm-mgr:store>
     </wsrm-mgr:rmManager>
     <wsrm-mgr:jdbcStore id="testStore" dataSource="testStoreDS"/>
-    <bean id="testStoreDS" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStoreConfigurationTest$TestDataSource"/>
+    <bean id="testStoreDS" class="org.apache.derby.jdbc.EmbeddedDataSource">
+    	<property name="databaseName" value="target/wsrmdb2"/>
+    	<property name="createDatabase" value="create"/>
+    </bean>
 </beans>


Mime
View raw message