Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ISPN-2928 Fix the JDBC configuration parser not to set the connectionUrl

with the driverClass value
  • Loading branch information...
commit 2af485aa47611ff0708a32becccc22d6c069713d 1 parent 75222a9
@tristantarrant tristantarrant authored galderz committed
View
4 ...re/jdbc/src/main/java/org/infinispan/loaders/jdbc/configuration/JdbcCacheStoreConfigurationParser52.java
@@ -175,7 +175,7 @@ private void parseConnectionPoolAttributes(XMLExtendedStreamReader reader,
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CONNECTION_URL: {
- builder.driverClass(value);
+ builder.connectionUrl(value);
break;
}
case DRIVER_CLASS: {
@@ -206,7 +206,7 @@ private void parseSimpleConnectionAttributes(XMLExtendedStreamReader reader,
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CONNECTION_URL: {
- builder.driverClass(value);
+ builder.connectionUrl(value);
break;
}
case DRIVER_CLASS: {
View
4 ...re/jdbc/src/main/java/org/infinispan/loaders/jdbc/configuration/JdbcCacheStoreConfigurationParser53.java
@@ -177,7 +177,7 @@ private void parseConnectionPoolAttributes(XMLExtendedStreamReader reader,
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CONNECTION_URL: {
- builder.driverClass(value);
+ builder.connectionUrl(value);
break;
}
case DRIVER_CLASS: {
@@ -208,7 +208,7 @@ private void parseSimpleConnectionAttributes(XMLExtendedStreamReader reader,
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CONNECTION_URL: {
- builder.driverClass(value);
+ builder.connectionUrl(value);
break;
}
case DRIVER_CLASS: {
View
15 cachestore/jdbc/src/test/java/org/infinispan/loaders/jdbc/configuration/XmlFileParsingTest.java
@@ -51,7 +51,7 @@ public void testStringKeyedJdbcStore() throws Exception {
" <default>\n" +
" <loaders>\n" +
" <stringKeyedJdbcStore xmlns=\"urn:infinispan:config:jdbc:5.3\" key2StringMapper=\"org.infinispan.loaders.jdbc.configuration.DummyKey2StringMapper\">\n" +
- " <connectionPool connectionUrl=\"jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1\" username=\"dbuser\" password=\"dbpass\" />\n" +
+ " <connectionPool connectionUrl=\"jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1\" username=\"dbuser\" password=\"dbpass\" driverClass=\"org.h2.Driver\"/>\n" +
" <stringKeyedTable prefix=\"entry\" fetchSize=\"34\" batchSize=\"99\" >\n" +
" <idColumn name=\"id\" type=\"VARCHAR\" />\n" +
" <dataColumn name=\"datum\" type=\"BINARY\" />\n" +
@@ -70,7 +70,11 @@ public void testStringKeyedJdbcStore() throws Exception {
assertEquals("version", store.table().timestampColumnName());
assertTrue(store.async().enabled());
assertEquals("org.infinispan.loaders.jdbc.configuration.DummyKey2StringMapper", store.key2StringMapper());
-
+ PooledConnectionFactoryConfiguration connectionFactory = (PooledConnectionFactoryConfiguration) store.connectionFactory();
+ assertEquals("jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1", connectionFactory.connectionUrl());
+ assertEquals("org.h2.Driver", connectionFactory.driverClass());
+ assertEquals("dbuser", connectionFactory.username());
+ assertEquals("dbpass", connectionFactory.password());
}
public void testBinaryKeyedJdbcStore() throws Exception {
@@ -78,7 +82,7 @@ public void testBinaryKeyedJdbcStore() throws Exception {
" <default>\n" +
" <loaders>\n" +
" <binaryKeyedJdbcStore xmlns=\"urn:infinispan:config:jdbc:5.2\" ignoreModifications=\"true\">\n" +
- " <simpleConnection connectionUrl=\"jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1\" username=\"dbuser\" password=\"dbpass\" />\n" +
+ " <simpleConnection connectionUrl=\"jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1\" username=\"dbuser\" password=\"dbpass\" driverClass=\"org.h2.Driver\"/>\n" +
" <binaryKeyedTable prefix=\"bucket\" fetchSize=\"34\" batchSize=\"99\">\n" +
" <idColumn name=\"id\" type=\"BINARY\" />\n" +
" <dataColumn name=\"datum\" type=\"BINARY\" />\n" +
@@ -98,6 +102,11 @@ public void testBinaryKeyedJdbcStore() throws Exception {
assertEquals("BINARY", store.table().dataColumnType());
assertEquals("version", store.table().timestampColumnName());
assertTrue(store.singletonStore().enabled());
+ SimpleConnectionFactoryConfiguration connectionFactory = (SimpleConnectionFactoryConfiguration) store.connectionFactory();
+ assertEquals("jdbc:h2:mem:infinispan;DB_CLOSE_DELAY=-1", connectionFactory.connectionUrl());
+ assertEquals("org.h2.Driver", connectionFactory.driverClass());
+ assertEquals("dbuser", connectionFactory.username());
+ assertEquals("dbpass", connectionFactory.password());
}
public void testMixedKeyedJdbcStore() throws Exception {
Please sign in to comment.
Something went wrong with that request. Please try again.