SGF-570 - Respect manual-start on Gateway Senders/Receivers but no longer couple the start/stop lifecycle to the Spring container.
(cherry picked from commit 1b9e65cdc1)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
@@ -63,7 +63,6 @@ public class GatewayReceiverAutoStartNamespaceTest {
|
||||
public void testAuto() throws Exception {
|
||||
assertNotNull("The 'Auto' GatewayReceiverFactoryBean was not properly configured and initialized!",
|
||||
autoGatewayReceiverFactory);
|
||||
assertTrue(autoGatewayReceiverFactory.isAutoStartup());
|
||||
|
||||
GatewayReceiver autoGatewayReceiver = autoGatewayReceiverFactory.getObject();
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ public class GatewayReceiverDefaultStartNamespaceTest {
|
||||
public void testDefault() throws Exception {
|
||||
assertNotNull("The 'Default' GatewayReceiverFactoryBean was not properly configured and initialized!",
|
||||
defaultGatewayReceiverFactory);
|
||||
assertTrue(defaultGatewayReceiverFactory.isAutoStartup());
|
||||
|
||||
GatewayReceiver defaultGatewayReceiver = defaultGatewayReceiverFactory.getObject();
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ public class GatewayReceiverManualStartNamespaceTest {
|
||||
public void testManual() throws Exception {
|
||||
assertNotNull("The 'Manual' GatewayReceiverFactoryBean was not properly configured and initialized!",
|
||||
manualGatewayReceiverFactory);
|
||||
assertFalse(manualGatewayReceiverFactory.isAutoStartup());
|
||||
|
||||
GatewayReceiver manualGatewayReceiver = manualGatewayReceiverFactory.getObject();
|
||||
|
||||
@@ -75,5 +74,4 @@ public class GatewayReceiverManualStartNamespaceTest {
|
||||
assertFalse(manualGatewayReceiver.isRunning());
|
||||
assertEquals(8192, manualGatewayReceiver.getSocketBufferSize());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations under the License.
|
||||
@@ -142,6 +142,7 @@ public class StubGatewayReceiverFactory implements GatewayReceiverFactory {
|
||||
@Override
|
||||
public GatewayReceiverFactory setManualStart(final boolean manualStart) {
|
||||
this.manualStart = manualStart;
|
||||
this.running = !manualStart;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user