Commit Graph

7276 Commits

Author SHA1 Message Date
Gary Russell
91f3674dc8 INT-3175 Add Caution About Apache HTTP Client
JIRA: https://jira.springsource.org/browse/INT-3175
2013-11-01 12:29:15 +02:00
Gary Russell
008bc8522b INT-3183 Document the IMBE 'id' Attribute
When declaring an IntegrationMBeanExporter, use an 'id' attribute
if you wish to obtain programmatic access to it (using injection
or referencing the BeanFactory.

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

Also turn off debug logging for JMX test cases.
2013-10-31 16:03:04 -04:00
Gary Russell
945eea7a36 INT-3188 Make Direct Handler Call Tests Robust
Previously, these tests examined specific stack frames to
verify the handler was directly invoked by the Dispatcher.

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

Add a utility method to scan the stack trace instead to
verify that the Dispatcher frame exists before any
MessagingMethodInvokerHelper frame.
2013-10-31 11:14:20 -04:00
Gary Russell
435064453f 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
2013-10-31 15:44:11 +02:00
Gary Russell
eaa28a9dbf INT-3186 Fix Metrics For Direct MessageHandler
When a simple MessageHandler is referenced from a
`<service-activator/>`, it is wrapped in an anonymous
AbstractReplyProducingMessageHandler to facilitate proper handling of
the `<request-handler-advice-chain/>` and so that normal
'produced no reply` messages are logged.

Previously, this caused 2 MBeans to be exposed, one for tha actual
handler; one for the wrapper.

This added more stack frames between the dispatcher and the
handler (because 2 sets of statistics were captured).

The root cause was that the MBean exporter was not aware of the
relationship between these objects.

https://jira.springsource.org/browse/INT-3186

Add code to the IntegrationMBeanExporter to suppress adding
metrics to the wrapper.

This involves detecting that it is a wrapper and not exposing
it as an MBean and, when matching handlers with endpoints,
checking that the wrapped handler is the actual handler for the endpoint.

Update test to reflect the reduced number of stack frames between
the dispatcher and handler.

Also add tests to verify the detection of multiple references to
the same ARPMH.

INT-3186: `IntegrationMBeanExporter` optimization
2013-10-31 15:38:19 +02:00
Gary Russell
cc434db959 Test Case Fixes for Latest SPR 4 Snapshot
- Close child context before parent to publish child close event to parent
- SpelRouter FB injection
- Don't pass null Method to TransactionAttributeSource.getTransactionAttribute()
2013-10-30 22:57:51 -04:00
Artem Bilan
498e9aa704 INT-2664: (S)FTP Inbound: Preserve File Timestamp
JIRA: https://jira.springsource.org/browse/INT-2664

INT-2664: add `preserve-timestamp` attribute

Doc Polishing
2013-10-30 18:00:00 -04:00
Gary Russell
848f3a5103 INT-3185 Fix Direct Handlers When Exposed as MBean
When determining candidates for direct invocation, we need
to use the target of any existing proxy (such as JMX Metrics).

Copy ServiceActivatorDefaultFrameworkMethodTests to the JMX project
and adjust to work with JMX Proxies.

INT-3185: fix for AbstractSMHFBean#checkReuse

JIRA: https://jira.springsource.org/browse/INT-3185
2013-10-30 18:58:34 +02:00
Artem Bilan
a5d4e3ab48 INT-3181: Improve JdbcChannelMS usingIdCache doc
JIRA: https://jira.springsource.org/browse/INT-3181

INT-3181: Fix JdbcChannelMS#pollMessageFromGroup

* Add `doRemoveMessageFromGroup` and check its result.
If it is `false` then just return `null`, not polled `Message`
* Add `AbstractTxTimeoutMessageStoreTests#testInt3181ConcurrentPolling` test
and implement it for some DBs
* Make a note regarding MVCC as important in the Doc

Minor Polishing
2013-10-30 09:23:16 -04:00
Artem Bilan
653df623b2 INT-1362-2: Reset RequestContextHolder in Tests
JIRA: https://jira.springsource.org/browse/INT-1362
2013-10-30 08:51:39 -04:00
Gary Russell
2bf8196353 INT-3178 Defer Publishing of TCP Open Event
Previously, the TcpConnectionOpenEvent was published as soon
as the socket was connected, but the TcpConnection was not yet
ready for use.

Defer publishing the event until the connection is fully
initialized and registered with the factory and thus available
for use.

Update the test cases to reflect this behavior.

Since the event is now published by the appropriate concrete
factory implementations, enhance the ConnectionToConnectionTests
to verify proper eventing with both Net and NIO implementations.

INT-3178: Add `theConnection` `ReadWriteLock`

INT-3178 Polishing

- Refactor obtainConnection() into obtainSharedConnection() and obtainNewConnection() for Net and NIO Client factories.
- obtainConnection is now common for these two factories, and overridden by the caching and failover factories.
- ReadWriteLock - double check for shared connection after lock obtained.

INT-3178: Polishing
2013-10-30 13:58:06 +02:00
Gary Russell
469910793c INT-3180 Add s-i-ftp/test to .gitIgnore
Inadvertently added left over test files.
2013-10-29 17:05:33 -04:00
Artem Bilan
d5e8e352b6 INT-1362 HTTP Inbound: Additional EvalCtx Vars.
JIRA: https://jira.springsource.org/browse/INT-1362, https://jira.springsource.org/browse/INT-2469

* Add to the `EvaluationContext` of HTTP Inbound Endpoints additional request variables
* Tests and documentation

INT-2669: Mention SpEL variables in JavaDocs

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

INT-1362 Doc Polishing
2013-10-29 16:34:07 -04:00
Artem Bilan
d06c1c269d INT-3180: Fix FtpParserInboundTests
JIRA: https://jira.springsource.org/browse/INT-3180

* Change non-existing interface in the config to existing one
* Change `@Test(expected=BeanCreationException.class)` to `try...catch` block
and check the StackTrace for appropriate, expected `Exception`
2013-10-29 15:44:01 -04:00
Gary Russell
928b6b8bc3 INT-2961 Make ARPMH.onInit() Final; Add doInit()
https://jira.springsource.org/browse/INT-2961

onInit() relied on subclasses calling super.onInit() to apply the
advice chain and add the BeanFactory to the MessagingTemplate.

At least one extension (smpp) failed to do this, disabling these features.

Make onInit() final and call doInit() for subclass initialization (no-op in ARPMH).

INT-2961 Polishing

- do not increase visibility of doInit in subclasses.
- remove final modifiers from doInit so user subclasses can participate in initialization if needed.
2013-10-29 10:20:19 +02:00
Gary Russell
182b232fda INT-2629 Extract Gateway Argument Mapping Strategy
https://jira.springsource.org/browse/INT-2629

Strategy for mapping gateway methods to map method arguments
to a message.

Default strategy works as today, but pluggable using attribute
'mapper' on <gateway/>.

A custom mapper should implement InboundMessageMapper<MethodArgsHolder>

where the MethodArgsHolder contains the Method object and the argument
values.

When using a custom mapper, the mapper is entirely responsible for
creating the Message - therefore 'payload-expression' attributes
and <header/> elements are not allowed.

INT-2629 Polishing - Javadocs

INT-2629 Polishing

- Introduce MethodArgsMessageMapper - higher level API for custom mapper.

INT-2629: Polishing docs
2013-10-25 14:43:59 +03:00
Artem Bilan
f0c4bdb756 INT-3166: Improve Groovy Processor Performance
Previously, there was a `synchronized` block in the `GroovyScriptExecutingMessageProcessor`
to achieve thread-safety around script variables.
In addition, the parsing and executing logic was delegated to `GroovyScriptFactory`, who, in turn,
has its own `synchronized` around script parsing.
This causes a bottleneck in a messaging architecture.

* Introduce `GroovyScriptExecutor implements ScriptExecutor`
to encapsulate Groovy parsing and executing logic
* synchronize via `ReentrantLock` only when script resource `isModified()`

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

INT-3166: Fixes and Polishing

INT-3166: add synchronized double check

INT-3166: Remove `GroovyScriptExecutor`

Polishing tests and logic around exceptions

Fix up some white space issues in Groovy*Tests
2013-10-24 16:20:24 -04:00
Artem Bilan
9367928fd7 INT-3113: Use Lettuce Redis Client
* Ensure close connections after tests
* Remove `Thread.sleep` where it is possible

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

INT-3113: Improve `RedisAvailableRule`

* Upgrade to Spring-Data-Redis-1.1.0
* Change Redis port to default one - 6379

Polish - add smart delay to SubscribableRedisChannelTests.pubSubChannelTest
2013-10-23 17:39:15 -04:00
Gary Russell
36795e5ee8 INT-3069 Add Global Gateway Method Metadata
https://jira.springsource.org/browse/INT-3069

Provide a mechanism to specify headers and payload-expression that can
be applied to all methods in the gateway.

- Headers defined as 'default' are globally applied to all gateway methods.
- Also supports 'default-payload-expression'.
- Headers defined on a specific method override the global settings.
- An `@Header` in the interface is overridden by a specific <header/> for that method (current behavior)
- An `@Header` in the interface is NOT overridden by a  <default-header/>
- Add 3 new SpEL variables:
-- #methodName (synonym for #method - deprecated)
-- #methodString (a string representation of the method showing return type and arg types)
-- #methodObject (the Method object)

	<int:gateway id="sampleGateway"
			service-interface="org.springframework.integration.gateway.GatewayInterfaceTests.Bar"
			default-request-channel="requestChannelBaz">
		<int:default-header name="name" expression="#methodName"/>
		<int:default-header name="string" expression="#methodString"/>
		<int:default-header name="object" expression="#methodObject"/>
		<int:method name="baz">
			<int:header name="name" value="overrideGlobal"/>
		</int:method>
	</int:gateway>

INT-3069 Polishing - PR Comments

- Remove extra 'method' variables, just provide `gatewayMethod`.
- Parser improvements
- Schema now enforces default-header elements to precede method elements
- Doc polishing
2013-10-23 19:35:09 +03:00
Gary Russell
6d9e48b9ac INT-3172 (S)FTP - Add Recursion Option to LS Cmd
When recursing, the returned filenames are relative to
the top level directory.

INT-3172 (S)FTP - Add Recursion to MGET Command

https://jira.springsource.org/browse/INT-3172

INT-3172 Polishing

- PR Comments
- Add Tests for SFTP (tested with Mock and real SSH)
- Enhance test to ensure subdir is in 3rd file retrieved
- Exclude "special" directories ('.' and '..') from recursion

INT-3172 Make FtpServerRule Safe For Concurrency

Previously the port was static.

- Make the port an instance variable
- Channel the `@ ClassRule` to a `@ Rule`
- Register an appropriate DefaultFtpSessionFactory bean declaration

INT-3172 Polishing; Docs

- Rename FtpServerRule to TestFtpServer
- Remove restriction on filters for MGET
- Add test for filtered MGET
- Reference docs, what's new

INT-3172 More Polish

- Fix type in reference
- Fix error message now that filter is allowed with MGET
- Remove test for filter with MGET (now valid)

INT-3172: Fix tests and typos

INT-3172: this.remoteFileSeparator for recursion
2013-10-18 12:05:43 +03:00
Artem Bilan
dd479a3ce7 INT-2866: Add (S)FTP local-directory-expression
* Add `local-directory-expression` to (S)FTP Outbound Gateways
* Add `FtpServerRule` to Apache Mina embedded FtpServer
* Add tests for (M)GET and `local-directory-expression`:
FTP tests uses `FtpServerRule`, SFTP tests need testing on real SFTP server

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

INT-2866: Documentation

INT-2866 Polishing

- Remove leading /
- Change \ to / in invalid test
- Clean up after sftp

Tested with real SSH.

INT-2866 Polishing - Add Mock SFTP Test

Run with -Dspring-profiles-active=realSSH to run with a real SSH server.

Assumes ftptest/ftptest account on localhost with the following directory tree in the user's root...

  $ tree sftpSource/
  sftpSource/
  ├── sftpSource1.txt
  ├── sftpSource2.txt
  └── subSftpSource
      └── subSftpSource1.txt

INT-2866: Polishing

INT-2866: change `remotePath` to `remoteDirectory`

Doc Polishing.
2013-10-16 15:00:02 -04:00
Artem Bilan
06979d7678 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:30:12 -04:00
Kris Jacyna
473a2282e9 INT-3170 Update Project Repo in Root Files
s/SpringSource/spring-projects/
2013-10-14 11:19:01 -04:00
Artem Bilan
08a232180b 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:25:53 -04:00
Gary Russell
ae7bc5d4f7 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.

Polishing

Polishing - Add WARN For Missing File

+ Test

JIRA: https://jira.springsource.org/browse/INT-3091
2013-10-14 09:21:41 +03:00
Artem Bilan
7b2ba3e0a3 INT-3162 Fix AbstractScriptExecutor Thread-Safety
JIRA: https://jira.springsource.org/browse/INT-3162
2013-10-11 11:17:05 -04:00
Artem Bilan
a7a722a59e 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.
2013-10-11 09:58:28 -04:00
Gary Russell
90d5a2fb98 Doc Polishing for the AMQP Support
Documentation for configuring an external listener container in
the inbound endpoints.
2013-10-10 18:00:04 -04:00
Artem Bilan
0f3ac4d867 INT-3126: Document DefaultScriptVariableGenerator
JIRA: https://jira.springsource.org/browse/INT-3126
2013-10-09 14:10:44 -04:00
Gary Russell
01b470f0c7 Fix CR Newlines:ExpressionEvaluatingMessageHandler
Lines terminated with CR instead of LF
2013-10-08 18:43:53 -04:00
Gary Russell
8dca61c62a 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).

