Commit Graph

253 Commits

Author SHA1 Message Date
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
a01d09f0f1 Sonar Fixes
Final critical smells.
2018-12-20 11:58:32 -05:00
Gary Russell
e8bd31cc37 Sonar fixes
Critical smells `0.s.i.r*`

* Polishing - PR Comments.
2018-12-19 09:47:57 -05:00
Artem Bilan
89fdb938de Increase expire period for testExpireTwoRegistries
https://build.spring.io/browse/INT-MASTER-1313/

**Cherry-pick to 5.0.x**
2018-12-14 11:52:21 -05:00
Artem Bilan
c5f29fc6ef RedisLock: Throw exception from unlock on expire (#2661)
* RedisLock: Throw exception from unlock on expire

The lock might be expired in target Redis store in between `lock()` and
`unlock()`.
So, throw an `IllegalStateException` when lock is expired during
unlocking.
At the same time the lock lock is unlocked anyway.

**Cherry-pick to 5.0.x**

* * Create a new test for exception
* Add more info into the exception
2018-12-14 11:38:38 -05:00
Gary Russell
433ef4c4aa Address Sonar reports for recent commits 2018-11-08 13:08:53 -05:00
Artem Bilan
1e66b6b55d Redis Sonar fixes 2018-10-26 14:16:26 -04:00
Gary Russell
23a3462d8b Add @NonNullApi where appropriate
Packages with `@Nullable` annotations need to have `@NonNulApi` at the package level.

There may be classes in these packages that have nullable arguments/returns that are
not currently marked as `@Nullable`. These will be fixed over time.

Also suppress JSR305 warnings when compiling tests.

* Polishing - PR Comments
2018-08-01 16:53:42 -04:00
Artem Bilan
3ab037f1eb Fix RedisUtils to detect UNLINK per RedisOps
This might be a fact that application doesn't use a single
`RedisOperations`.
Also the same JVM may be shared between several applications with
different connections to different Redis servers

* change plain `Boolean unlinkAvailable` property to the
`Map<RedisOperations<?, ?>, Boolean>` and `computeIfAbsent()` per
provided `RedisOperations`
2018-07-26 14:36:33 -04:00
Artem Bilan
88c7646ed9 INT-4507: Use UNLINK in RedisMessageStore if any
JIRA: https://jira.spring.io/browse/INT-4507

* Add `RedisUtils` with the `isUnlinkAvailable()` to check the Redis
server version to be sure that `UNLINK` is available or not
* Use `RedisUtils.isUnlinkAvailable()` in the `RedisMessageStore` and
`RedisLockRegistry` when a removal functionality is performed
* Add `AbstractKeyValueMessageStore.doRemoveAll(Collection<Object> ids)`
for optimization
* Implement `doRemoveAll()` in the `RedisMessageStore` and
`GemfireMessageStore`

**Cherry-pick to 5.0.x**
2018-07-25 16:30:03 -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
a1f016a94c INT-4498: StreamUtils -> FileCopyUtils
JIRA: https://jira.spring.io/browse/INT-4498

* Use `FileCopyUtils` instead of `StreamUtils` in test-cases when we deal
with `InputStream` s and files resources.
* Fix reflection-based tests with AOP to use an `ArrayList` access
instead of `LinkedList` since an optimization in SF:
6d6aa72e8f

**Cherry-pick to 5.0.x and 4.3.x**
2018-07-09 13:39:56 -04:00
Artem Bilan
5a362b62ff Destroy RmiInboundGateway.RmiServiceExporter (#2481)
* Destroy RmiInboundGateway.RmiServiceExporter

The internal instance `RmiServiceExporter` of the `RmiInboundGateway`
has to be destroyed together with the outer instance to unbind `service`
from the RMI registry

* Perform some polishing for the `RmiInboundGateway` and optimize
a `AbstractInboundGatewayParser` for late channels binding

* * Polishing some tests
* Expose getters for channels on the `MessagingGatewaySupport`
* Fix RMI tests to use random port
2018-06-15 08:40:11 -04:00
Artem Bilan
85bc183849 INT-4486: Properly implement stop(Runnable)
JIRA: https://jira.spring.io/browse/INT-4486

The `SmartLifecycle.stop(Runnable callback)` must always call the
`callback` in the end independently of the internal state

* Revise all the `SmartLifecycle` implementations for the proper
`callback` handling

**Cherry-pick to 5.0.x and 4.3.x**
2018-06-11 17:51:20 -04:00
Artem Bilan
c9faf3c8ce Fix LockRegLeaderIn for interrupted Thread.sleep (#2455)
* Fix LockRegLeaderIn for interrupted Thread.sleep

https://build.spring.io/browse/INT-FATS5IC-517

If current thread is interrupted, the `Thread.sleep()` interrupts
immediately.
In the catch block of the main loop in the `LockRegistryLeaderInitiator`
we have such a dangerous `sleep()` and don't restart election in this
candidate any more

* Move `Thread.sleep()` to else after checking the current thread for
interrupted state
* Remove `LongRunningIntegrationTest` rule from the
`RedisLockRegistryLeaderInitiatorTests` since it now works much faster
after proper `busy-wait` handling

**Cherry-pick to master**

* Ignore interruption on the sleep i catch and move on with loop
2018-05-30 15:23:26 -04:00
Artem Bilan
59d6c279a4 Fix RedisLockLeaderInitiatorTests timing barrier
https://build.spring.io/browse/INT-FATS5IC-509

Looks like `busyWait` period as `5 secs` is too aggressive and may be
two or more cycles pass until the election happens.
At this time the waiting for the `granted` latch in `10 secs`
may expire already, therefore we fail in the assertion

* Decrease `busyWait` to the `1 secs` to let the election cycle to pass
quickly
* Increase latch wait time to the `20 secs`

**Cherry-pick to 5.0.x**
2018-05-16 13:08:43 -04:00
Artem Bilan
081d0d160b Fix one more race condition in RedisLeaderTests
https://build.spring.io/browse/INT-SI50X-JOB1-56

We can't wait for the latch in the interruptable code flow;
we can't have a round-robing election guarantees.

* Add `Thread.sleep(LockRegistryLeaderInitiator.this.busyWaitMillis)`
to the `LockRegistryLeaderInitiator` when we restart the main task
* Remove latches waiting and thread shifting from the
`RedisLockRegistryLeaderInitiatorTests`
* Use long `busyWaitMillis` for yielding initiator to let the second
candidate to be elected

**Cherry-pick to 5.0.x**
2018-05-08 19:02:14 -04:00
Artem Bilan
51c49519dc Fix RedisLockRegLeaderInitTests race condition
https://build.spring.io/browse/INT-FATS5IC-501/

When we try to wait for the `Latch` in the interruptable code flow,
it is a fact that we step away from the waiting and end up with the
race condition downstream.

* Wrap `Latch` in the interruptable `publishOnRevoked()` code to the
`Executor.execute()`
* Remove `deleteTimeoutMillis` option from the `RedisLockRegistry`
since it doesn't make sense in the interruptable code.
* Add `RedisLockRegistry.setExecutor()` to allow to inject an external
`Executor`
* Add more debug logging into the `LockRegistryLeaderInitiator`

**Cherry-pick to 5.0.x**
2018-05-08 16:17:58 -04:00
Artem Bilan
b8d4e6b0de Use Lettuce Redis client; Redis module fixes (#2435)
* Use Lettuce Redis client; Redis module fixes

The Lettuce client is based on the Netty and more stable, than Jedis
therefore we get a performance improvement for tests
(it saves us at about 30 seconds).
Also this client doesn't fail for me on Windows sporadically (very often)
 with the `ConnectionClosedException`

* After switching to the Netty-based client, we expose the interrupted
Thread issue in the `LockRegistryLeaderInitiator`.
If we interrupted (expected behavior), we try to unlock calling
`RedisLockRegistry`, but Netty client reject our request because the
thread is interrupted, therefore we never delete the lock when we yield
our leadership.
Fix the issue with shifting a `RedisTemplate.delete()` operation to the
`ExecutorService` when the current thread is interrupted
* Allow to configure such an `ExecutorService` and timeout to wait for
the `submit()` result
* Refactor `RedisAvailableRule` and all the Redis tests do not expose
the target `RedisConnectionFactory` implementation.
* Make all the test-cases based on the `connectionFactory` created by
the `RedisAvailableTests.setupConnectionFactory()`
* Tweak some unnecessary timeouts and sleeps for better tests task
throughput

* Add a `Log4j2LevelAdjuster` into the `RedisLockRegistryLeaderInitiatorTests`
2018-05-04 14:13:51 -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
Gary Russell
82f252dd00 INT-4390: Fix tangles
JIRA: https://jira.spring.io/browse/INT-4390

Phase I: flow context/registration cycle

- extract interfaces
- rename implementations to `Standard...`

Phase II - dsl<->dsl.channel tangles

Move the channel specs to dsl.

Fix missing refactorings

(Not related to DSL) - rename core `event` package to `events`

- avoid collision with event module package
- fix tangle caused by `MessageGroupExpiredEvent`.

Phase III - dsl<->config.dsl

- move classes from config.dsl to dsl

(Not related to DSL) - fix many tangles caused by graph being a sub-package of support.management
 - make `graph` a top-level package

(Not related to DSL) - move `IntegrationManagementConfigurer` from
`management` to `config` - tangle between core and management
* Polishing Copyrights, diamonds, some JavaDocs and What's New
2018-03-16 14:59:47 -04:00
Gary Russell
525eb004ec Update Master to 5.1.0.BUILD-SNAPSHOT
`JedisConnection.execute()` no longer accepts `null` arguments.

8adea79e67

* Spring Security 5.1; Reactor 3.2
2018-03-12 21:13:32 -04:00
Artem Bilan
e46fc9b738 INT-4407: Add merge option to Log4j2LevelAdjuster
JIRA: https://jira.spring.io/browse/INT-4407

To make a `Log4j2LevelAdjuster` more builder friendly, add a `merge`
option to the overloaded `classes()` and `categories()` methods.
This way the existing (or previously configured) `categories` and
`classes` are merged with the provided values and default
`org.springframework.integration` category can be reuse.

Note: this behavior can be reconsidered as default one in the `5.1`
2018-02-20 15:05:46 -05:00
Artem Bilan
23687e438c Clean Redis keys before testing
https://build.spring.io/browse/INT-FATS5IC-400

When we run several concurrent builds (e.g. CI) and use the same shared
Redis server we may end up with the case when one process reads data
populated by another because we use the same key (groupId in our case)

* Fix `RedisMessageGroupStoreTests` to use `UUID.randomUUID()`
for the `groupId`

**Cherry-pick to 4.3.x**
2018-01-30 10:33:56 -05:00
Artem Bilan
30450c48be INT-4376: Upgage to Log4J 2 (#2321)
* INT-4376: Upgage to Log4J 2

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

* Deprecate Log4J 1.x components in favor of newly added
a `Log4j2LevelAdjuster` JUnit `@Rule`
* Update all the logging configuration to Log4J 2

* Polishing after testing
2018-01-11 10:59:55 -05:00
Artem Bilan
7ca20e53f7 GH-2268: Add RedisHeaders.MESSAGE_SOURCE header
Resolves: /spring-projects/spring-integration#2268

* To indicate the source the Redis message in the `RedisInboundChannelAdapter`
populate the `RedisHeaders.MESSAGE_SOURCE` header to the messages to produce
* Fix the `SimpleMessageConverter` to populate the provided `MessageHeaders`
to the message to produce

* Add `toMessage(T object, @Nullable Map<String, Object> headers)`
to the `InboundMessageMapper` to propagate additional header
to the message to create
* Rework all the out-of-the-box `InboundMessageMapper` implementations
to properly propagate additional headers via `toMessage()`
from the `SimpleMessageConverter`
* Provide optimizations in the `InboundMessageMapper` implementations
do not re-create messages
* Refactor `MutableMessage.toString()` to align with the `GenericMessage`

* Add more `@Nullable` to method arguments
* Increase latch wait timeout in the `EndpointParserTests`
* Address `redis.adoc` PR comment
2017-11-15 11:06:18 -05:00
Artem Bilan
a61327766e GH-2207: Clarify RedisMetadataStore in cluster
Resolves: spring-projects/spring-integration#2207

* Since the `WATCH` command isn't supported on clustered connections,
the `RedisMetadataStore.replace()` operation can't be used there.
Document this limitation
2017-11-10 11:37:47 -05:00
Artem Bilan
bc4337ffa8 GH-2071: Upgrade to S-WS-3.0 and Smack-4.2.1
Fixes: spring-projects/spring-integration#2071

* Clean up `build.gradle` for redundant excludes
* Add `javax.mail` dependency to WS module to avoid WARN about missed providers
* Refactoring for the XMPP module according changes in the latest Smack
* Polishing for the `BackToBackAdapterTests` to avoid extra wait for `null`
on the channel and some race conditions when client is closed during by the
`stop()` during publishing

Polishing `UriVariableTests` according the latest S-WS B-S

Revert excludes removal
2017-10-16 16:25:01 -04:00
Artem Bilan
1f88e2de7b INT-4354: Add beanClassLoader support to RedisMS
JIRA: https://jira.spring.io/browse/INT-4354

It's hard to test different ClassLoader in unit tests, so the fix
comes without them

**Cherry-pick to 4.3.x**
2017-10-16 16:10:32 -04:00
Glenn Renfro
1979f91cf5 INT-4357: LeaderInit: Add failed to lock event
JIRA: https://jira.spring.io/browse/INT-4357

Updated based on code review.

Updated adocs

*Polishing code style, typos
* Add protection from NPE when `LockRegistryLeaderInitiator` isn't
supplied with the `leaderEventPublisher`
* Add `What's New` note
2017-10-13 13:15:12 -04:00
Venil Noronha
a65de25572 INT-4343: Add executor option to the RedisInChA
JIRA: https://jira.springsource.org/browse/INT-4343

* Add a `Executor` setter named `setTaskExecutor` in
`RedisInboundChannelAdapter` to set the container's task executor.

* Add a `task-executor` attribute to
`<int-redis:inbound-channel-adapter>`.

* Update RedisInboundChannelAdapterParser configuration validation
tests.

* Update redis.adoc and whats-new.adoc.

* Polishing according PR comments
* Improve `RedisQueueGatewayIntegrationTests` performance
2017-09-19 18:18:30 -04:00
Artem Bilan
5263ea6dff INT-4123: Add Prefix to the Key-Value MSs
Fixes spring-projects/spring-integration#2213
JIRA: https://jira.spring.io/browse/INT-4123

Fully different `MessageStore`s can be configured for the same shared
Key-Value data-base.
Since the retrieval logic is based on the keys, that may cause the
unexpected messages expiration via `MessageGroupStoreReaper`.

* To distinguish store instances on the shared store add `prefix`
option to the `AbstractKeyValueMessageStore`

* Deprecate the `GemfireMessageStore` `Cache`-based configuration - `setIgnoreJta()` and `afterPropertiesSet()`.
The `GemfireMessageStore` relies only on an externally configured `Region`.

**Cherry-pick to 4.3.x**

Doc Polishing
2017-09-11 14:24:33 -04:00
Matthias Jeschke
b9c8a8edf8 INT-4341: RedisQueueIn: support receiveTimeout=0
JIRA: https://jira.spring.io/browse/INT-4341
Fixes spring-projects/spring-integration#2228

Add to the `RedisQueueInboundGateway` and `RedisQueueMessageDrivenEndpoint`support
for the `receiveTimeout` of 0 and block indefinitely

Added some simple tests to check if the receive timeout can be set to 0

**Cherry-pick to 4.3.x**
2017-09-06 17:55:06 -04:00
Artem Bilan
2fe7289429 Redis DelayerHRescheduleIntTests: unique groupId
https://build.spring.io/browse/INT-AT42SIO-595/

To avoid clashes with other parallel builds on CI for different versions
on the same shared Redis make a testing `groupId` as unique using
`UUID.randomUUID()`

**Cherry-pick to 4.3.x & 4.2.x**
2017-08-07 12:21:20 -04:00
Artem Bilan
4663862ea6 Resolve deprecations since the latest SF 2017-07-11 11:52:11 -04:00
Artem Bilan
d766d233f5 Fix ReactiveStreamsConsumerTests and Checkstyle
Also increase timeouts in the `RedisAvailableRule`
2017-06-21 12:12:49 -04:00
Artem Bilan
99224f54c0 INT-4290: JacksonJsonUtils: Add Trusted Packages
JIRA: https://jira.spring.io/browse/INT-4290

See CVE-2017-4995

To disallow deserialization of unknown classes,
the `JacksonJsonUtils#messagingAwareMapper()` can now be supplied
with the `trustedPackages`.
The default list is:
```
java.util
java.lang
org.springframework.messaging.support
org.springframework.integration.support
org.springframework.integration.message
org.springframework.integration.store
```
Can be configured with `*` (asterisk) with meaning trust all

**Cherry-pick to 4.3.x**

Polishing according PR comments
2017-06-14 12:35:32 -04:00
Artem Bilan
9c7c6dccfc Adapt to the latest Spring Data Redis 2017-06-08 17:06:28 -04:00
Artem Bilan
94e5271a57 Increase timeouts for RedisQueueMDrEndpointTests
https://build.spring.io/browse/INT-MJATS41-999/

**Cherry-pick to 4.3.x**
2017-05-23 09:45:52 -04:00
Artem Bilan
7e919a4017 INT-4267: Add JSON (De)Serializers for Messaging
JIRA: https://jira.spring.io/browse/INT-4267
Fixes: spring-projects/spring-integration#2110

The documentation clearly point that we can simply use JSON (de)serialization
with the `RedisMessageStore`, but actually it isn't so easy

* Fix `MessageGroupMetadata`, `MessageHolder`, `MessageMetadata` for Jackson
deserialization compatibility
* Add `MessageHeaders`-based ctor to the `AdviceMessage`
* Add `MessageHeadersJacksonSerializer` to serialize `MessageHeaders`
to the `HashMap` for easier deserialization afterwards
* Add deserializer implementations for all `Message` types
* Add convenient `JsonObjectMapperProvider#jacksonMessageAwareMapper()`
factory method to build `ObjectMapper` supplied with mentioned above
(de)serializers

**Cherry-pick to 4.3.10 without `MessageHolder` and `MessageMetadata`**

Address PR comments and document the feature

Doc Polishing
2017-05-10 10:31:46 -04:00
Artem Bilan
47433754b8 INT-4258: Redis: Make ZADD INCR False by Default
JIRA: https://jira.spring.io/browse/INT-4258

Since Redis `ZADD` command doesn't perform incrementation by default,
it should be consistent in the `RedisStoreWritingMessageHandler` as well

* Make a default behavior of the `RedisStoreWritingMessageHandler`
regarding `INCR` option as `false`
* Provide some performance refactoring for the
`RedisStoreWritingMessageHandler`  moving the code to Java 8 style
and using `FunctionExpression`
* Fix tests according to the changed default behavior

* Add `setZsetIncrementExpression` and String-based setters for other
expressions on the `RedisStoreWritingMessageHandler`
* Add `zset-increment-expression` option for XML configuration
* Add `What's New` note on the matter

Polishing
2017-05-08 14:43:43 -04:00
Vedran Pavic
1dc3726e7d Make LockRegistry#obtain Java 8 based
This commit harmonizes `LockRegistry#obtain` logic in Zookeeper and JDBC
implementations with Redis implementation
by using Java 8 `ConcurrentMap#computeIfAbsent`

* Remove `synchronized (this.locks)` from the `expireUnusedOlderThan`
implementations because `iterator()` is thread-safe from `ConcurrentHashMap`
* Fix deprecation in the `IntegrationGraphControllerRegistrar`
* Revert Spring Security version to `4.2.2`, since `5.0 B-S` is broken
2017-04-21 20:00:34 -04:00
Vedran Pavic
f7f7bdd067 INT-4248: Refactor RedisLockRegistry
JIRA: https://jira.spring.io/browse/INT-4248

To avoid unexpected double locking behavior in the cluster,
remove the local cache functionality.

Now with the new `clientId` property, the `expire` for the record in
store is always update on each lock operation
2017-04-19 18:18:52 -04:00
Artem Bilan
df9593a528 INT-4244: Optimize JpaOutboundGateway for Message
JIRA: https://jira.spring.io/browse/INT-4244

The `JpaOutboundGateway` returns a whole `Message` for reply copying request headers.
Building the reply a `AbstractMessageProducingHandler` uses `MessageBuilder` to create a new `Message` with all request headers because of `shouldCopyRequestHeaders() == true`

* To avoid some overhead with new `Message` and `MessageBuilder` for nothing, just return a JPA result as is and let super class to build the Message

* Optimize all reply producers to return `MessageBuilder` to the super `handleMessage()` process
* Return the whole `gatherResult` `Message<?>` from the `ScatterGatherHandler` to have ability to transfer reply headers as well
* Mark `DelayHandler`  as `shouldCopyRequestHeaders() return false` since it doesn't modify Message and returns it as is after delay
2017-03-23 11:40:25 -04:00
Gary Russell
4bb3f5041f INT-4243: Upgrade to sshd 1.4
JIRA: https://jira.spring.io/browse/INT-4243

Remove newline char from key exchange.

Fix CR and Add Windows Delete Diagnostics

Fix For Windows

More diagnostics.

It appears the new server doesn't close the file when the session is closed.

In the streaming test, consume the stream before closing the session.

Polishing - PR Comments

* More polishing according PR comments
2017-03-11 13:01:06 -05:00
Gary Russell
6a883281f4 INT-4240: Redis Delayer Test Diagnostics
https://jira.spring.io/browse/INT-4240
2017-03-08 15:18:49 -05:00
Gary Russell
37683f1b80 INT-4219: Test Polishing
JIRA: https://jira.spring.io/browse/INT-4219

- Use `AdditionalAnswers.returnFirstArgument` instead of lambda to return first arg
- Enable CheckStyle `AvoidStaticImport` for tests
- Fix static import violations in tests
2017-03-06 11:13:39 -05:00
Artem Bilan
2659baa821 Checkstyle ImportOrder for main and fixes 2017-01-23 12:58:36 -05:00
Artem Bilan
3d433ca3f8 INT-4182: Use thread-safe DateTimeFormatter
JIRA: https://jira.spring.io/browse/INT-4182

To avoid extra allocation for the `SimpleDateFormat` use a new Java 8 `DateTimeFormatter` based on new `Temporal` abstraction

Leave test-cases as is to save some time for other tasks

Fix RedisLockRegistry for the proper formatter and ZoneId
2016-12-16 09:53:03 -05:00
Artem Bilan
9078a74a19 INT-4176: Fix Gemfire tests
JIRA: https://jira.spring.io/browse/INT-4176

The `DelayerHandlerRescheduleIntegrationTests` doesn't close `context` in the end of test.
That causes clashes for `beanFactoryResolver` in other tests.
When those tests are fail, we come into condition when new processes can't be started/stopped because of effect of non-stopped context

* Fix all the `DelayerHandlerRescheduleIntegrationTests` to stop `context` in the end of test
* Remove unused files in the `gemfire/store` test package
* Add current date value to the `CacheServerProcess` name to avoid clashes with other ran on the same host
* Add NPE check for `region` in the `GemfireMetadataStoreTests`
* Extract `@BeforeClass/@AfterClass` for the `CacheWritingMessageHandlerTests` to start only one Gemfire cache per class

**Cherry-pick to 4.3.x & 4.2.x**
2016-11-30 14:31:17 -05:00