From fcf7f761a50dfcbd0993979479a991a5f60f5ab2 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Sun, 9 Aug 2020 08:11:15 -0400 Subject: [PATCH] Enable STOMP test back to check the solution * Remove more `ManageableSmartLifecycle` from non-channel adapter components --- .../integration/dsl/StandardIntegrationFlow.java | 3 +-- .../integration/rsocket/AbstractRSocketConnector.java | 4 ++-- .../integration/stomp/AbstractStompSessionManager.java | 4 ++-- .../integration/stomp/client/StompServerIntegrationTests.java | 3 +-- .../integration/websocket/ClientWebSocketContainer.java | 4 ++-- .../integration/websocket/ServerWebSocketContainer.java | 4 ++-- .../integration/xmpp/config/XmppConnectionFactoryBean.java | 4 ++-- .../zookeeper/metadata/ZookeeperMetadataStore.java | 4 ++-- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java index 4bed3678d1..c3af2f9e61 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/StandardIntegrationFlow.java @@ -25,7 +25,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.springframework.context.SmartLifecycle; -import org.springframework.integration.support.management.ManageableSmartLifecycle; import org.springframework.messaging.MessageChannel; /** @@ -66,7 +65,7 @@ import org.springframework.messaging.MessageChannel; * @see org.springframework.integration.dsl.context.IntegrationFlowContext * @see SmartLifecycle */ -public class StandardIntegrationFlow implements IntegrationFlow, ManageableSmartLifecycle { +public class StandardIntegrationFlow implements IntegrationFlow, SmartLifecycle { private final Map integrationComponents; diff --git a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/AbstractRSocketConnector.java b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/AbstractRSocketConnector.java index 62a3b65849..79422e3f23 100644 --- a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/AbstractRSocketConnector.java +++ b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/AbstractRSocketConnector.java @@ -22,7 +22,7 @@ import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; -import org.springframework.integration.support.management.ManageableSmartLifecycle; +import org.springframework.context.SmartLifecycle; import org.springframework.lang.Nullable; import org.springframework.messaging.rsocket.RSocketStrategies; import org.springframework.util.Assert; @@ -43,7 +43,7 @@ import org.springframework.util.MimeType; */ public abstract class AbstractRSocketConnector implements ApplicationContextAware, InitializingBean, DisposableBean, SmartInitializingSingleton, - ManageableSmartLifecycle { + SmartLifecycle { protected final IntegrationRSocketMessageHandler rSocketMessageHandler; // NOSONAR - final diff --git a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java index 7382bcb616..286b3e3d78 100644 --- a/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java +++ b/spring-integration-stomp/src/main/java/org/springframework/integration/stomp/AbstractStompSessionManager.java @@ -32,9 +32,9 @@ import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; +import org.springframework.context.SmartLifecycle; import org.springframework.integration.stomp.event.StompConnectionFailedEvent; import org.springframework.integration.stomp.event.StompSessionConnectedEvent; -import org.springframework.integration.support.management.ManageableSmartLifecycle; import org.springframework.lang.Nullable; import org.springframework.messaging.simp.stomp.StompClientSupport; import org.springframework.messaging.simp.stomp.StompCommand; @@ -69,7 +69,7 @@ import org.springframework.util.concurrent.ListenableFutureCallback; * @since 4.2 */ public abstract class AbstractStompSessionManager implements StompSessionManager, ApplicationEventPublisherAware, - ManageableSmartLifecycle, DisposableBean, BeanNameAware { + SmartLifecycle, DisposableBean, BeanNameAware { private static final long DEFAULT_RECOVERY_INTERVAL = 10000; diff --git a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java index d6905b9197..84077a2203 100644 --- a/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java +++ b/spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java @@ -22,7 +22,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import org.apache.activemq.broker.BrokerService; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.context.ApplicationEvent; @@ -63,7 +62,7 @@ import org.springframework.util.SocketUtils; * * @since 4.2 */ -@Disabled("Until the fix in reactor-netty-core") +//@Disabled("Until the fix in reactor-netty-core") public class StompServerIntegrationTests { private static BrokerService activeMQBroker; diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ClientWebSocketContainer.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ClientWebSocketContainer.java index 3cdde31deb..025d5240ef 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ClientWebSocketContainer.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ClientWebSocketContainer.java @@ -21,8 +21,8 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.springframework.context.Lifecycle; +import org.springframework.context.SmartLifecycle; import org.springframework.http.HttpHeaders; -import org.springframework.integration.support.management.ManageableSmartLifecycle; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.util.concurrent.ListenableFuture; @@ -49,7 +49,7 @@ import org.springframework.web.socket.client.WebSocketClient; * * @since 4.1 */ -public final class ClientWebSocketContainer extends IntegrationWebSocketContainer implements ManageableSmartLifecycle { +public final class ClientWebSocketContainer extends IntegrationWebSocketContainer implements SmartLifecycle { private static final int DEFAULT_CONNECTION_TIMEOUT = 10; diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java index a922f73b7f..09beea747d 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java @@ -19,7 +19,7 @@ package org.springframework.integration.websocket; import java.util.Arrays; import org.springframework.context.Lifecycle; -import org.springframework.integration.support.management.ManageableSmartLifecycle; +import org.springframework.context.SmartLifecycle; import org.springframework.integration.util.JavaUtils; import org.springframework.scheduling.TaskScheduler; import org.springframework.util.Assert; @@ -51,7 +51,7 @@ import org.springframework.web.socket.sockjs.transport.TransportHandler; * @since 4.1 */ public class ServerWebSocketContainer extends IntegrationWebSocketContainer - implements WebSocketConfigurer, ManageableSmartLifecycle { + implements WebSocketConfigurer, SmartLifecycle { private final String[] paths; diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java index c0c916decd..b720e31d50 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java @@ -26,7 +26,7 @@ import org.jxmpp.util.XmppStringUtils; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.springframework.integration.support.management.ManageableSmartLifecycle; +import org.springframework.context.SmartLifecycle; import org.springframework.util.StringUtils; /** @@ -45,7 +45,7 @@ import org.springframework.util.StringUtils; * * @see XMPPTCPConnection */ -public class XmppConnectionFactoryBean extends AbstractFactoryBean implements ManageableSmartLifecycle { +public class XmppConnectionFactoryBean extends AbstractFactoryBean implements SmartLifecycle { private final Object lifecycleMonitor = new Object(); diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java index 6a56cd3694..0a24f594fc 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java @@ -31,9 +31,9 @@ import org.apache.curator.utils.CloseableUtils; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.data.Stat; +import org.springframework.context.SmartLifecycle; import org.springframework.integration.metadata.ListenableMetadataStore; import org.springframework.integration.metadata.MetadataStoreListener; -import org.springframework.integration.support.management.ManageableSmartLifecycle; import org.springframework.integration.support.utils.IntegrationUtils; import org.springframework.util.Assert; @@ -47,7 +47,7 @@ import org.springframework.util.Assert; * * @since 4.2 */ -public class ZookeeperMetadataStore implements ListenableMetadataStore, ManageableSmartLifecycle { +public class ZookeeperMetadataStore implements ListenableMetadataStore, SmartLifecycle { private static final String KEY_MUST_NOT_BE_NULL = "'key' must not be null.";