JIRA: https://jira.springsource.org/browse/INT-3163
2013-10-06 13:02:12 +03:00
Gunnar Hillert
1fa9b92c0b INT-3085 Add a Redis-backed MetadataStore
* Add tests
* Add documentation

INT-3085 Code review changes

INT-3085 Add Twitter Integration Test

JIRA: https://jira.springsource.org/browse/INT-3085
2013-10-04 11:04:59 +03:00
Amol Nayak
bd2cde4202 INT-3150: JPA: Add support for max-results-expression
JIRA: https://jira.springsource.org/browse/INT-3150
2013-10-02 23:38:38 +03:00
Artem Bilan
fb186d3dd5 INT-2312b: Compatibility with SPR 3.2.x and 4.0
From SPR 3.2.x the 'the path mapping' is **required** for `Controller`,
But with SI it is OK, because we can configure HTTP Inbound Endpoint via `HttpRequestHandlerServlet`.

So, add check if `requestMapping.getPathPatterns()` has values and don't register HTTP Inbound Endpoint
as `HandlerMethod` and just rely on user choice.

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

INT-2312b: Polishing
2013-10-02 10:34:26 -04:00
Artem Bilan
6a9cb75668 INT-2312 Add HTTP RequestMapping support
The general idea is to use Spring-MVC as much as possible.

