More GH Actions goodies (#3441)
* More GH Actions goodies * Add RabbitMQ, MongoDB & Redis services into GH actions * Remove Travis * * Add `distributionSha256Sum` into `gradle-wrapper.properties` * Try `TERM: dumb` to see difference for Gradle output in GH action * Add `-S` to see the reason of test failure * * Try MQTT plugin for RabbitMQ image * * Try `-i` for test failure in Gradle on Actions * * Use `eclipse-mosquitto` image for MQTT on actions * Fix `FtpServerOutboundTests` for the proper FTP file list * Output file list for the failed session in the `RotatingServersTests` * * Adjust SOUT in the test for Checkstyle * * Make some change to `RotatingServersTests`. Looks like the order for `@BeforeAll` methods is not determined and we may start to interaction with FTP server which is not started yet * Fix SSL Handshake Test - we already made this change for the NIO test, but the NET test is failing the same way - the cert failure switched to the server so the expected exception was not thrown on the client side. Due to JVM changes. * * Fix SFTP tests for wrong host and auto-startup state * Remove `-i` for Gradle in the GH Actions * * Try `--no-parallel` for Gradle in the GH Actions * * Try GH actions without Mosquitto * * Try `cyrilix/rabbitmq-mqtt` for GH Actions Co-authored-by: Gary Russell <grussell@pivotal.io>
This commit is contained in:
@@ -29,7 +29,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.net.ftp.FTPFile;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
@@ -73,8 +72,8 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
|
||||
private static String tmpDir = getLocalTempFolder().getAbsolutePath() + File.separator + "multiSF";
|
||||
|
||||
@BeforeAll
|
||||
public static void setup() {
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
FtpRemoteFileTemplate rft = new FtpRemoteFileTemplate(sessionFactory());
|
||||
rft.execute(s -> {
|
||||
s.mkdir("foo");
|
||||
@@ -117,15 +116,18 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
|
||||
@AfterEach
|
||||
public void extraCleanUp(TestInfo info) {
|
||||
if (info.getTestMethod().get().getName().equals("testFairStreaming")) {
|
||||
FtpRemoteFileTemplate rft = new FtpRemoteFileTemplate(sessionFactory());
|
||||
rft.execute(s -> {
|
||||
FtpRemoteFileTemplate rft = new FtpRemoteFileTemplate(sessionFactory());
|
||||
rft.execute(s -> {
|
||||
if (info.getTestMethod().get().getName().equals("testFairStreaming")) {
|
||||
s.remove("foo/f4");
|
||||
s.remove("baz/f5");
|
||||
s.remove("fiz/f6");
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
s.remove("foo/f1");
|
||||
s.remove("baz/f2");
|
||||
s.remove("fiz/f3");
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -326,7 +328,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
.filter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "rotate"))
|
||||
.localDirectory(localDir())
|
||||
.remoteDirectory("."),
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
.channel(MessageChannels.queue("files"))
|
||||
.get();
|
||||
}
|
||||
@@ -349,6 +351,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
protected File localDir() {
|
||||
return new File(tmpDir, "fair");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -362,7 +365,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
.localDirectory(new File(tmpDir, "variable"))
|
||||
.localFilenameExpression("#remoteDirectory + T(java.io.File).separator + #root")
|
||||
.remoteDirectory("."),
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
.channel(MessageChannels.queue("files"))
|
||||
.get();
|
||||
}
|
||||
@@ -378,7 +381,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
return IntegrationFlows.from(Ftp.inboundStreamingAdapter(new FtpRemoteFileTemplate(sf()))
|
||||
.filter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "rotate"))
|
||||
.remoteDirectory("."),
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
.channel(MessageChannels.queue("files"))
|
||||
.get();
|
||||
}
|
||||
@@ -405,7 +408,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
.filter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "rotate"))
|
||||
.remoteDirectory(".")
|
||||
.maxFetchSize(1),
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
e -> e.poller(Pollers.fixedDelay(1).advice(advice())))
|
||||
.channel(MessageChannels.queue("files"))
|
||||
.get();
|
||||
}
|
||||
|
||||
@@ -668,10 +668,10 @@ public class FtpServerOutboundTests extends FtpTestSupport {
|
||||
assertThat(files.size()).isEqualTo(3);
|
||||
assertThat(files).contains("subFtpSource", " ftpSource1.txt", "ftpSource2.txt");
|
||||
|
||||
FTPFile[] ftpFiles = ftpSessionFactory.getSession().list(null);
|
||||
FTPFile[] ftpFiles = ftpSessionFactory.getSession().list("ftpSource");
|
||||
for (FTPFile ftpFile : ftpFiles) {
|
||||
if (!ftpFile.isDirectory()) {
|
||||
assertThat(files.contains(ftpFile.getName())).isTrue();
|
||||
assertThat(files).contains(ftpFile.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user