7015 Commits

Author SHA1 Message Date
Spring Buildmaster
33e9442d0b [artifactory-release] Next development version 2016-01-21 12:50:41 -08:00
Spring Buildmaster
0a2b4a2a38 [artifactory-release] Release version 2.2.7.RELEASE 2016-01-21 12:50:37 -08:00
Artem Bilan
6e0b730e63 Fix failing tests 2016-01-21 10:33:23 -05:00
Gary Russell
e53399afde Fix JMS Outbound Gateway Concurrency
JIRA: https://jira.spring.io/browse/INT-3885

Backport just the fix changing `replies` to a `ConcurrentHashMap`.
2016-01-20 17:23:52 -05:00
Artem Bilan
5556821a4e INT-3483: Fix AbstractCorrelatingMH deadlock
JIRA: https://jira.spring.io/browse/INT-3483

**Cherry-pick to 4.0.x & 3.0.x**

INT-3483 Fix Test Case for < 4.1

JIRA: https://jira.spring.io/browse/INT-3483
2014-07-25 10:57:07 -04:00
Gary Russell
4425ec60ae INT-3423 Fix Expression-Based Splitter
JIRA: https://jira.spring.io/browse/INT-3423

Consider a message containing "one one" and a splitter
with expression "payload.split(' ')", only one message
is emitted.

The default Collection created by SpEL is a HashSet.

Change the ExpressionEvaluatingSplitter to expect a
List instead of a Collection.

Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/splitter/SpelSplitterIntegrationTests.java
2014-05-29 20:11:34 +03:00
Gary Russell
5eb93aa2f0 INT-3355 Improve Redis Tests
JIRA: https://jira.spring.io/browse/INT-3355

