Commit Graph

351 Commits

Author SHA1 Message Date
Artem Bilan
dc88bb424b Drop H2 schema before JDBC tests
https://build.spring.io/browse/INT-MJATS41-1679/

**Cherry-pick to 5.1.x & 5.0.x**
2019-04-09 11:44:42 -04:00
Artem Bilan
7fa1161f5b Fix tests according new test events model in SF
https://build.spring.io/browse/INT-MASTER-1479

The `MicrometerCustomMetricsTests` and `MicrometerMetricsTests` close
an application explicitly in the test, so we can't handle test events
properly any more.
Therefore use only `DependencyInjectionTestExecutionListener` excluding
all others together with the `EventPublishingTestExecutionListener`

The `TcpConfigInboundGatewayTests` don't need to use a static holder
for the application context at all and, therefore, there is nothing to
close in the `@After` any more

There is reason to close an application context in the
`StoredProcOutboundChannelAdapterWithinChainTests`.
Other tests must take care about clean embedded DB before their start
2019-04-08 12:10:52 -04:00
Artem Bilan
d21e8f0349 URL Cleanup
This commit updates URLs to prefer the https protocol.
Redirects are not followed to avoid accidentally expanding intentionally
shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status.
While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 2638 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 19:22:26 -04:00
Artem Bilan
20e8f0af2f Fix HTTP urls to HTTPS
* Do not fix urls for the `http://apache.org/xml/features` when we
configure XML components
* Do not fix urls for localhost and fake links in tests
* Fix all the dead links in docs
2019-03-21 17:16:30 -04:00
Spring Operator
fd30d1b48b URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://foo.com (301) with 1 occurrences could not be migrated:
   ([https](https://foo.com) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://diveintomark.org/ (302) with 1 occurrences migrated to:
  /ZKSXZ/ ([https](https://diveintomark.org/) result IllegalArgumentException).
* http://foo.bar.com (UnknownHostException) with 1 occurrences migrated to:
  https://foo.bar.com ([https](https://foo.bar.com) result UnknownHostException).
* http://site1.com,http://site2.com (UnknownHostException) with 1 occurrences migrated to:
  https://site1.com,http://site2.com ([https](https://site1.com,https://site2.com) result UnknownHostException).
* http://example.org/2005/04/02/atom (404) with 1 occurrences migrated to:
  https://example.org/2005/04/02/atom ([https](https://example.org/2005/04/02/atom) result 404).
* http://example.org/audio/ph34r_my_podcast.mp3 (404) with 1 occurrences migrated to:
  https://example.org/audio/ph34r_my_podcast.mp3 ([https](https://example.org/audio/ph34r_my_podcast.mp3) result 404).
* http://example.org/feed.atom (404) with 1 occurrences migrated to:
  https://example.org/feed.atom ([https](https://example.org/feed.atom) result 404).
* http://www.puppycrawl.com/dtds/configuration_1_2.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/configuration_1_2.dtd ([https](https://www.puppycrawl.com/dtds/configuration_1_2.dtd) result 404).
* http://www.puppycrawl.com/dtds/suppressions_1_1.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/suppressions_1_1.dtd ([https](https://www.puppycrawl.com/dtds/suppressions_1_1.dtd) result 404).
* http://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd ([https](https://www.springframework.org/schema/integration/jsr223/spring-integration-jsr223.xsd) result 404).
* http://www.springframework.org/schema/integration/spring-integration-ws.xsd (404) with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/spring-integration-ws.xsd) result 404).
* http://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd (404) with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd ([https](https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://example.org with 22 occurrences migrated to:
  https://example.org ([https](https://example.org) result 200).
* http://example.org/ with 2 occurrences migrated to:
  https://example.org/ ([https](https://example.org/) result 200).
* http://feeds.bbci.co.uk/news/rss.xml with 1 occurrences migrated to:
  https://feeds.bbci.co.uk/news/rss.xml ([https](https://feeds.bbci.co.uk/news/rss.xml) result 200).
* http://www.example.com/ with 1 occurrences migrated to:
  https://www.example.com/ ([https](https://www.example.com/) result 200).
* http://www.springframework.org/schema/aop/spring-aop.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/aop/spring-aop.xsd ([https](https://www.springframework.org/schema/aop/spring-aop.xsd) result 200).
* http://www.springframework.org/schema/beans/spring-beans.xsd with 813 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* http://www.springframework.org/schema/context/spring-context.xsd with 122 occurrences migrated to:
  https://www.springframework.org/schema/context/spring-context.xsd ([https](https://www.springframework.org/schema/context/spring-context.xsd) result 200).
* http://www.springframework.org/schema/data/jpa/spring-jpa.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/data/jpa/spring-jpa.xsd ([https](https://www.springframework.org/schema/data/jpa/spring-jpa.xsd) result 200).
* http://www.springframework.org/schema/data/mongo/spring-mongo.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/data/mongo/spring-mongo.xsd ([https](https://www.springframework.org/schema/data/mongo/spring-mongo.xsd) result 200).
* http://www.springframework.org/schema/geode/spring-geode.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/geode/spring-geode.xsd ([https](https://www.springframework.org/schema/geode/spring-geode.xsd) result 200).
* http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd ([https](https://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd) result 200).
* http://www.springframework.org/schema/integration/event/spring-integration-event.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/event/spring-integration-event.xsd ([https](https://www.springframework.org/schema/integration/event/spring-integration-event.xsd) result 200).
* http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd ([https](https://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd) result 200).
* http://www.springframework.org/schema/integration/file/spring-integration-file.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/file/spring-integration-file.xsd ([https](https://www.springframework.org/schema/integration/file/spring-integration-file.xsd) result 200).
* http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd with 15 occurrences migrated to:
  https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd ([https](https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd) result 200).
* http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd with 6 occurrences migrated to:
  https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd ([https](https://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd) result 200).
* http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd ([https](https://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd) result 200).
* http://www.springframework.org/schema/integration/http/spring-integration-http.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/http/spring-integration-http.xsd ([https](https://www.springframework.org/schema/integration/http/spring-integration-http.xsd) result 200).
* http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd with 27 occurrences migrated to:
  https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd ([https](https://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd) result 200).
* http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd with 47 occurrences migrated to:
  https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd ([https](https://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd) result 200).
* http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd with 93 occurrences migrated to:
  https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd ([https](https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd) result 200).
* http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd with 32 occurrences migrated to:
  https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd ([https](https://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd) result 200).
* http://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd with 11 occurrences migrated to:
  https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd ([https](https://www.springframework.org/schema/integration/jpa/spring-integration-jpa.xsd) result 200).
* http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd ([https](https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd) result 200).
* http://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd ([https](https://www.springframework.org/schema/integration/mongodb/spring-integration-mongodb.xsd) result 200).
* http://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd ([https](https://www.springframework.org/schema/integration/mqtt/spring-integration-mqtt.xsd) result 200).
* http://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd ([https](https://www.springframework.org/schema/integration/redis/spring-integration-redis.xsd) result 200).
* http://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd ([https](https://www.springframework.org/schema/integration/rmi/spring-integration-rmi.xsd) result 200).
* http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd ([https](https://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd) result 200).
* http://www.springframework.org/schema/integration/security/spring-integration-security.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/integration/security/spring-integration-security.xsd ([https](https://www.springframework.org/schema/integration/security/spring-integration-security.xsd) result 200).
* http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd with 18 occurrences migrated to:
  https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd ([https](https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd) result 200).
* http://www.springframework.org/schema/integration/spring-integration.xsd with 731 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).
* http://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd ([https](https://www.springframework.org/schema/integration/stomp/spring-integration-stomp.xsd) result 200).
* http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd with 17 occurrences migrated to:
  https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd ([https](https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd) result 200).
* http://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd with 5 occurrences migrated to:
  https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd ([https](https://www.springframework.org/schema/integration/syslog/spring-integration-syslog.xsd) result 200).
* http://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd ([https](https://www.springframework.org/schema/integration/websocket/spring-integration-websocket.xsd) result 200).
* http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd with 10 occurrences migrated to:
  https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd ([https](https://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd) result 200).
* http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd ([https](https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd) result 200).
* http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd ([https](https://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd) result 200).
* http://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd ([https](https://www.springframework.org/schema/integration/zookeeper/spring-integration-zookeeper.xsd) result 200).
* http://www.springframework.org/schema/jdbc/spring-jdbc.xsd with 52 occurrences migrated to:
  https://www.springframework.org/schema/jdbc/spring-jdbc.xsd ([https](https://www.springframework.org/schema/jdbc/spring-jdbc.xsd) result 200).
* http://www.springframework.org/schema/jms/spring-jms.xsd with 7 occurrences migrated to:
  https://www.springframework.org/schema/jms/spring-jms.xsd ([https](https://www.springframework.org/schema/jms/spring-jms.xsd) result 200).
* http://www.springframework.org/schema/lang/spring-lang.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/lang/spring-lang.xsd ([https](https://www.springframework.org/schema/lang/spring-lang.xsd) result 200).
* http://www.springframework.org/schema/mvc/spring-mvc.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/mvc/spring-mvc.xsd ([https](https://www.springframework.org/schema/mvc/spring-mvc.xsd) result 200).
* http://www.springframework.org/schema/rabbit/spring-rabbit.xsd with 9 occurrences migrated to:
  https://www.springframework.org/schema/rabbit/spring-rabbit.xsd ([https](https://www.springframework.org/schema/rabbit/spring-rabbit.xsd) result 200).
* http://www.springframework.org/schema/security/spring-security.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/security/spring-security.xsd ([https](https://www.springframework.org/schema/security/spring-security.xsd) result 200).
* http://www.springframework.org/schema/task/spring-task.xsd with 44 occurrences migrated to:
  https://www.springframework.org/schema/task/spring-task.xsd ([https](https://www.springframework.org/schema/task/spring-task.xsd) result 200).
* http://www.springframework.org/schema/tool/spring-tool.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool.xsd ([https](https://www.springframework.org/schema/tool/spring-tool.xsd) result 200).
* http://www.springframework.org/schema/tx/spring-tx.xsd with 14 occurrences migrated to:
  https://www.springframework.org/schema/tx/spring-tx.xsd ([https](https://www.springframework.org/schema/tx/spring-tx.xsd) result 200).
* http://www.springframework.org/schema/util/spring-util.xsd with 92 occurrences migrated to:
  https://www.springframework.org/schema/util/spring-util.xsd ([https](https://www.springframework.org/schema/util/spring-util.xsd) result 200).
* http://www.springframework.org/schema/websocket/spring-websocket.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/websocket/spring-websocket.xsd ([https](https://www.springframework.org/schema/websocket/spring-websocket.xsd) result 200).
* http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd with 1 occurrences migrated to:
  https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ([https](https://java.sun.com/xml/ns/persistence/persistence_2_0.xsd) result 302).

# Ignored
These URLs were intentionally ignored.

* http://java.sun.com/xml/ns/persistence with 2 occurrences
* http://localhost with 1 occurrences
* http://localhost/ with 1 occurrences
* http://localhost/test1 with 25 occurrences
* http://localhost/test1/%2f with 1 occurrences
* http://localhost/test2 with 2 occurrences
* http://localhost/test2/ with 1 occurrences
* http://localhost:18080/it/ with 3 occurrences
* http://localhost:51235/%2f/testApps?param= with 1 occurrences
* http://test with 1 occurrences
* http://test.example.org with 1 occurrences
* http://test.org with 1 occurrences
* http://testServer/test with 1 occurrences
* http://testServer/testmp with 1 occurrences
* http://www.springframework.org/schema/aop with 25 occurrences
* http://www.springframework.org/schema/beans with 1633 occurrences
* http://www.springframework.org/schema/c with 1 occurrences
* http://www.springframework.org/schema/context with 244 occurrences
* http://www.springframework.org/schema/data/jpa with 3 occurrences
* http://www.springframework.org/schema/data/mongo with 36 occurrences
* http://www.springframework.org/schema/geode with 8 occurrences
* http://www.springframework.org/schema/integration with 1465 occurrences
* http://www.springframework.org/schema/integration/amqp with 28 occurrences
* http://www.springframework.org/schema/integration/event with 8 occurrences
* http://www.springframework.org/schema/integration/feed with 8 occurrences
* http://www.springframework.org/schema/integration/file with 54 occurrences
* http://www.springframework.org/schema/integration/ftp with 30 occurrences
* http://www.springframework.org/schema/integration/gemfire with 12 occurrences
* http://www.springframework.org/schema/integration/groovy with 27 occurrences
* http://www.springframework.org/schema/integration/http with 36 occurrences
* http://www.springframework.org/schema/integration/ip with 54 occurrences
* http://www.springframework.org/schema/integration/jdbc with 94 occurrences
* http://www.springframework.org/schema/integration/jms with 186 occurrences
* http://www.springframework.org/schema/integration/jmx with 64 occurrences
* http://www.springframework.org/schema/integration/jpa with 22 occurrences
* http://www.springframework.org/schema/integration/jsr223 with 2 occurrences
* http://www.springframework.org/schema/integration/mail with 36 occurrences
* http://www.springframework.org/schema/integration/mongodb with 34 occurrences
* http://www.springframework.org/schema/integration/mqtt with 8 occurrences
* http://www.springframework.org/schema/integration/redis with 34 occurrences
* http://www.springframework.org/schema/integration/rmi with 8 occurrences
* http://www.springframework.org/schema/integration/scripting with 28 occurrences
* http://www.springframework.org/schema/integration/security with 6 occurrences
* http://www.springframework.org/schema/integration/sftp with 36 occurrences
* http://www.springframework.org/schema/integration/stomp with 2 occurrences
* http://www.springframework.org/schema/integration/stream with 34 occurrences
* http://www.springframework.org/schema/integration/syslog with 10 occurrences
* http://www.springframework.org/schema/integration/webflux with 8 occurrences
* http://www.springframework.org/schema/integration/websocket with 2 occurrences
* http://www.springframework.org/schema/integration/ws with 22 occurrences
* http://www.springframework.org/schema/integration/xml with 24 occurrences
* http://www.springframework.org/schema/integration/xmpp with 28 occurrences
* http://www.springframework.org/schema/integration/zookeeper with 2 occurrences
* http://www.springframework.org/schema/jdbc with 104 occurrences
* http://www.springframework.org/schema/jms with 13 occurrences
* http://www.springframework.org/schema/lang with 8 occurrences
* http://www.springframework.org/schema/mvc with 2 occurrences
* http://www.springframework.org/schema/p with 19 occurrences
* http://www.springframework.org/schema/rabbit with 18 occurrences
* http://www.springframework.org/schema/security with 4 occurrences
* http://www.springframework.org/schema/task with 88 occurrences
* http://www.springframework.org/schema/tool with 8 occurrences
* http://www.springframework.org/schema/tx with 28 occurrences
* http://www.springframework.org/schema/util with 184 occurrences
* http://www.springframework.org/schema/websocket with 2 occurrences
* http://www.w3.org/1999/xhtml with 1 occurrences
* http://www.w3.org/2001/XMLSchema with 1 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 814 occurrences
* http://www.w3.org/2005/Atom with 1 occurrences

* Use the latest Checkstyle DTDs with their HTTPS variants
2019-03-20 10:39:37 -04:00
Gary Russell
78199dca9b Avoid throws Exception where possible - Phase III 2019-03-07 17:59:53 -05:00
Gary Russell
b138ab80f8 Avoid throws Exception where possible - Phase II
Final phase III to follow.

* Polishing

* Polishing
2019-03-07 16:15:22 -05:00
Artem Bilan
7efb14cf60 GH-2753: Remove Guava dependency
Fixes https://github.com/spring-projects/spring-integration/issues/2753

* Remove Guava dependency and its minor functionality from the
`StoredProcExecutor`
* Remove `@ManagedResource` and its operations/attributes from
`StoredProcExecutor` since they are not relevant any more
* Remove tests related to JMX and Guava
* Refactor all other tests in the affected classes
* Some code polishing in the `StoredProcExecutor`
2019-03-07 12:59:18 -05:00
Gary Russell
b187bca36e Avoid throws Exception where possible - Phase I
* Polishing - PR Comments
2019-03-07 12:53:52 -05:00
Gary Russell
a167290f9b GH-2776: Fix Streaming Remote File MessageSource
Fixes https://github.com/spring-projects/spring-integration/issues/2776
Also see https://github.com/spring-projects/spring-integration/issues/2777

- reset the filter for the current file if the fetch fails
- implement `Lifecycle` and clear the `toBeReceived` queue and corresponding
  filter entries

* Polishing - PR Comments **cherry-pick to all supported**

* Polishing
2019-03-01 14:35:31 -05:00
Artem Bilan
aa075439fc INT-4559: JDBC Gateway: return List for maxRows>1
JIRA: https://jira.spring.io/browse/INT-4559

* Return a single item from result only if
`maxRows == null || maxRows == 1`
* Remove deprecated `max-rows-per-poll` from the
`JdbcOutboundGateway.java` and its XSD and parsers
2019-02-22 17:14:01 -05:00
Artem Bilan
7e3b56939e Fix XSDs for actual core schema version 2019-02-21 12:43:21 -05:00
Artem Bilan
622d42c71a Migrate tests to AssertJ
Mostly thanks to IDEA's plugin: https://plugins.jetbrains.com/plugin/10345-assertions2assertj
There is still a lot of work to do when complex and composite matchers are used.

* Add `awaitility` dependency and deprecate `EventuallyMatcher` in favor
of `awaitility`
* Remove Hamcrest from dependencies and disable JUnit & Hamcrest
static imports to encourage to use only AssertJ
* Migrate JUnit assumptions in rules to AssertJ's assumptions
* Deprecate some custom matchers in favor of existing in Hamcrest
after upgrading the last to version `2.1`
* Replace `ExpectedException` rules with `assertThatThrownBy()`
* Mention `MessagePredicate` in the `testing.adoc`
2019-02-21 10:20:45 -05:00
Gary Russell
520ebbbd2c Move master to 5.2 2019-02-15 12:01:24 -05:00
Artem Bilan
04875b72b4 GH-2727: Ensure JDBC queries are logged (#2730)
* GH-2727: Ensure JDBC queries are logged

Fixes: https://github.com/spring-projects/spring-integration/issues/2727

The `JdbcTemplate` logs a message for the sql to execute when it is
supplied by the `QueryProvider`.

* Refactor `JdbcPollingChannelAdapter` to use new introduced internal
`PreparedStatementCreatorWithMaxRows` with the `QueryProvider`
* Refactor `JdbcMessageHandler` to instantiate a `generatedKeysStatementCreator`
based on the `PreparedStatementCreatorFactory`
* Verify in the `JdbcOutboundGatewayParserTests` that both fixes logs
sql queries properly

* * Implement all the delegate interfaces for the `PreparedStatementCreatorWithMaxRows`
2019-02-08 14:27:03 -05:00
Artem Bilan
63684e2012 INT-4574: JDBC: Add NOT NULL for primary keys
JIRA: https://jira.spring.io/browse/INT-4574

Some RDBMS don't allow have nullable columns for primary keys

* Add NOT NULL for all the columns involved in primary keys
2019-01-14 17:33:27 -05:00
Gary Russell
e40cfe101e Sonar fixes
Hidden fields, `o.s.i.a*` through `o.s.i.j*`.
2019-01-09 10:02:19 -05:00
Gary Russell
e8df546b04 Sonar Fixes - Javadoc-only imports 2019-01-02 12:26:22 -05:00
Gary Russell
113a371f2c Remove Exception from IOS.onInit() 2018-12-22 17:25:56 -05:00
Artem Bilan
93d7c58b64 Enable ModifierOrderCheck Checkstyle rule (#2673)
* Enable ModifierOrderCheck Checkstyle rule

* Fix violations for `static` and `abstract` modifier
* Remove redundant code in the `TcpNioConnection`
* Mark `connectionFactoryName` as `@Nullable` in the `TcpConnectionSupport`
ctor and its inheritors
* Fix some smells according IDEA suggestions in the affected classes
* This should fix some Sonar smells as well

* * Fix `HeaderMapperTests`

* * Polishing `TcpConnection` code style and fix Javdocs
2018-12-20 19:19:47 -05:00
Gary Russell
7790f9e550 Sonar fixes
Critical issues `o.s.i.t*`, `o.s.i.u*`.

* Polishing - PR Comments.
2018-12-19 14:49:27 -05:00
Gary Russell
ca2e70f236 Sonar Fixes
Critical smells for `o.s.i.jdbc`.

Fix new smell in TCP.
2018-12-10 14:31:17 -05:00
Gary Russell
7135d0603c INT-4553: Store-backed QueueChannel improvements
JIRA: https://jira.spring.io/browse/INT-4553
Fixes https://github.com/spring-projects/spring-integration/issues/2628
Fixes https://github.com/spring-projects/spring-integration/issues/2629

- Avoid `size()` calls on the MGS, use `poll()` instead.
- Optimize the indexes for the `INT_CHANNEL_MESSAGE` table.

Avoid size call when no timeout too.

Polishing - PR Comments

Missed a doc fix

Another missed %PREFIX%

Fix underscores

Polishing; PR comments; make MGQ extendable.

Fix version in doc.

* Polishing `@since`
* Use diamonds whenever it is possible

**Cherry-pick to 5.0.x**
2018-11-30 13:07:59 -05:00
Gary Russell
852ec1ee25 INT-4557 Improve query cache in JDBC channel store
JIRA: https://jira.spring.io/browse/INT-4557

- Avoid hashing the query String on each call.
- Use a concurrent map.

* Polishing - PR Comments
2018-11-19 14:17:37 -05:00
Artem Bilan
648aeb8e96 Unable ImportOrder Checkstyle rule for tests
* Fix wrong import order in tests
* Polishing for not closed application contexts
* Use diamonds
* Use proper assertion operators
* Remove redundant classes
* Improve performance in JPA tests
* Fix typos
2018-11-07 15:32:31 -05:00
Gary Russell
2b9ba714e6 JDBC, JMS, JPA Sonar fixes 2018-10-26 14:26:43 -04:00
Artem Bilan
e3ce37ca36 INT-4544: Allow runtime MBeans (un)registered (#2601)
* INT-4544: Allow runtime MBeans (un)registered

JIRA: https://jira.spring.io/browse/INT-4544

* Fix `SourcePollingChannelAdapterFactoryBean` to register an
`outputChannelName` into the `SourcePollingChannelAdapter` for late
binding, especially in case of dynamic `IntegrationFlow` registrations.
This must be back-ported to `5.0.x`
* Implement `DestructionAwareBeanPostProcessor` in the
`IntegrationMBeanExporter` for the runtime beans tracking, e.g. via
dynamic `IntegrationFlow` registrations
* Refactor `IntegrationMBeanExporter` for static and dynamic beans
registration and destruction
* Remove unused properties; introduce some new for tracking beans and
their relationship

* * Move `IntegrationMBeanExporter.registerProducer()` after
`postProcessAfterInitialization()`
* Refactor JMX test configurations to reuse MBeanServer as much as
possible and destroy the server whenever it is necessary

* * More JMX tests polishing

* * And more JMX tests polishing

* * `try...catch` in the `IntegrationMBeanExporter.postProcessAfterInitialization()`
to avoid breaking changes for the current GA phase
* Do not unregister those MBeans explicitly which weren't created at
runtime

* * Log ObjectNames in the `MBeanExporterIntegrationTests`

* * Fix `MessageMetricsAdviceTests` to rely on the application context
* Do not use a cst in the `StandardIntegrationFlowContext` for
`BeanFactory`, but an explicit `BeanDefinitionRegistry`
* Extract targets from proxies in the
`IntegrationMBeanExporter.postProcessAfterInitialization()`
* Remove logging in the `MBeanExporterIntegrationTests`

* * Fix `NotificationListeningMessageProducerTests` to reuse existing `MBeanServer`

* * Change JMX `domain` in the `DslMBeanTests` to `dsl` do not clash with
similar in the `foo` in the `MessageSourceTests`
* Use `MBeanServer` bean in the `Int2307Tests`
* Use JUnit 5ctor injection injection in the `MessageMetricsAdviceTests`

* * Fix JMX tests do not reuse existing `MBeanServer` and make them rely
on the server provided by the managed `MBeanServerFactoryBean` which
destroys a server on application context close
* Fix `StoredProcJmxManagedBeanTests-context.xml` to use `MBeanServer`
from the `<context:mbean-server>`
2018-10-19 09:51:25 -04:00
Artem Bilan
4a85849bcc INT-3364: Add batchUpdate into JdbcMessageHandler (#2534)
* INT-3364: Add batchUpdate into JdbcMessageHandler

JIRA: https://jira.spring.io/browse/INT-3364

* * Optimize items mapping with an internal `Message` implementation
* Polishing Docs and Javadocs
2018-08-02 17:41:25 -04:00
Artem Bilan
0d0605be78 INT-4381: MessageSources refactoring (#2517)
* INT-4381: MessageSources refactoring

JIRA: https://jira.spring.io/browse/INT-4381

* Make all the out-of-the-box `MessageSource` implementations based
on the `AbstractMessageSource`
* Fix `JdbcPollingChannelAdapterIntegrationTests` for sporadic failure
because of `fixed-rate` for the poller

* Fix HeaderEnricherTests race condition

The `errorChannel()` expect an error in the `testErrorChannel` after
`1000` ms, but at the same time the `poller` in configured for the
`3000` ms.

* Increase all the timeouts for replies
* Decrease a `fixed-delay` on the `poller`
* Some other code style polishing for the `HeaderEnricherTests`
2018-07-25 13:01:22 -04:00
Artem Bilan
76877b9440 INT-4499: Add JdbcMetadataStore.setLockHint()
JIRA https://jira.spring.io/browse/INT-4499
Fixes https://github.com/spring-projects/spring-integration/issues/2483

To allow to reconfigure a `SELECT ... FOR UPDATE` for particular RDBMS
vendor, we need an option to specify possible hint for the target data base.

**Cherry-pick to 5.0.x**
2018-07-11 17:52:44 -04:00
Artem Bilan
0d11c7e0ed INT-4490: DefaultLockRepo: no uppercase format
JIRA https://jira.spring.io/browse/INT-4490

The `DefaultLockRepository.prefix` can be configured with the schema name.
And this one can be case-sensitive.

* Change format hint from the `%S` to `%s` to avoid upper-casing.

**Cherry-pick to 5.0.x and 4.3.x**
2018-07-11 17:38:54 -04:00
Sundara Balaji J K
01461720da Add Query Provider for SQL Server
* updated copyright year

* indentation issue fixed

* white space - build issue fixed

* Trailing whitespace - removed

* fixed pull request comments

* Rename `SqlChannelMessageStoreQueryProvider` to `SqlServerChannelMessageStoreQueryProvider`
2018-07-10 10:49:07 -04:00
Artem Bilan
32030c3233 INT-2260: JdbcPollingChA: rename prop to maxRows
JIRA: https://jira.spring.io/browse/INT-2260

Having a feedback about confusing with the `max-rows-per-poll` property
name and its responsibility it would be better do not mention `per-poll`
at all

* Deprecate `max-rows-per-poll` in favor of new `max-rows`
* Some code style polishing, tests improvements
* Docs polishing on the matter

* Add `What's New` bullet

* Optimize `maxRows` logic
* Document vendor-specific native SELECT limiting options
* Raise warning in the parsers about deprecated `max-rows-per-poll`

Doc polishing
2018-06-19 12:13:39 -04:00
brempusz
4bb1a619a9 GH-2467: JdbcLockReg: retry on TransDataAccessExc
* GH-2467: JdbcLockRegistry should retry on DeadlockLoserDataAccessException

Fixes #2467

MySQL 5.7.15 introduced setting `innodb_deadlock_detect` (enabled by
default). As a result MySQL JDBC driver throws
`DeadlockLoserDataAccessException` when deadlock is detected.
`JdbcLockRegistry` doesn't handle it causing lock to be lost.

* Retry `doLock()` on data access deadlock instead of loosing the lock

* Use TransientDataAccessException instead of derived exceptions
2018-06-07 12:56:33 -04:00
Gary Russell
73dbdb80be INT-4477: Add getRole() to LeaderInitiator Context
JIRA: https://jira.spring.io/browse/INT-4477

When running multiple roles, it is useful to be able to determine the
role for a particular context, e.g. in an event.

* Docs

**cherry-pick to 5.0.x**
2018-05-31 10:54:35 -04:00
Artem Bilan
664d67f9bb Add small sleep between adding message to group
https://build.spring.io/browse/INT-FATS5IC-497

Fixes `JdbcMessageStoreTests` sporadic failure where there is no
guarantee that message are going to be polled from the group the same
order they've been inserted

Cherry-pick to `5.0.x`
2018-05-04 13:06:09 -04:00
Artem Bilan
f970bf0332 Remove SQL scripts generation
We don't change JDBC scripts too often and even if we do that, it's not
so hard to copy/paste the script throughout all the supported platforms
instead of rely on the pretty old VPP tool and suffer from performance
degradation during regular day-to-day development.
Plus there is some bug in the VPP when it generates a script for the
Derby, so we end up with erroneous braces in the sentence:
```
MESSAGE_SEQUENCE BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
```
I have to remove them manually each time I switch between Gradle versions
2018-04-27 17:49:19 -04:00
Artem Bilan
6dfe96d220 Fix JdbcMessageStoreTests to use H2, not Derby
Looks like Derby is much slower than H2, plus it doesn't look so stable
having so much sporadic failures.

Looks like moving to H2 here saves for us `500 ms` test working time

**Cherry-pick to 5.0.x**
2018-04-23 12:54:32 -04:00
Artem Bilan
2f1b55f48c Upgrade to Gradle 4.7 and others, polishing build (#2423)
* Upgrade to Gradle 4.7 and others, polishing build

* Fix `MqttAdapterTests` according requirement of the latest Mockito
* Move `int-derby.properties` to the `/resources` from `/java`

* Fix Checkstyle violations
2018-04-20 11:11:05 -04:00
Artem Bilan
e4e4ee092d Fix JdbcMessageStoreChannelTests race condition
The message in the `QueueChannel` appears for consuming a bit earlier
than TX is committed

* Introduce `afterCommitLatch` into the test verify the state
when TX is really committed and data is removed from DB

**Cherry-pick to 5.0.x and 4.3.x**
2018-04-20 09:40:25 -04:00
Artem Bilan
82cbafaaa4 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`:
cb0d43db6b

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**
2018-04-19 15:00:55 -04:00
Artem Bilan
15fc23c2fa INT-4447: LockRegLeaderInit: Catch unlock errors
JIRA: https://jira.spring.io/browse/INT-4447

When we get an exception during `this.lock.unlock()`, we don't revoke
leadership.
In case of external resource (e.g. JDBC) this may cause a race condition
when the second candidate is selected as leader when connection comes back

* Catch `this.lock.unlock()` exceptions and log them under DEBUG.
This way we proceed to the `handleRevoked()` logic

**Cherry-pick to 5.0.x and 4.3.x**
2018-04-18 17:07:07 -04:00
Gary Russell
b940e3872b Upgrade to SF 5.1; Remove Deprecated Code
Polishing - PR Comments

Remove direct log4j usage in tests

- hazelcast depends on it; retain the dependency just in jmx

Fix hazelcast logger type
2018-04-10 18:49:42 -04:00
Artem Bilan
27318c7ee5 INT-4445: Fix JDBC tests for Derby
JIRA: https://jira.spring.io/browse/INT-4445

Looks like `/dataSource` temporary directory is busy in between different
tests.
The thought is like a high-frequently polling endpoint keeps DB resource
from removing.

* Explicitly `stop()` endpoint in the `JdbcMessageStoreChannelTests`
* Optimize
`JdbcMessageStoreChannelTests.testSendAndActivateTransactionalSend()`
to rely on the short `1` millisecond TX timeout.
This safes for us 10 seconds of the tests executions.
* Configure all the embedded DB beans for the `ignore-failures="ALL"`
as a fallback option if polling endpoint is not a cause of the concurrent
resource access.

**Cherry-pick to 5.0.x**
2018-04-09 14:41:53 -04:00
Artem Bilan
7b86ca7bc8 Upgrade to H2 1.4.197
https://build.spring.io/browse/INT-FATS5IC-457

The H2 `1.4.197` has fixed some issues
(in particular https://github.com/h2database/h2database/issues/178)
and introduced some breaking changes for us, although they are
reasonably good.

* Fix `JdbcOutboundGatewayParserTests` to use correct identifiers
for returned generated keys instead of previously used `SCOPE_IDENTITY()`

**Cherry-pick to 5.0.x and 4.3.x**
2018-03-26 12:24:48 -04:00
Artem Bilan
da6f47cf40 Reorder beans in JdbcPollingChAParserTests cofigs
https://build.spring.io/browse/INT-AT42SIO-820/

The test configs use `fixed-rate="100"`.
This way when Inbound Channel Adapter is declared earlier in the
config than `<jdbc:embedded-database>`, there is a chance that we start
to poll DB before it is really initialized.

* Reorder config so embedded DB is initialized before an
Inbound Channel Adapter

**Cherry-pick to 5.0.x, 4.3.x and 4.2.x**
2018-03-26 11:07:36 -04:00
Artem Bilan
027021d6e4 Move XSDs to version 5.1
* Upgrade to Spring AMQP-2.1 and fix compatibility
2018-03-17 09:58:40 -04:00
Artem Bilan
cb0d43db6b Fix JDBC tests and some upgrades
https://build.spring.io/browse/INT-FATS5IC-430

Looks like there is a race condition when our polling rate around
data base is too fast and we have access to the DB files even during
application context close.

* Stop polling channel adapter in the tests explicitly after test methods
* Increase some tests performance decreasing timeouts to wait
* Upgrade to Reactor-3.1.5, AssertJ-3.9.1, Derby-10.14.1.0 and some
Gradle plugins

* Upgrade to `reactor-netty-0.7.5`
* Remove workaround from the `StompServerIntegrationTests`

* Upgrade to Spring Data Kay SR5

* Upgrade to Spring Security 5.0.3
* Increase timeouts and performance in the `StreamTransformerParserTests`
2018-02-28 11:57:21 -05:00
Artem Bilan
09aeaac4da INT-4396: Add retrying lock in case of exception
JIRA: https://jira.spring.io/browse/INT-4396

When target distributed `Lock` implementation throws an exception, e.g.
in case of no connection to the service, the `LockRegistryLeaderInitiator`
exists the loop and can come back to the elections only after restart

* Catch all the exception on `this.lock.tryLock()` and resubmit
`LeaderSelector` for a new locking cycle if
`LockRegistryLeaderInitiator.isRunning()` and `InterruptedException`

* Remove diagnostics from the `JdbcLockRegistryLeaderInitiatorTests`
since this fix confirms that we just didn't have a reconnect logic before
when this test failed sporadically

**Cherry-pick to 4.3.x**
2018-02-09 16:09:22 -05:00
Artem Bilan
2fbb6fbaf4 Fix JdbcLockRegDiffClientTests race condition
https://build.spring.io/browse/INT-MJATS41-1242

When different `DefaultLockRepository` instances use the same client id,
there is a possibility that they will update the same row in the table.
This way we have a chance that not only one obtains a lock and try to
add a value to the collection.

* Remove the test-case for the same client id as non-stable and even
dangerous by the the distributed lock purpose
* Use `tryLock(Long.MAX_VALUE)` to really ensure the wait behavior
during the concurrent loop
* Use `20` for thread pool to align with the tasks amount

**Cherry-picked to 4.3.x**
2018-01-24 17:26:33 -05:00