You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by cs...@apache.org on 2017/05/25 20:39:48 UTC
cxf git commit: Also use derby for driver tests
Repository: cxf
Updated Branches:
refs/heads/master 4b23cab79 -> 1cee25961
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/1cee2596
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1cee2596
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1cee2596
Branch: refs/heads/master
Commit: 1cee25961124d75cb59610f05fca2be498c000a6
Parents: 4b23cab
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Thu May 25 22:39:41 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Thu May 25 22:39:41 2017 +0200
----------------------------------------------------------------------
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/1cee2596/rt/ws/rm/pom.xml
----------------------------------------------------------------------
diff --git a/rt/ws/rm/pom.xml b/rt/ws/rm/pom.xml
index 1746f3d..1e05711 100644
--- a/rt/ws/rm/pom.xml
+++ b/rt/ws/rm/pom.xml
@@ -138,6 +138,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/1cee2596/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 a3c35a1..0590387 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/1cee2596/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 11f2ecb..c66e67a 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/1cee2596/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 a77eaab..2b919b9 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/1cee2596/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 64e2a57..a0ec293 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/1cee2596/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 75c3fb6..734c02e 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>