Start 6.0 version

* Upgrade to Java 17, SF-6.0, Gradle 7.2
* Upgrade to Jakarta dependencies and respective namespaces
* Fix some tests for Java 17 compatibility
* Fix wrong Javadocs
* Add some missed Javadocs
* Fix more `jakarta` namespace
* Fix WS & XML modules to use Jakarta EE
* `--add-opens` in some modules for their reflection-based tests
* Disable Kafka tests which does not work on Windows; see Apache Kafka `3.0.1`
* Upgrade to JUnit `5.8.1`
* Migrate JMS tests to Artemis
* Remove RMI module as it was deprecated before
* Fix `pr-build-workflow.yml` for Java 17
* Fix JavaDocs warnings using `Xdoclint:syntax` per module, not in the top-level `api` task
* Move docs for version `6.0`
This commit is contained in:
Artem Bilan
2021-11-03 09:38:10 -04:00
parent 4423e43cd8
commit a80b22638d
225 changed files with 2196 additions and 2628 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -18,9 +18,9 @@ package org.springframework.integration.config.xml;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -36,16 +36,14 @@ import org.springframework.messaging.MessagingException;
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
/**
* @author Mark Fisher
* @author Artem Bilan
* @author Gary Russell
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@SpringJUnitConfig
@DirtiesContext
public class DefaultOutboundChannelAdapterParserTests {
@@ -77,8 +75,7 @@ public class DefaultOutboundChannelAdapterParserTests {
assertThat(TestUtils.getPropertyValue(adapter, "autoStartup")).isEqualTo(Boolean.FALSE);
MessageHandler handler = TestUtils.getPropertyValue(adapter, "handler", MessageHandler.class);
assertThat(AopUtils.isAopProxy(handler)).isTrue();
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors[0].advice"))
.isInstanceOf(RequestHandlerRetryAdvice.class);
assertThat(((Advised) handler).getAdvisors()[0].getAdvice()).isInstanceOf(RequestHandlerRetryAdvice.class);
handler.handleMessage(new GenericMessage<>("foo"));
QueueChannel recovery = context.getBean("recovery", QueueChannel.class);

View File

@@ -22,6 +22,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.util.Objects;
import java.util.function.Function;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
@@ -86,6 +87,7 @@ public class LambdaMessageProcessorTests {
}
@Test
@Disabled("Until https://github.com/spring-projects/spring-integration/issues/3660")
public void testCustomConverter() {
LambdaMessageProcessor lmp = new LambdaMessageProcessor(Function.identity(), TestPojo.class);
lmp.setBeanFactory(this.beanFactory);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
@@ -17,6 +17,7 @@
package org.springframework.integration.handler;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.Mockito.mock;
import java.util.Calendar;
@@ -24,13 +25,14 @@ import java.util.Date;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.DirectFieldAccessor;
@@ -84,7 +86,7 @@ public class DelayHandlerTests {
private TestApplicationContext context = TestUtils.createTestApplicationContext();
@Before
@BeforeEach
public void setup() {
input.setBeanName("input");
output.setBeanName("output");
@@ -97,7 +99,7 @@ public class DelayHandlerTests {
output.subscribe(resultHandler);
}
@After
@AfterEach
public void tearDown() {
this.context.close();
this.taskScheduler.destroy();
@@ -251,7 +253,7 @@ public class DelayHandlerTests {
assertThat(resultHandler.lastThread).isSameAs(Thread.currentThread());
}
@Test(expected = TestTimedOutException.class)
@Test
public void delayHeaderIsFutureDateAndTimesOut() {
this.setDelayExpression();
startDelayerHandler();
@@ -259,7 +261,8 @@ public class DelayHandlerTests {
Message<?> message = MessageBuilder.withPayload("test")
.setHeader("delay", future).build();
input.send(message);
waitForLatch(100);
assertThatExceptionOfType(TestTimedOutException.class)
.isThrownBy(() -> waitForLatch(100));
}
@Test
@@ -308,7 +311,7 @@ public class DelayHandlerTests {
assertThat(this.latch.await(10, TimeUnit.SECONDS)).isTrue();
}
@Test(expected = MessageDeliveryException.class)
@Test
public void handlerThrowsExceptionWithNoDelay() {
startDelayerHandler();
output.unsubscribe(resultHandler);
@@ -316,7 +319,8 @@ public class DelayHandlerTests {
throw new UnsupportedOperationException("intentional test failure");
});
Message<?> message = MessageBuilder.withPayload("test").build();
input.send(message);
assertThatExceptionOfType(MessageDeliveryException.class)
.isThrownBy(() -> input.send(message));
}
@Test
@@ -409,7 +413,7 @@ public class DelayHandlerTests {
}
@Test //INT-1132
@Ignore("Time-sensitive: no guarantee that message won't be released in between 'sleep' and 'destroy'")
@Disabled("Time-sensitive: no guarantee that message won't be released in between 'sleep' and 'destroy'")
public void testReschedulePersistedMessagesOnStartup() throws Exception {
MessageGroupStore messageGroupStore = new SimpleMessageStore();
this.delayHandler.setDefaultDelay(2000);
@@ -464,12 +468,13 @@ public class DelayHandlerTests {
ac.close();
}
@Test(expected = MessageHandlingException.class)
@Test
public void testInt2243IgnoreExpressionFailuresAsFalse() {
this.setDelayExpression();
this.delayHandler.setIgnoreExpressionFailures(false);
startDelayerHandler();
this.delayHandler.handleMessage(new GenericMessage<>("test"));
assertThatExceptionOfType(MessageHandlingException.class)
.isThrownBy(() -> this.delayHandler.handleMessage(new GenericMessage<>("test")));
}
@Test //INT-3560
@@ -516,7 +521,7 @@ public class DelayHandlerTests {
dfa.setPropertyValue("requestDate", requestDate.getTimeInMillis());
this.taskScheduler.afterPropertiesSet();
this.delayHandler.reschedulePersistedMessages();
Queue<?> works = TestUtils.getPropertyValue(this.taskScheduler, "scheduledExecutor.workQueue", Queue.class);
Queue<?> works = ((ScheduledThreadPoolExecutor) this.taskScheduler.getScheduledExecutor()).getQueue();
int n = 0;
while (n++ < 2000 && works.size() == 0) {
Thread.sleep(10);