Previously, the RedisAvailableTests unconditionally
flushed Redis; this is not appropriate and could affect
other builds on the CI server (as well as wiping out the
developer's Redis DB).

Change the tests to clean up their own redis data.

Conflicts:

	.gitignore
	spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisStoreInboundChannelAdapterIntegrationTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreOutboundChannelAdapterIntegrationTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandlerTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/rules/RedisAvailableTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java
	spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageStoreTests.java

Resolved.
2014-04-08 20:09:04 +03:00
Gary Russell
e74599f18f Fix Typo in DEBUG Message 2014-03-14 15:35:25 -04:00
Gary Russell
1fde443f30 INT-3316 BeanFactoryTypeConverter Concurrency
JIRA: https://jira.spring.io/browse/INT-3316

The `SimpleTypeConverter` delegate uses property editors
which are not thread safe. We protect against concurrent
access when the source is not a String, but when a String,
we delegate to the `STC`.

Synchronize access to the `STC.convertIfNecessary()` method.
2014-03-10 20:55:34 +02:00
Gavin Gray
16476aac97 INT-3290 Fix TCP Deserializer for 0 Length Message
ByteArraySingleTerminatorSerializer does not support multiple
subsequent terminators (zero length messages).

JIRA: https://jira.springsource.org/browse/INT-3290

* Add unit test to verify bug.
* Fix bug.

Polishing:

* Remove test for `n >= 0`; n cannot be < 0 here
* Move test case to `DeserializationTests`

Conflicts:

	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/serializer/DeserializationTests.java

Resolved.
2014-02-07 13:47:10 -05:00
Gary Russell
1dbe351630 INT-3212 Backport Fixed CI Build Test
405fce672b (diff-cce1a7c963da2228ded1dd0bbea85846)

https://build.springsource.org/browse/INT-SI22SPRING30-541/
2014-01-15 12:56:03 -05:00
Artem Bilan
0cc2104b5f Upgrade to Gradle 1.7
https://build.springsource.org/browse/INT-B22X-391/log
2013-11-25 21:43:17 +02:00
Gary Russell
130acce865 INT-3216 MGS Reaper Improvements
JIRA: https://jira.springsource.org/browse/INT-3216

Previously, After a group has been selected for completion
by the reaper, if the group is otherwise completed before
the reap AND expireGroupsOnCompletion is true AND a new
group with the same ID is created, ALL in the same millisecond,
AND the group creation timestamp is used for the reap criteria,
the new group will be incorrectly reaped.

Also, for a simple MGS, it was not necessary to re-fetch the group
if the group has already been marked complete.

- Defer reaping if the group is already complete (unless it's empty).
- Verify the timestamp hasn't changed (indicating a new group)

Add tests

- Verify no refetch of a complete SMG
- Verify no reap of a complete group (after refetch)
- Verify no reap when the timestamp changed
2013-11-25 17:44:09 +02:00
Gary Russell
51af2a5480 INT-3182 Fix JMX Operation Invoking With Primitive
Previously, methods with primitive parameters were not matched
with primitive wrapper objects.

Check, if the argument is a primitive wrapper, that the paramer type
can be the equivalent primitive.

Add test case.

INT-3182 Polishing - PR Comments

Extract PrimitiveWrapper->Primitive map to ClassUtils.

JIRA: https://jira.springsource.org/browse/INT-3182

Polishing Cherry-Pick conflicts
2013-10-31 16:28:22 +02:00
Gary Russell
125a1df347 Update Bundlor Ranges for 2.2.7 2013-10-14 15:10:59 -04:00
Spring Buildmaster
46ee3c997e [artifactory-release] Next development version 2013-10-14 11:44:05 -07:00
Spring Buildmaster
1ca2a832d9 [artifactory-release] Release version 2.2.6.RELEASE 2013-10-14 11:44:00 -07:00
Artem Bilan
649c4bdc64 INT-3171: Polishing Aggregator tests
* Increase waiting timeouts
* Get rid of `Thread.sleep` when it's dangerous

JIRA: https://jira.springsource.org/browse/INT-3171
2013-10-14 11:46:35 -04:00
Artem Bilan
7be0265eb9 INT-3074: JDBC: Make generateSql as UP-TO-DATE
* remove `overwrite: 'true'` from `generateSql` task
* add `cleanSql` task

JIRA: https://jira.springsource.org/browse/INT-3074
2013-10-14 10:28:16 -04:00
Gary Russell
81dcd668a0 INT-3091 Fix Concurrent (S)FTP Transfers
byte[] and String payloads were written to a temporary file.

If the same message is transferred to two different destinations
concurrently, one of the adapters could remove the temporary
file while the other was using it.

Don't use a temporary file for these payloads, simply use the
payload byte[] [or a String.getBytes()] as the InputStream
passed to the Session.write() method.

Conflicts:

	spring-integration-file/src/main/java/org/springframework/integration/file/remote/handler/FileTransferringMessageHandler.java
	spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/AbstractInboundFileSynchronizer.java
	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpOutboundChannelAdapterParserTests.java
	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpsOutboundChannelAdapterParserTests.java
	spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests.java

Resolved.

Polishing

Polishing - Add WARN For Missing File

+ Test

Conflicts:

	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/outbound/FtpOutboundTests.java

Resolved.

JIRA: https://jira.springsource.org/browse/INT-3091
2013-10-14 09:31:55 +03:00
Artem Bilan
309454be94 INT-3162 Fix AbstractScriptExecutor Thread-Safety
JIRA: https://jira.springsource.org/browse/INT-3162
2013-10-11 11:24:15 -04:00
Artem Bilan
596724e4ee INT-3164: Fix Scripting Refresh
Previously, there was no logic to check, if a JSR223 script
was modified should be refreshed from the external resource.

* Fix `RefreshableResourceScriptSource` to take care of refreshing
on call `isModified()`
* Add `scriptSource.isModified()` before getting script text
* Introduce `ScriptSourceFactoryBean` to avoid I/O operations, when
there is need to refresh script resource - `refreshDelay < 0`

JIRA: https://jira.springsource.org/browse/INT-3164

INT-3164: change the refresh mutation logic

Remove factory bean - no longer needed.

Conflicts:

	spring-integration-groovy/src/test/java/org/springframework/integration/groovy/config/GroovyServiceActivatorTests.java

Resolved.

Added lang attribute to script. Fixed a groovy test when building with JDK7.
2013-10-11 10:53:24 -04:00
Gary Russell
5fdbb41e5c INT-3163 Force Connection Close on Send Exception
Previously, when an exception occurred on a send, the
connection was not forcibly closed. When using a
CachingClientConnectionFactory, this prevented the connection
(albeit stale) from being returned to the cache.

Perform a forced (physical) close whenever a send fails.

Add test cases for both Net and NIO implementations, using
a CCCF, to verify the connection is returned to the pool so
the closed state can be detected on the next retrieval, causing
a refresh.

Also, change the synchronization in the NIO send to
synchronize on the socketChannel, not the mapper (which is
shared).

Conflicts:

	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNetConnection.java
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactoryTests.java

Resolved.

JIRA: https://jira.springsource.org/browse/INT-3163
2013-10-06 13:10:45 +03:00
Artem Bilan
2938d1b32d INT-3161: EventChannelAdapter: fix 'auto-startup'
JIRA: https://jira.springsource.org/browse/INT-3161
2013-10-02 18:16:17 +03:00
Artem Bilan
6431474383 INT-3153: Fix Mongo Mapping for List in Headers
JIRA: https://jira.springsource.org/browse/INT-3153

Polishing: remove compiler (generic) warning in test case

Conflicts:

	spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/config/MongoDbOutboundChannelAdapterParserTests.java

Resolved.
2013-09-30 09:53:58 -04:00
Artem Bilan
6ebcc3d9f2 INT-3152: Backport polishing
JIRA: https://jira.springsource.org/browse/INT-3152
2013-09-27 21:09:08 +03:00
Gary Russell
bddbc5b6fb INT-3152 Speed Up Build Times
Add a `@Rule` to skip long-runing tests during normal builds.

Add the rule to long-running tests in gemfire, ip, jms, jmx.

Add an environment variable `RUN_LONG_INTEGRATION_TESTS`; when set
to true, all tests are run.

Set the environment variable to true on all nightly builds.

Build now runs in 13 minutes on my 3 year old laptop.

Polishing - Switch to TestWatcher

TestWatchMan is deprecated.

INT-3152 Polishing Show Skipped Tests as 'Ignored'

In test report.

JIRA: https://jira.springsource.org/browse/INT-3152
2013-09-27 20:13:10 +03:00
Artem Bilan
b81e9255d2 INT-3151: Make UriVariableTests work offline
JIRA: https://jira.springsource.org/browse/INT-3151
2013-09-26 16:26:48 +03:00
Gary Russell
33ecb6a55c INT-3146 TCP SO Timeout with Caching Client CF
https://jira.springsource.org/browse/INT-3146

Incompatibility of using socket timeouts with a caching client
connection factory.

When a socket option timeout (soTimeout) is set on a TCP connection
and the timeout occurs, the socket is closed.

When a connection is intercepted, the close is performed through
the interceptor (for example to allow a closing handshake before the
physical close).

However, the caching client connection factory is implemented
using an interceptor, which returns the underlying connection to
the cache pool (for reuse). In the case of a TcpNetConnection,
the reader thread has terminated meaning that, the next time the connection
is used, no reply will ever be received.

The work-around (when using a gateway) is to use the 'remote-timeout'
attribute instead of relying on the soTimeout. There is no
work around when using collaborating channel adapters with a Net
connection. Using NIO works because there is no reader thread
in that case, but the socket is never closed on a timeout.

Always physically close the connection whenever an exception occurs
even if the close was delegated to an interceptor.

Add test cases for Net and NIO implementations.

Conflicts:

	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactoryTests.java

Resolved.

INT-3146 Fix Test Timing Issue

Wait for server connection factory to start listening for new tests.

INT-3146 Fix Another Test Timing Issue

Increase test timer for soTimeout detection.
2013-09-24 13:39:02 -04:00
Gary Russell
e573c4c6ec INT-3144 Fix JMX Tests Timing Issue
Really only an issue with the queue channel test, but change
all tests to use CountDownLatches instead of relying on Thread.sleep().
2013-09-20 09:19:25 -04:00
Artem Bilan
6393f4262d INT-3138: add awaitTermination to delayer tests
`DelayerHandlerRescheduleIntegrationTests` fail sometimes
on asserts. Looks like `context.destroy()` works very slow
and `<delayer>` manages to send delayed Messages

JIRA: https://jira.springsource.org/browse/INT-3138
2013-09-18 14:56:08 -04:00
Gary Russell
1287c58684 INT-3098 TCP Suppress Error Log on Normal Close
Net connections suppress error logs, NIO connections did not.

Conflicts:

	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/AbstractTcpConnection.java
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioConnection.java

Resolved
2013-09-18 14:07:23 -04:00
Gary Russell
ae282dd1d5 Update to 2.2.6 Snapshot; Update Bundlor Ranges 2013-09-05 13:02:01 -04:00
Spring Buildmaster
b62dee94df [artifactory-release] Release version 2.2.5.RELEASE 2013-09-05 09:37:07 -07:00
Artem Bilan
ab25cbd621 INT-3070: Fix Delayer with MongoDbMessageStore
The `DelayHandler.DelayedMessageWrapper` works correctly, as designed by INT-3049.
However `DelayHandler.DelayedMessageWrapper` contains `Message` as a property
and `GenericMessage` can't be reconstructed automatically.

So, added new `DBObjectToGenericMessageConverter` to read `GenericMessage` for
`DelayHandler.DelayedMessageWrapper#original` property.

JIRA: https://jira.springsource.org/browse/INT-3070

Cherry-picked 2.2.x

INT-3070: PR comments

INT-3070: Remove `assert` for common state
2013-09-03 18:17:48 -04:00
Gary Russell
badb9e11dd INT-3112 Fix OOM in SimplePool
The SimplePool maintains an 'allocated' set, for the sole reason
of preventing a "foreign" (non-managed) object being returned.

When a pool item is detected as stale, it is removed from the pool
but remains in the 'allocated' set.

Add a test to verify the allocated size is reduced when a stale
item is popped from the pool.

Add a FileTransferringMessageHandler test (where the problem was
discovered).

Fix a test in TCP to expect a close().

Polishing

Do not allow returning null items to just release a permit - it
cannot remove the item from allocated. Clients must return the
stale item to the pool so it can be refreshed on the next get.

Only used by the TCP caching CF when returning a connection when
the factory is not running; but should not be allowed.

Also, protect against double release - not currently an issue with
existing users of SimplePool, but should be protected against. Could
cause the permit count to exceed the pool size.

Add inUse Set to the pool so we can detect attempts to release an
item that has already been released.
2013-08-22 11:46:08 -04:00
Artem Bilan
0d712c6f65 INT-3049-2.2.x: public DelayedMessageWrapper
JIRA: https://jira.springsource.org/browse/INT-3049
2013-08-22 01:15:30 +03:00
Artem Bilan
70ceab379f INT-3063: 'Expires' HTTP header workaround
According to RFC 2616 HTTP clients should ignore invalid values
for date-aware header, but Spring MVC `HttpHeaders` raises
`IllegalArgumentException` in this case.
Proposal fix to Spring Integration just to `try...catch` call of
`HttpHeaders.getExpires()` and `return null`.

JIRA: https://jira.springsource.org/browse/INT-3063
2013-08-19 17:03:00 -04:00
Gary Russell
9737888e57 INT-3111 Fix Close Cached TCP Connection
A TCP Connection is closed when an outbound gateway times out.

However, with the CachingClientConnectionFactory, the connection
was returned to the pool instead of being physically closed.

Override forceClose() and physically close the connection so the
next time it is retrieved from the pool it is detected as stale
and re-established.

Refactor test case and invoke it twice; once with a regular connection
factory and once with a cached factory.

Remove an unused logger.
2013-08-19 12:32:15 -04:00
jodiestjohn
91ead92170 INT-3087:Fix MongoDbMessageStore RemoveMessage Bug
Add new query so the same message found in pollMessageFromGroup is the
one which gets deleted.

See jira for more details: https://jira.springsource.org/browse/INT-3087

INT-3087 Polishing

Use an atomic method in pollMessageFromGroup to pop the first message.

Add test cases for pollMessageFromGroup and removeMessageFromGroup
where the same message exists in multiple groups.
2013-08-19 11:42:43 -04:00
Gary Russell
1a80fd7921 INT-3110 Fix JMX Control Bus With SF 3.2.3
Spring 3.2.3 registers MBean operations with parameter names
instead of the JVM default p1, p2 etc based on parameter position
in the method signature.

Since the OperationInvokingMessageHandler matched the supplied
arguments using the p1, p2 etc names, this prevented the control
bus from finding the target method.

Fall back to the old naming scheme based on parameter position
if a matching parameter is not found.

Add a test using a Map payload to supply the named arguments (p1, p2).

Add an ignored test that tests using named arguments (key, channelName).

Test with 3.1.4; remove Ignore and test with 3.2.3.

TODO: remove the Ignore annotation when SF 3.2.3 is the minimum.
2013-08-16 16:24:19 -04:00
Gary Russell
1ebebb7afb INT-3061 Update Reference Copyright 2013-08-07 20:07:58 -04:00
Gary Russell
17544147f4 INT-3089 Fix FileExistsMode.IGNORE
When writing files with this mode setting, the FWMH detected
that the final file already exists, but did not detect that
the temporary (default ....writing) file exists. This could
happen if two adapters were simulataneously processing the same
file.

Also, while a comment in the setter said an empty temp file
suffix is allowed, it did not work because the file rename
is performed unconditionally, fails, and throws an exception.

Add a check for the temporary file (if the suffix is not "").

Don't rename if the file was written in-place (no temp file suffix).

Add test cases for the FileExistsMode.IGNORE for both the final
and temporary files. Add a test where the temporary file suffix
is "", a ...writing file exists, the final file does not exist
and so is created by the handler. The ...writing file is untouched.
2013-07-16 14:02:18 -04:00
Gary Russell
d5f9ecd8d1 INT-3066 Fix NPE During Connection Recovery
The JmsOutboundGateway's Listener container could throw
an NPE during connection recovery - while logging recovery
status.

The log attempts to include the destination description which
throws the NPE if there is no destination yet established.

Only attempt to get the description if the destination has
been established. And, even then, use a try/catch block
to prevent the NPE. Log the destination as 'null' in this
case.

Add a test case to detect the NPE by adding an ErrorHandlingTaskExecutor.

No errors should be detected with the fix in place.
2013-07-12 16:32:27 -04:00
Gary Russell
388076668a INT-2721 Increase Timers on JDBC Delayer Tests
Still fail when the build server is under heavy load.
2013-06-11 17:48:07 +01:00
Spring Buildmaster
8e42f881bb [artifactory-release] Next development version
Conflicts:
	gradle.properties
2013-06-11 16:56:02 +01:00
Gary Russell
5371ead677 INT-2620 Fix Race Condition in Failover Tests
Sporadic test failures (fairly consistently on Mac).

Problem was some tests sent a message to a client socket before the
close notification had been received.

Wait for client connection to close rather than waiting for the
server to stop.

Also, with NIO, close the channel on accept exception.

Also improve debugging by including a log of new connections
including the id.
2013-06-11 16:22:44 +01:00
Gary Russell
9852e42d41 INT-3057 Base for 2.2.5
Set gradle.properties to BUILD-SNAPSHOT

Update bundlor ranges
2013-06-10 18:42:26 +01:00
Spring Buildmaster
8df42d310e [artifactory-release] Release version 2.2.4.RELEASE 2013-06-10 18:41:56 +01:00
Spring Buildmaster
ffbe8980a5 [artifactory-release] Next development version 2013-06-10 07:42:02 -07:00