* Introduce `RequestMapping`, `IntegrationRequestMappingHandlerMapping`
* Introduce XSD nested element `<request-mapping>` for HTTP Inbound Endpoints
* Introduce `inboundCommonAttributes` XSD attributeGroup for HTTP Inbound Endpoints
* Introduce `IntegrationNamespaceUtils#createExpressionDefIfAttributeDefined` & `IntegrationNamespaceUtils#createDirectChannel`
* Remove deprecated `name` attribute
* Remove `UriPathHandlerMapping` as superseded by `IntegrationRequestMappingHandlerMapping`
* Add documentation for `<request-mapping>`
  - Add description to Reference Manual about `<request-mapping>`
* Add documentation to section 'What's new'
* Add additional test for `<request-mapping>`

JIRA: https://jira.springsource.org/browse/INT-2312, https://jira.springsource.org/browse/INT-2619

Additional changes:

* INT-2528 Remove deprecations in HTTP module
  - JIRA: https://jira.springsource.org/browse/INT-2528
* Add Jackson 2 support for HTTP-inbound
* Using Jackson 2 HttpMessageConverter if Jackson 2 is available in classpath
* Make `RequestMapping` public
* Introduce `HttpContextUtils` and move `HANDLER_MAPPING_BEAN_NAME` to it
* Revert and deprecate public API
* Improve JavaDocs
* Improve Reference Manual

