From 82cbafaaa4a7da2239d5cff12022545cb0575b89 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 19 Apr 2018 14:10:52 -0400 Subject: [PATCH] Downgrade to Derby-10.13.1.1 Looks like we have started to fail much often since upgrade to the `Derby-10.14.1.0`: https://github.com/spring-projects/spring-integration/commit/cb0d43db6bd3d2fe6d96b7e36099176d03e151b0 That is also related to this https://jira.spring.io/browse/INT-4445 * Remove all the `drop` mentioning for Derby scripts - it just doesn't support `IF EXISTS`. More over we don't need to worry about drops since each test now starts its own fresh embedded DB **Cherry-pick to 5.0.x** --- build.gradle | 2 +- .../src/test/java/int-derby.properties | 1 - .../jdbc/AggregatorIntegrationTests-context.xml | 4 +--- .../jdbc/AggregatorIntegrationTests.java | 13 ++++++++++++- .../jdbc/StoredProcJmxManagedBeanTests-context.xml | 11 ++--------- .../JdbcOutboundAdapterWithPollerTest-context.xml | 2 +- .../JdbcOutboundGatewayWithPoller2Test-context.xml | 2 +- .../JdbcOutboundGatewayWithPollerTest-context.xml | 2 +- .../JdbcOutboundGatewayWithSelectTest-context.xml | 2 +- .../jdbcOutboundChannelAdapterCommonConfig.xml | 2 +- .../jdbc/config/outboundPollerSchema.sql | 3 --- .../jdbc/config/outboundPollerSchemaWithData.sql | 2 -- .../integration/jdbc/config/outboundSchema.sql | 2 -- .../jdbc/lock/JdbcLockRegistryTests-context.xml | 11 +++++------ .../metadata/JdbcMetadataStoreTests-context.xml | 3 +-- ...cMessageStoreChannelIntegrationTests-context.xml | 3 +-- ...toreChannelOnePollerIntegrationTests-context.xml | 4 +--- .../store/JdbcMessageStoreChannelTests-context.xml | 3 +-- .../jdbc/store/JdbcMessageStoreTests-context.xml | 3 +-- .../jdbc/store/channel/DataSource-derby-context.xml | 2 +- .../jdbc/store/channel/DataSource-h2-context.xml | 2 +- .../jdbc/store/channel/DataSource-hsql-context.xml | 2 +- .../DerbyTxTimeoutMessageStoreTests-context.xml | 12 +----------- .../src/test/resources/commons-logging.properties | 7 ------- .../resources/derby-stored-procedures-drops.sql | 6 ------ .../derby-stored-procedures-setup-context.xml | 3 +-- 26 files changed, 36 insertions(+), 73 deletions(-) delete mode 100644 spring-integration-jdbc/src/test/resources/commons-logging.properties delete mode 100644 spring-integration-jdbc/src/test/resources/derby-stored-procedures-drops.sql diff --git a/build.gradle b/build.gradle index f1abb52203..db985ba687 100644 --- a/build.gradle +++ b/build.gradle @@ -96,7 +96,7 @@ subprojects { subproject -> commonsIoVersion = '2.4' commonsNetVersion = '3.5' curatorVersion = '2.11.1' - derbyVersion = '10.14.1.0' + derbyVersion = '10.13.1.1' eclipseLinkVersion = '2.6.4' ftpServerVersion = '1.1.1' groovyVersion = '2.4.12' diff --git a/spring-integration-jdbc/src/test/java/int-derby.properties b/spring-integration-jdbc/src/test/java/int-derby.properties index 0ecac5970d..c971c9fe09 100644 --- a/spring-integration-jdbc/src/test/java/int-derby.properties +++ b/spring-integration-jdbc/src/test/java/int-derby.properties @@ -1,4 +1,3 @@ # Placeholders for Derby: -int.drop.script=classpath:/org/springframework/integration/jdbc/schema-drop-derby.sql int.schema.script=classpath:/org/springframework/integration/jdbc/schema-derby.sql int.database.incrementer.class=org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests-context.xml index 1483599a4d..369e678e13 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests-context.xml @@ -20,9 +20,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests.java index eafd792040..b018cb4aa1 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/AggregatorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,11 +24,13 @@ import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.integration.IntegrationMessageHeaderAccessor; +import org.springframework.integration.aggregator.AggregatingMessageHandler; import org.springframework.integration.store.MessageGroupStore; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -44,6 +46,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager /** * @author Artem Bilan + * * @since 4.1 */ @ContextConfiguration @@ -57,6 +60,14 @@ public class AggregatorIntegrationTests { @Autowired private MessageGroupStore messageGroupStore; + @Autowired + private AggregatingMessageHandler aggregatingMessageHandler; + + @After + public void tearDown() { + this.aggregatingMessageHandler.stop(); + } + @Test public void testTransactionalAggregatorGroupTimeout() throws InterruptedException { this.transactionalAggregatorInput.send(new GenericMessage(1, stubHeaders(1, 2, 1))); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJmxManagedBeanTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJmxManagedBeanTests-context.xml index bc893628b3..80bbdff037 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJmxManagedBeanTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJmxManagedBeanTests-context.xml @@ -2,19 +2,12 @@ + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundAdapterWithPollerTest-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundAdapterWithPollerTest-context.xml index cad8e41093..4dfae4bc24 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundAdapterWithPollerTest-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundAdapterWithPollerTest-context.xml @@ -25,7 +25,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPoller2Test-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPoller2Test-context.xml index 15043e2eda..fb8490ee0f 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPoller2Test-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPoller2Test-context.xml @@ -25,7 +25,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPollerTest-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPollerTest-context.xml index fdad32fd21..1fbe815e99 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPollerTest-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithPollerTest-context.xml @@ -31,7 +31,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithSelectTest-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithSelectTest-context.xml index 778bb57556..fcf0e5cdde 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithSelectTest-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayWithSelectTest-context.xml @@ -27,7 +27,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcOutboundChannelAdapterCommonConfig.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcOutboundChannelAdapterCommonConfig.xml index 12cfbbc725..42e3705e00 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcOutboundChannelAdapterCommonConfig.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/jdbcOutboundChannelAdapterCommonConfig.xml @@ -11,7 +11,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchema.sql b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchema.sql index 5aedf7bc77..cda851000c 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchema.sql +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchema.sql @@ -1,5 +1,2 @@ -drop table bazz; -drop table foow; - create table bazz(id varchar(100),status int,name varchar(20)); create table foow(id varchar(100),status int,name varchar(20)); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchemaWithData.sql b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchemaWithData.sql index bb07710d3b..0a751fbbe9 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchemaWithData.sql +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundPollerSchemaWithData.sql @@ -1,5 +1,3 @@ -drop table bazz; - create table bazz(id varchar(100),status int,name varchar(20)); INSERT INTO bazz (id, status, name) VALUES (100, 3, 'Cartman') diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql index 2f6170d6f6..863388f454 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/outboundSchema.sql @@ -1,4 +1,2 @@ -drop table foos; -drop table bars; create table foos(id varchar(100), status int, name varchar(20)); create table bars(id int identity, status int, name varchar(20)); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests-context.xml index 75fbd12174..10983f3057 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests-context.xml @@ -4,15 +4,14 @@ xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" - xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd + xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - - + @@ -32,7 +31,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests-context.xml index af11b00230..49b0bff8fa 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStoreTests-context.xml @@ -9,8 +9,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelIntegrationTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelIntegrationTests-context.xml index 8052f10fb9..d5639b8d15 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelIntegrationTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelIntegrationTests-context.xml @@ -16,8 +16,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelOnePollerIntegrationTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelOnePollerIntegrationTests-context.xml index c3777c0a63..d6a4a86794 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelOnePollerIntegrationTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelOnePollerIntegrationTests-context.xml @@ -15,9 +15,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests-context.xml index 32204f0489..64bbb09f39 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreChannelTests-context.xml @@ -14,8 +14,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests-context.xml index af11b00230..49b0bff8fa 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests-context.xml @@ -9,8 +9,7 @@ - - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-derby-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-derby-context.xml index a89601d807..ed032eb1df 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-derby-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-derby-context.xml @@ -16,7 +16,7 @@ /> --> - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-h2-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-h2-context.xml index 77ef0ae379..cf85a1128b 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-h2-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-h2-context.xml @@ -16,7 +16,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-hsql-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-hsql-context.xml index d5c3051859..5e420d7040 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-hsql-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DataSource-hsql-context.xml @@ -16,7 +16,7 @@ - + diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests-context.xml b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests-context.xml index bad916beec..f62cfb937c 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests-context.xml +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/channel/DerbyTxTimeoutMessageStoreTests-context.xml @@ -1,17 +1,7 @@ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> diff --git a/spring-integration-jdbc/src/test/resources/commons-logging.properties b/spring-integration-jdbc/src/test/resources/commons-logging.properties deleted file mode 100644 index 51cd942d4c..0000000000 --- a/spring-integration-jdbc/src/test/resources/commons-logging.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Use Log4j -priority=1 -org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl -org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger - -# Configuration file of the log -#log4j.configuration=file:log4j-rabbit-stocks.properties diff --git a/spring-integration-jdbc/src/test/resources/derby-stored-procedures-drops.sql b/spring-integration-jdbc/src/test/resources/derby-stored-procedures-drops.sql deleted file mode 100644 index 1fd2685100..0000000000 --- a/spring-integration-jdbc/src/test/resources/derby-stored-procedures-drops.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP FUNCTION CONVERT_STRING_TO_UPPER_CASE; -DROP TABLE USERS; -DROP PROCEDURE CREATE_USER; -DROP PROCEDURE CREATE_USER_RETURN_ALL; -DROP TABLE JSON_MESSAGE; -DROP PROCEDURE GET_MESSAGE; diff --git a/spring-integration-jdbc/src/test/resources/derby-stored-procedures-setup-context.xml b/spring-integration-jdbc/src/test/resources/derby-stored-procedures-setup-context.xml index 7a647b57bf..0dcfe6c379 100644 --- a/spring-integration-jdbc/src/test/resources/derby-stored-procedures-setup-context.xml +++ b/spring-integration-jdbc/src/test/resources/derby-stored-procedures-setup-context.xml @@ -7,8 +7,7 @@ - - +