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:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -124,16 +124,7 @@ public class FileInboundChannelAdapterParserTests {
|
||||
Object priorityQueue = accessor.getPropertyValue("toBeReceived");
|
||||
assertThat(priorityQueue).isInstanceOf(PriorityBlockingQueue.class);
|
||||
Object expected = context.getBean("testComparator");
|
||||
DirectFieldAccessor queueAccessor = new DirectFieldAccessor(priorityQueue);
|
||||
Object innerQueue = queueAccessor.getPropertyValue("q");
|
||||
Object actual;
|
||||
if (innerQueue != null) {
|
||||
actual = new DirectFieldAccessor(innerQueue).getPropertyValue("comparator");
|
||||
}
|
||||
else {
|
||||
// probably running under JDK 7
|
||||
actual = queueAccessor.getPropertyValue("comparator");
|
||||
}
|
||||
Object actual = ((PriorityBlockingQueue) priorityQueue).comparator();
|
||||
assertThat(actual).as("comparator reference not set, ").isSameAs(expected);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -380,14 +380,21 @@ public class FileSplitterTests {
|
||||
});
|
||||
FileSplitter splitter = new FileSplitter(true, true);
|
||||
splitter.setOutputChannel(outputChannel);
|
||||
FileReader fileReader = Mockito.spy(new FileReader(file));
|
||||
AtomicBoolean closeCalled = new AtomicBoolean();
|
||||
FileReader fileReader = new FileReader(file) {
|
||||
|
||||
@Override public void close() throws IOException {
|
||||
super.close();
|
||||
closeCalled.set(true);
|
||||
}
|
||||
};
|
||||
try {
|
||||
splitter.handleMessage(new GenericMessage<>(fileReader));
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
// ignore
|
||||
}
|
||||
Mockito.verify(fileReader).close();
|
||||
assertThat(closeCalled.get()).isTrue();
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -18,10 +18,7 @@ package org.springframework.integration.file.tail;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.mockito.Mockito.atLeastOnce;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -30,6 +27,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -156,7 +154,19 @@ public class FileTailingMessageProducerTests {
|
||||
}
|
||||
});
|
||||
|
||||
File file = spy(new File(this.testDir, "foo"));
|
||||
AtomicBoolean existsCalled = new AtomicBoolean();
|
||||
File file = new File(this.testDir, "foo") {
|
||||
|
||||
@Override
|
||||
public boolean exists() {
|
||||
try {
|
||||
return super.exists();
|
||||
}
|
||||
finally {
|
||||
existsCalled.set(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
file.delete();
|
||||
adapter.setFile(file);
|
||||
|
||||
@@ -169,7 +179,7 @@ public class FileTailingMessageProducerTests {
|
||||
assertThat(noFile).as("file does not exist event did not emit ").isTrue();
|
||||
boolean noEvent = idleCountDownLatch.await(100, TimeUnit.MILLISECONDS);
|
||||
assertThat(noEvent).as("event should not emit when no file exit").isFalse();
|
||||
verify(file, atLeastOnce()).exists();
|
||||
assertThat(existsCalled.get()).isTrue();
|
||||
|
||||
file.createNewFile();
|
||||
boolean eventRaised = idleCountDownLatch.await(10, TimeUnit.SECONDS);
|
||||
|
||||
Reference in New Issue
Block a user