Thanks also to Biju Kunjummen for his incorporated commit.
2013-10-01 18:00:28 -04:00
Artem Bilan
28131aab32 INT-3158: Mark Delayer Int. tests as long-running
JIRA: https://jira.springsource.org/browse/INT-3158
2013-10-01 22:57:51 +03:00
Artem Bilan
dd5c9cc18c INT-3155: Add Gradle Task 'testAll'
* Add to `LongRunningIntegrationTest` ability to read `System.properties`
Note, ENV property 'RUN_LONG_INTEGRATION_TESTS' has a preference in case of value `true`
* Add Gradle task `testAll`
* Upgrade to Gradle 1.7
* Improve build performance by adding 'inputs'/'outputs' to some tasks

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

Polishing

Remove inputs/outputs.

Polish RouterConcurrencyTest.
2013-09-30 12:01:12 -04:00
Artem Bilan
7101120589 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
2013-09-30 09:46:23 -04:00
Gary Russell
691fffc058 INT-3154 Use SPR Javadoc Stylesheet
Use the Spring Framework stylesheet for javadocs.

Fix 3 missing package-info files.

(Aside: remove cache-sessions from 2 @Ignored test case configuration files).
2013-09-27 15:01:05 -04:00
Amol Nayak
61f24c8d9e INT-2881: Add support for the firstRecord to retrieving JPA gateway
JIRA: https://jira.springsource.org/browse/INT-2881
2013-09-27 19:45:31 +03:00
Gary Russell
df6b821e4b INT-3152 Polishing Show Skipped Tests as 'Ignored'
In test report.
2013-09-27 11:39:07 -04:00
Gary Russell
65328b951b Polishing - Switch to TestWatcher
TestWatchMan is deprecated.
2013-09-27 08:28:08 -04:00
Gary Russell
be87cfc365 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.
2013-09-26 17:38:38 -04:00
Artem Bilan
65e84030fb INT-3133-2: PAs Inheritance Refactoring
JIRA: https://jira.springsource.org/browse/INT-3133

