This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-net.git
The following commit(s) were added to refs/heads/master by this push: new 8e5e359 Add missing test. 8e5e359 is described below commit 8e5e359d7138a733c595ed63601b74a2912e0c94 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Mon Feb 8 19:16:33 2021 -0500 Add missing test. --- .../org/apache/commons/net/ftp/FTPSClientTest.java | 48 ++++++++++++++-------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java index 300de79..14f5880 100644 --- a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java +++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java @@ -60,12 +60,6 @@ import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class FTPSClientTest { - private final boolean endpointCheckingEnabled; - - public FTPSClientTest(final boolean endpointCheckingEnabled) { - this.endpointCheckingEnabled = endpointCheckingEnabled; - } - private static final String JDK_TLS_CLIENT_PROTOCOLS = "jdk.tls.client.protocols"; private static int SocketPort; @@ -82,11 +76,6 @@ public class FTPSClientTest { private static String TlsProtocols; - @Parameters(name = "endpointCheckingEnabled={0}") - public static Boolean[] testConstructurData() { - return new Boolean[] {Boolean.FALSE, Boolean.TRUE}; - } - @AfterClass public static void afterClass() { if (TlsProtocols == null) { @@ -165,6 +154,17 @@ public class FTPSClientTest { // System.out.printf("jdk.tls.disabledAlgorithms = %s%n", System.getProperty("jdk.tls.disabledAlgorithms")); } + @Parameters(name = "endpointCheckingEnabled={0}") + public static Boolean[] testConstructurData() { + return new Boolean[] {Boolean.FALSE, Boolean.TRUE}; + } + + private final boolean endpointCheckingEnabled; + + public FTPSClientTest(final boolean endpointCheckingEnabled) { + this.endpointCheckingEnabled = endpointCheckingEnabled; + } + private void assertClientCode(final FTPSClient client) { final int replyCode = client.getReplyCode(); assertTrue(FTPReply.isPositiveCompletion(replyCode)); @@ -203,6 +203,11 @@ public class FTPSClientTest { } } + @Test + public void testHasFeature() throws SocketException, IOException { + loginClient().disconnect(); + } + private void testListFiles(final String pathname) throws SocketException, IOException { final FTPSClient client = loginClient(); try { @@ -235,6 +240,22 @@ public class FTPSClientTest { } @Test + public void testMdtmFile() throws SocketException, IOException { + testMdtmFile("/file.txt"); + } + + private void testMdtmFile(final String pathname) throws SocketException, IOException { + final FTPSClient client = loginClient(); + try { + // do it twice + assertNotNull(client.mdtmFile(pathname)); + assertNotNull(client.mdtmFile(pathname)); + } finally { + client.disconnect(); + } + } + + @Test public void testOpenClose() throws SocketException, IOException { final FTPSClient ftpsClient = loginClient(); try { @@ -246,11 +267,6 @@ public class FTPSClientTest { } @Test - public void testHasFeature() throws SocketException, IOException { - loginClient().disconnect(); - } - - @Test public void testRetrieveFilePathNameRoot() throws SocketException, IOException { retrieveFile("/file.txt"); }