INT-3133-2: Addressing PR's comments
2013-09-26 09:42:37 -04:00
Gary Russell
4d7b94e0ee Merge pull request #897 from mbazos/INT-2768
* INT-2768:
  INT-2768 Polishing - Docs, White Space
  INT-2768: Add BeanClassLoaderAware
  INT-2768 Add XSLT Transformer Factory Class Name
2013-09-25 17:48:59 -04:00
Gary Russell
5617d2e2d8 INT-2768 Polishing - Docs, White Space
Add what's new; fix white space in test case.
2013-09-25 17:43:33 -04:00
Artem Bilan
2f8053f585 INT-2768: Add BeanClassLoaderAware 2013-09-25 17:25:20 -04:00
mbazos
3daa690426 INT-2768 Add XSLT Transformer Factory Class Name
Add the ability to inject the class name of the xslt transformer
implementation.

https://jira.springsource.org/browse/INT-2768

-add @author to java docs
-updat copywrite year to current year

add new test and check for class name that it exists.

-fix xslt payload transformer and test for unknown class name, will
now default to the jre default transformer.
2013-09-25 17:23:29 -04:00
Biju Kunjummen
bb6aebc587 INT-3142 Allow Merging of HTTP Message Converters
INT-3142: A flag to retain default converters when the user has customized messageconverters for HttpRequestHandlingController, HttpInboundGateway

* Introduced a new flag in the base class of HttpRequHttpRequestHandlingController, HttpInboundGateway - registerDefaultConverters
* Introduced a new attribute "register-default-converters" for inbound-channel-adapter and inbound-gateway to indicate if the default HttpMessageConverter's need to be registered
* Http namespace parser related changes to set the new flag
* Added additional tests to test the flag and the namespace parser related changes

Changes per feedback from Artem - additional javadoc comments, cleaned up tests

Updated: Setting the register-default-converters by default to false now, for backward compatibility reasons
Changed adapter name per feedback from Artem

Changed adapter name per feedback from Artem

Changed attribute name from register-default-converters to merge-with-default-converters

INT-3142: Atomic operation for messageConverters

'What's New' polishing

Polishing

Fix a few comments, error messages, docs, whitespace.
2013-09-25 13:26:11 -04:00
Gary Russell
a9ec7c8107 INT-3133 Doc Polishing 2013-09-24 17:36:42 -04:00