You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/02/25 13:48:55 UTC
(commons-net) branch master updated: Use JUnit 5 visibility conventions
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 71ff0ad2 Use JUnit 5 visibility conventions
71ff0ad2 is described below
commit 71ff0ad28103565f5f81dec59aadece4ec310f79
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Feb 25 08:48:49 2026 -0500
Use JUnit 5 visibility conventions
---
.../commons/net/SocketClientFunctionalTest.java | 4 +-
.../org/apache/commons/net/SocketClientTest.java | 8 +--
.../apache/commons/net/bsd/RCommandClientTest.java | 8 +--
.../apache/commons/net/bsd/RExecClientTest.java | 12 ++---
.../apache/commons/net/bsd/RLoginClientTest.java | 8 +--
.../commons/net/chargen/CharGenTCPClientTest.java | 8 +--
.../commons/net/chargen/CharGenUDPClientTest.java | 8 +--
.../commons/net/daytime/DaytimeTCPClientTest.java | 2 +-
.../commons/net/daytime/DaytimeUDPClientTest.java | 8 +--
.../commons/net/discard/DiscardTCPClientTest.java | 8 +--
.../commons/net/discard/DiscardUDPClientTest.java | 6 +--
.../apache/commons/net/echo/EchoTCPClientTest.java | 6 +--
.../apache/commons/net/echo/EchoUDPClientTest.java | 6 +--
.../org/apache/commons/net/examples/MainTest.java | 4 +-
.../commons/net/finger/FingerClientTest.java | 12 ++---
.../net/ftp/FTPClientConfigFunctionalTest.java | 4 +-
.../commons/net/ftp/FTPClientConfigTest.java | 14 ++---
.../org/apache/commons/net/ftp/FTPClientTest.java | 44 +++++++--------
.../commons/net/ftp/FTPClientTransferModeTest.java | 6 +--
.../org/apache/commons/net/ftp/FTPCommandTest.java | 4 +-
.../org/apache/commons/net/ftp/FTPFileTest.java | 36 ++++++-------
.../commons/net/ftp/FTPSClientGettersTest.java | 4 +-
.../org/apache/commons/net/ftp/FTPSClientTest.java | 22 ++++----
.../commons/net/ftp/ListingFunctionalTest.java | 30 +++++------
.../apache/commons/net/ftp/TestConnectTimeout.java | 4 +-
.../net/ftp/parser/AbstractFTPParseTest.java | 12 ++---
.../ftp/parser/CompositeFTPParseTestFramework.java | 6 +--
.../DefaultFTPFileEntryParserFactoryTest.java | 6 +--
.../parser/EnterpriseUnixFTPEntryParserTest.java | 10 ++--
.../net/ftp/parser/FTPConfigEntryParserTest.java | 6 +--
.../net/ftp/parser/FTPTimestampParserImplTest.java | 42 +++++++--------
.../commons/net/ftp/parser/MLSDComparison.java | 2 +-
.../net/ftp/parser/MLSxEntryParserTest.java | 10 ++--
.../net/ftp/parser/MVSFTPEntryParserTest.java | 20 +++----
.../ftp/parser/MacOsPeterFTPEntryParserTest.java | 10 ++--
.../net/ftp/parser/NTFTPEntryParserTest.java | 22 ++++----
.../net/ftp/parser/NetwareFTPEntryParserTest.java | 10 ++--
.../net/ftp/parser/OS2FTPEntryParserTest.java | 10 ++--
.../parser/OS400FTPEntryParserAdditionalTest.java | 10 ++--
.../net/ftp/parser/OS400FTPEntryParserTest.java | 14 ++---
.../net/ftp/parser/UnixFTPEntryParserTest.java | 44 +++++++--------
.../net/ftp/parser/VMSFTPEntryParserTest.java | 14 ++---
.../net/imap/AuthenticatingIMAPClientTest.java | 2 +-
.../apache/commons/net/imap/IMAPCommandTest.java | 2 +-
.../org/apache/commons/net/imap/IMAPReplyTest.java | 38 ++++++-------
.../java/org/apache/commons/net/imap/IMAPTest.java | 12 ++---
.../net/io/DotTerminatedMessageReaderTest.java | 26 ++++-----
.../commons/net/io/ToNetASCIIInputStreamTest.java | 6 +--
.../org/apache/commons/net/nntp/TestThreader.java | 14 ++---
.../org/apache/commons/net/ntp/TestNtpClient.java | 4 +-
.../org/apache/commons/net/ntp/TestNtpPacket.java | 16 +++---
.../org/apache/commons/net/ntp/TestTimeInfo.java | 14 ++---
.../org/apache/commons/net/ntp/TimeStampTest.java | 10 ++--
.../commons/net/pop3/POP3ClientCommandsTest.java | 42 +++++++--------
.../apache/commons/net/pop3/POP3ClientTest.java | 12 ++---
.../commons/net/pop3/POP3ConstructorTest.java | 8 +--
.../commons/net/smtp/SimpleSMTPHeaderTestCase.java | 14 ++---
.../telnet/AbstractTelnetOptionHandlerTest.java | 6 +--
.../commons/net/telnet/EchoOptionHandlerTest.java | 8 +--
.../telnet/InvalidTelnetOptionExceptionTest.java | 4 +-
.../net/telnet/SimpleOptionHandlerTest.java | 8 +--
.../net/telnet/SuppressGAOptionHandlerTest.java | 8 +--
.../net/telnet/TelnetClientFunctionalTest.java | 4 +-
.../commons/net/telnet/TelnetClientTest.java | 20 +++----
.../commons/net/telnet/TelnetOptionTest.java | 6 +--
.../commons/net/telnet/TelnetTestResponder.java | 2 +-
.../commons/net/telnet/TelnetTestSimpleServer.java | 2 +-
.../net/telnet/TerminalTypeOptionHandlerTest.java | 8 +--
.../net/telnet/WindowSizeOptionHandlerTest.java | 10 ++--
.../apache/commons/net/tftp/TFTPAckPacketTest.java | 6 +--
.../commons/net/tftp/TFTPDataPacketTest.java | 6 +--
.../commons/net/tftp/TFTPErrorPacketTest.java | 6 +--
.../commons/net/tftp/TFTPPacketExceptionTest.java | 4 +-
.../net/tftp/TFTPReadRequestPacketTest.java | 4 +-
.../commons/net/tftp/TFTPRequestPacketTest.java | 4 +-
.../commons/net/tftp/TFTPServerPathTest.java | 10 ++--
.../java/org/apache/commons/net/tftp/TFTPTest.java | 22 ++++----
.../net/tftp/TFTPWriteRequestPacketTest.java | 4 +-
.../apache/commons/net/time/TimeTCPClientTest.java | 6 +--
.../commons/net/time/TimeTestSimpleServer.java | 2 +-
.../apache/commons/net/time/TimeUDPClientTest.java | 10 ++--
.../org/apache/commons/net/util/Base64Test.java | 62 +++++++++++-----------
.../org/apache/commons/net/util/CharsetsTest.java | 8 +--
.../apache/commons/net/util/ListenerListTest.java | 10 ++--
.../apache/commons/net/util/SubnetUtils6Test.java | 62 +++++++++++-----------
.../commons/net/util/SubnetUtilsNet728Test.java | 2 +-
.../apache/commons/net/util/SubnetUtilsTest.java | 48 ++++++++---------
.../commons/net/util/TrustManagerUtilsTest.java | 10 ++--
.../java/org/apache/commons/net/util/UtilTest.java | 20 +++----
.../apache/commons/net/whois/WhoisClientTest.java | 8 +--
90 files changed, 572 insertions(+), 572 deletions(-)
diff --git a/src/test/java/org/apache/commons/net/SocketClientFunctionalTest.java b/src/test/java/org/apache/commons/net/SocketClientFunctionalTest.java
index 066a02a8..d61cbb82 100644
--- a/src/test/java/org/apache/commons/net/SocketClientFunctionalTest.java
+++ b/src/test/java/org/apache/commons/net/SocketClientFunctionalTest.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
*
* Requires a Java-compatible SOCK proxy server on 127.0.0.1:9050 and access to ftp.gnu.org.
*/
-public class SocketClientFunctionalTest {
+class SocketClientFunctionalTest {
private static final String PROXY_HOST = "127.0.0.1";
private static final int PROXY_PORT = 9050;
private static final String DEST_HOST = "ftp.gnu.org";
@@ -43,7 +43,7 @@ public class SocketClientFunctionalTest {
* @throws Exception in case of connection errors
*/
@Test
- public void testProxySettings() throws Exception {
+ void testProxySettings() throws Exception {
// NOTE: HTTP Proxies seem to be invalid for raw sockets
final Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(PROXY_HOST, PROXY_PORT));
sc.setProxy(proxy);
diff --git a/src/test/java/org/apache/commons/net/SocketClientTest.java b/src/test/java/org/apache/commons/net/SocketClientTest.java
index 1f5fd6d0..1a7e6865 100644
--- a/src/test/java/org/apache/commons/net/SocketClientTest.java
+++ b/src/test/java/org/apache/commons/net/SocketClientTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
/**
* A simple test class for SocketClient settings.
*/
-public class SocketClientTest {
+class SocketClientTest {
private static final String PROXY_HOST = "127.0.0.1";
private static final int PROXY_PORT = 1080;
@@ -42,7 +42,7 @@ public class SocketClientTest {
private static final int REMOTE_PORT = 21;
@Test
- public void testConnectResolved() {
+ void testConnectResolved() {
final SocketClient socketClient = new FTPClient();
assertThrows(IOException.class, () -> socketClient.connect(LOCALHOST_ADDRESS, REMOTE_PORT));
@@ -53,7 +53,7 @@ public class SocketClientTest {
}
@Test
- public void testConnectUnresolved() {
+ void testConnectUnresolved() {
final SocketClient socketClient = new FTPClient();
assertThrows(UnknownHostException.class, () -> socketClient.connect(UNRESOLVED_HOST, REMOTE_PORT, null, -1));
@@ -67,7 +67,7 @@ public class SocketClientTest {
* A simple test to verify that the Proxy is being set.
*/
@Test
- public void testProxySettings() {
+ void testProxySettings() {
final SocketClient socketClient = new FTPClient();
assertNull(socketClient.getProxy());
final Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(PROXY_HOST, PROXY_PORT));
diff --git a/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java b/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java
index 74094b2b..00640fbb 100644
--- a/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java
+++ b/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java
@@ -29,24 +29,24 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link RCommandClient}.
*/
-public class RCommandClientTest {
+class RCommandClientTest {
private RCommandClient newClient() {
return new RCommandClient();
}
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(RCommandClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(RCommandClient.DEFAULT_PORT, newClient().getDefaultPort());
}
@Test
- public void testGetInputStream() throws IOException {
+ void testGetInputStream() throws IOException {
try (InputStream inputStream = newClient().getInputStream()) {
assertNull(inputStream);
}
diff --git a/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java b/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java
index 8f20d47f..cac9781b 100644
--- a/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java
+++ b/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java
@@ -30,38 +30,38 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link RExecClient}.
*/
-public class RExecClientTest {
+class RExecClientTest {
private RExecClient newClient() {
return new RExecClient();
}
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(RExecClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(RExecClient.DEFAULT_PORT, newClient().getDefaultPort());
}
@Test
- public void testGetErrorStream() throws IOException {
+ void testGetErrorStream() throws IOException {
try (InputStream inputStream = newClient().getErrorStream()) {
assertNull(inputStream);
}
}
@Test
- public void testGetInputStream() throws IOException {
+ void testGetInputStream() throws IOException {
try (InputStream inputStream = newClient().getInputStream()) {
assertNull(inputStream);
}
}
@Test
- public void testGetOutputStream() throws IOException {
+ void testGetOutputStream() throws IOException {
try (OutputStream outputStream = newClient().getOutputStream()) {
assertNull(outputStream);
}
diff --git a/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java b/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java
index 9e6b4b40..e0212a45 100644
--- a/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java
+++ b/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java
@@ -29,24 +29,24 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link RLoginClient}.
*/
-public class RLoginClientTest {
+class RLoginClientTest {
private RLoginClient newClient() {
return new RLoginClient();
}
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(RLoginClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(RLoginClient.DEFAULT_PORT, newClient().getDefaultPort());
}
@Test
- public void testGetInputStream() throws IOException {
+ void testGetInputStream() throws IOException {
try (InputStream inputStream = newClient().getInputStream()) {
assertNull(inputStream);
}
diff --git a/src/test/java/org/apache/commons/net/chargen/CharGenTCPClientTest.java b/src/test/java/org/apache/commons/net/chargen/CharGenTCPClientTest.java
index 79fa12ab..30459b83 100644
--- a/src/test/java/org/apache/commons/net/chargen/CharGenTCPClientTest.java
+++ b/src/test/java/org/apache/commons/net/chargen/CharGenTCPClientTest.java
@@ -29,20 +29,20 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link CharGenTCPClient}.
*/
-public class CharGenTCPClientTest {
+class CharGenTCPClientTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(CharGenTCPClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(CharGenTCPClient.DEFAULT_PORT, new CharGenTCPClient().getDefaultPort());
}
@Test
- public void testGetInputStream() throws IOException {
+ void testGetInputStream() throws IOException {
try (InputStream inputStream = new CharGenTCPClient().getInputStream()) {
assertNull(inputStream);
}
diff --git a/src/test/java/org/apache/commons/net/chargen/CharGenUDPClientTest.java b/src/test/java/org/apache/commons/net/chargen/CharGenUDPClientTest.java
index ad9515a0..79cbb17e 100644
--- a/src/test/java/org/apache/commons/net/chargen/CharGenUDPClientTest.java
+++ b/src/test/java/org/apache/commons/net/chargen/CharGenUDPClientTest.java
@@ -27,16 +27,16 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link CharGenUDPClient}.
*/
-public class CharGenUDPClientTest {
+class CharGenUDPClientTest {
@SuppressWarnings("resource")
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(CharGenUDPClient::new);
}
@Test
- public void testReceiver() {
+ void testReceiver() {
try (CharGenUDPClient client = new CharGenUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, client::receive);
@@ -44,7 +44,7 @@ public class CharGenUDPClientTest {
}
@Test
- public void testSend() {
+ void testSend() {
try (CharGenUDPClient client = new CharGenUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.send(InetAddress.getLocalHost()));
diff --git a/src/test/java/org/apache/commons/net/daytime/DaytimeTCPClientTest.java b/src/test/java/org/apache/commons/net/daytime/DaytimeTCPClientTest.java
index 0acd964b..2c7d6309 100644
--- a/src/test/java/org/apache/commons/net/daytime/DaytimeTCPClientTest.java
+++ b/src/test/java/org/apache/commons/net/daytime/DaytimeTCPClientTest.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-public class DaytimeTCPClientTest {
+class DaytimeTCPClientTest {
private static MockDaytimeTCPServer mockDaytimeTCPServer;
diff --git a/src/test/java/org/apache/commons/net/daytime/DaytimeUDPClientTest.java b/src/test/java/org/apache/commons/net/daytime/DaytimeUDPClientTest.java
index 7c07fba2..63254e36 100644
--- a/src/test/java/org/apache/commons/net/daytime/DaytimeUDPClientTest.java
+++ b/src/test/java/org/apache/commons/net/daytime/DaytimeUDPClientTest.java
@@ -27,10 +27,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link DaytimeUDPClient}.
*/
-public class DaytimeUDPClientTest {
+class DaytimeUDPClientTest {
@Test
- public void testClose() {
+ void testClose() {
try (DaytimeUDPClient client = new DaytimeUDPClient()) {
// empty
}
@@ -38,12 +38,12 @@ public class DaytimeUDPClientTest {
@SuppressWarnings("resource")
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(DaytimeUDPClient::new);
}
@Test
- public void testGetTime() {
+ void testGetTime() {
try (DaytimeUDPClient client = new DaytimeUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.getTime(InetAddress.getLocalHost()));
diff --git a/src/test/java/org/apache/commons/net/discard/DiscardTCPClientTest.java b/src/test/java/org/apache/commons/net/discard/DiscardTCPClientTest.java
index 5016c6ac..4a13d1c0 100644
--- a/src/test/java/org/apache/commons/net/discard/DiscardTCPClientTest.java
+++ b/src/test/java/org/apache/commons/net/discard/DiscardTCPClientTest.java
@@ -29,20 +29,20 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link DiscardTCPClient}.
*/
-public class DiscardTCPClientTest {
+class DiscardTCPClientTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(DiscardTCPClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(DiscardTCPClient.DEFAULT_PORT, new DiscardTCPClient().getDefaultPort());
}
@Test
- public void testGetOutputStream() throws IOException {
+ void testGetOutputStream() throws IOException {
try (OutputStream outputStream = new DiscardTCPClient().getOutputStream()) {
assertNull(outputStream);
}
diff --git a/src/test/java/org/apache/commons/net/discard/DiscardUDPClientTest.java b/src/test/java/org/apache/commons/net/discard/DiscardUDPClientTest.java
index 358d463a..27523cc9 100644
--- a/src/test/java/org/apache/commons/net/discard/DiscardUDPClientTest.java
+++ b/src/test/java/org/apache/commons/net/discard/DiscardUDPClientTest.java
@@ -27,16 +27,16 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link DiscardUDPClient}.
*/
-public class DiscardUDPClientTest {
+class DiscardUDPClientTest {
@SuppressWarnings("resource")
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(DiscardUDPClient::new);
}
@Test
- public void testSend() {
+ void testSend() {
try (DiscardUDPClient client = new DiscardUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.send(new byte[0], InetAddress.getLocalHost()));
diff --git a/src/test/java/org/apache/commons/net/echo/EchoTCPClientTest.java b/src/test/java/org/apache/commons/net/echo/EchoTCPClientTest.java
index 6f06d346..cab280d2 100644
--- a/src/test/java/org/apache/commons/net/echo/EchoTCPClientTest.java
+++ b/src/test/java/org/apache/commons/net/echo/EchoTCPClientTest.java
@@ -28,15 +28,15 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link EchoTCPClient}.
*/
-public class EchoTCPClientTest {
+class EchoTCPClientTest {
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(EchoTCPClient.DEFAULT_PORT, new EchoTCPClient().getDefaultPort());
}
@Test
- public void testDetInputStream() throws IOException {
+ void testDetInputStream() throws IOException {
try (InputStream inputStream = new EchoTCPClient().getInputStream()) {
assertNull(inputStream);
}
diff --git a/src/test/java/org/apache/commons/net/echo/EchoUDPClientTest.java b/src/test/java/org/apache/commons/net/echo/EchoUDPClientTest.java
index 895ba4aa..c948a1bf 100644
--- a/src/test/java/org/apache/commons/net/echo/EchoUDPClientTest.java
+++ b/src/test/java/org/apache/commons/net/echo/EchoUDPClientTest.java
@@ -26,10 +26,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link EchoUDPClient}.
*/
-public class EchoUDPClientTest {
+class EchoUDPClientTest {
@Test
- public void testRecieve() {
+ void testRecieve() {
try (EchoUDPClient client = new EchoUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.receive(new byte[0]));
@@ -38,7 +38,7 @@ public class EchoUDPClientTest {
}
@Test
- public void testSend() {
+ void testSend() {
try (EchoUDPClient client = new EchoUDPClient()) {
// Not connected
assertThrows(NullPointerException.class, () -> client.send(new byte[0], InetAddress.getLocalHost()));
diff --git a/src/test/java/org/apache/commons/net/examples/MainTest.java b/src/test/java/org/apache/commons/net/examples/MainTest.java
index d482c7bf..a0f8b1cd 100644
--- a/src/test/java/org/apache/commons/net/examples/MainTest.java
+++ b/src/test/java/org/apache/commons/net/examples/MainTest.java
@@ -32,7 +32,7 @@ import java.util.jar.JarFile;
import org.junit.jupiter.api.Test;
-public class MainTest {
+class MainTest {
private static boolean hasMainMethod(String name) {
name = name.replace(".class", "");
@@ -109,7 +109,7 @@ public class MainTest {
}
@Test
- public void testCheckExamplesPropertiesIsComplete() throws Exception {
+ void testCheckExamplesPropertiesIsComplete() throws Exception {
final Properties cp = scanClasses();
final Properties fp = new Properties();
try (InputStream inputStream = this.getClass().getResourceAsStream("examples.properties")) {
diff --git a/src/test/java/org/apache/commons/net/finger/FingerClientTest.java b/src/test/java/org/apache/commons/net/finger/FingerClientTest.java
index d611434e..c4193b82 100644
--- a/src/test/java/org/apache/commons/net/finger/FingerClientTest.java
+++ b/src/test/java/org/apache/commons/net/finger/FingerClientTest.java
@@ -28,25 +28,25 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link FingerClient}.
*/
-public class FingerClientTest {
+class FingerClientTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(FingerClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(FingerClient.DEFAULT_PORT, new FingerClient().getDefaultPort());
}
@Test
- public void testDisconnect() throws IOException {
+ void testDisconnect() throws IOException {
new FingerClient().disconnect();
}
@Test
- public void testGetInputStream() {
+ void testGetInputStream() {
final FingerClient fingerClient = new FingerClient();
// Not connected throws NullPointerException
assertThrows(NullPointerException.class, () -> fingerClient.getInputStream(false));
@@ -58,7 +58,7 @@ public class FingerClientTest {
}
@Test
- public void testQuery() {
+ void testQuery() {
final FingerClient fingerClient = new FingerClient();
// Not connected throws NullPointerException
assertThrows(NullPointerException.class, () -> fingerClient.query(false));
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
index 6dbdc9b1..f485c86b 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigFunctionalTest.java
@@ -41,7 +41,7 @@ import org.junit.jupiter.api.Test;
* zone. Depending on the local machine's position relative to GMT and the time of day, the browsers may decide that a timestamp would be in the future if given
* the current year, so they assume the year to be last year. This illustrates the value of FTPClientConfig's time zone functionality.
*/
-public class FTPClientConfigFunctionalTest {
+class FTPClientConfigFunctionalTest {
private final FTPClient ftpClient = new FTPClient();
private FTPClientConfig ftpClientConfig;
@@ -90,7 +90,7 @@ public class FTPClientConfigFunctionalTest {
}
@Test
- public void testTimeZoneFunctionality() throws Exception {
+ void testTimeZoneFunctionality() throws Exception {
final java.util.Date nowDate = new java.util.Date();
final Instant nowInstant = nowDate.toInstant();
final FTPFile[] files = ftpClient.listFiles();
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
index 5db733dc..eeaca239 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
@@ -29,7 +29,7 @@ import java.util.Locale;
import org.junit.jupiter.api.Test;
-public class FTPClientConfigTest {
+class FTPClientConfigTest {
private static final String A = "A";
@@ -49,7 +49,7 @@ public class FTPClientConfigTest {
* Class under test for void FTPClientConfig(String)
*/
@Test
- public void testFTPClientConfigString() {
+ void testFTPClientConfigString() {
final FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_VMS);
assertEquals(FTPClientConfig.SYST_VMS, config.getServerSystemKey());
assertNull(config.getDefaultDateFormatStr());
@@ -63,7 +63,7 @@ public class FTPClientConfigTest {
* Class under test for void FTPClientConfig(String, String, String, String, String, String)
*/
@Test
- public void testFTPClientConfigStringStringStringStringStringString() {
+ void testFTPClientConfigStringStringStringStringStringString() {
final FTPClientConfig conf = new FTPClientConfig(A, B, C, D, E, F);
assertEquals("A", conf.getServerSystemKey());
@@ -75,7 +75,7 @@ public class FTPClientConfigTest {
}
@Test
- public void testGetDateFormatSymbols() {
+ void testGetDateFormatSymbols() {
assertThrows(IllegalArgumentException.class, () -> FTPClientConfig.getDateFormatSymbols(badDelim), "bad delimiter");
assertThrows(IllegalArgumentException.class, () -> FTPClientConfig.getDateFormatSymbols(tooLong), "more than 12 months");
@@ -109,11 +109,11 @@ public class FTPClientConfigTest {
}
@Test
- public void testGetServerLanguageCode() {
+ void testGetServerLanguageCode() {
}
@Test
- public void testLookupDateFormatSymbols() {
+ void testLookupDateFormatSymbols() {
DateFormatSymbols dfs1 = null;
DateFormatSymbols dfs2 = null;
DateFormatSymbols dfs3 = null;
@@ -171,7 +171,7 @@ public class FTPClientConfigTest {
}
@Test
- public void testSetShortMonthNames() {
+ void testSetShortMonthNames() {
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java b/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java
index 00bea440..e6f10f2f 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java
@@ -32,7 +32,7 @@ import java.net.InetAddress;
import org.apache.commons.net.ftp.parser.UnixFTPEntryParser;
import org.junit.jupiter.api.Test;
-public class FTPClientTest {
+class FTPClientTest {
private static final class LocalClient extends FTPClient {
@@ -86,61 +86,61 @@ public class FTPClientTest {
"/", };
@Test
- public void testCopyStreamListener() {
+ void testCopyStreamListener() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertNull(client.getCopyStreamListener());
}
@Test
- public void testGetActivePort() {
+ void testGetActivePort() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertEquals(0, client.getActivePort());
}
@Test
- public void testGetAutodetectUTF8() {
+ void testGetAutodetectUTF8() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertFalse(client.getAutodetectUTF8());
}
@Test
- public void testGetBufferSize() {
+ void testGetBufferSize() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertEquals(0, client.getBufferSize());
}
@Test
- public void testGetControlKeepAliveReplyTimeout() {
+ void testGetControlKeepAliveReplyTimeout() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertEquals(1_000, client.getControlKeepAliveReplyTimeout());
}
@Test
- public void testGetControlKeepAliveTimeout() {
+ void testGetControlKeepAliveTimeout() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertEquals(0, client.getControlKeepAliveTimeout());
}
@Test
- public void testGetCslDebug() {
+ void testGetCslDebug() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertNull(client.getCslDebug());
}
@Test
- public void testGetPassiveLocalIPAddress() {
+ void testGetPassiveLocalIPAddress() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertNull(client.getPassiveLocalIPAddress());
}
@Test
- public void testGetPassivePort() {
+ void testGetPassivePort() {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
assertEquals(-1, client.getPassivePort());
}
@Test
- public void testLoadResourceProperties() {
+ void testLoadResourceProperties() {
assertNull(FTPClient.loadResourceProperties(null));
assertNull(FTPClient.loadResourceProperties("this/does/not/exist.properties"));
assertNull(FTPClient.loadResourceProperties("/this/does/not/exist.properties"));
@@ -151,14 +151,14 @@ public class FTPClientTest {
}
@Test
- public void testParseClient() {
+ void testParseClient() {
for (int i = 0; i < TESTS.length; i += 2) {
assertEquals(TESTS[i + 1], FTPClient.parsePathname(TESTS[i]), "Failed to parse");
}
}
@Test
- public void testParsePassiveModeReplyForLocalAddressWithNatWorkaround() throws Exception {
+ void testParsePassiveModeReplyForLocalAddressWithNatWorkaround() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setIpAddressFromPasvResponse(true);
client._parsePassiveModeReply("227 Entering Passive Mode (172,16,204,138,192,22).");
@@ -170,7 +170,7 @@ public class FTPClientTest {
@SuppressWarnings("deprecation") // testing deprecated code
@Test
- public void testParsePassiveModeReplyForLocalAddressWithNatWorkaroundDisabled() throws Exception {
+ void testParsePassiveModeReplyForLocalAddressWithNatWorkaroundDisabled() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setPassiveNatWorkaround(false);
client.setIpAddressFromPasvResponse(true);
@@ -182,7 +182,7 @@ public class FTPClientTest {
}
@Test
- public void testParsePassiveModeReplyForLocalAddressWithoutNatWorkaroundStrategy() throws Exception {
+ void testParsePassiveModeReplyForLocalAddressWithoutNatWorkaroundStrategy() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setPassiveNatWorkaroundStrategy(null);
client.setIpAddressFromPasvResponse(true);
@@ -194,7 +194,7 @@ public class FTPClientTest {
}
@Test
- public void testParsePassiveModeReplyForLocalAddressWithSimpleNatWorkaroundStrategy() throws Exception {
+ void testParsePassiveModeReplyForLocalAddressWithSimpleNatWorkaroundStrategy() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setPassiveNatWorkaroundStrategy(hostname -> "4.4.4.4");
client.setIpAddressFromPasvResponse(true);
@@ -206,7 +206,7 @@ public class FTPClientTest {
}
@Test
- public void testParsePassiveModeReplyForNonLocalAddressWithNatWorkaround() throws Exception {
+ void testParsePassiveModeReplyForNonLocalAddressWithNatWorkaround() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setIpAddressFromPasvResponse(true);
client._parsePassiveModeReply("227 Entering Passive Mode (8,8,4,4,192,22).");
@@ -218,7 +218,7 @@ public class FTPClientTest {
@SuppressWarnings("deprecation") // testing deprecated code
@Test
- public void testParsePassiveModeReplyForNonLocalAddressWithNatWorkaroundDisabled() throws Exception {
+ void testParsePassiveModeReplyForNonLocalAddressWithNatWorkaroundDisabled() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setPassiveNatWorkaround(false);
client.setIpAddressFromPasvResponse(true);
@@ -230,7 +230,7 @@ public class FTPClientTest {
}
@Test
- public void testParsePassiveModeReplyForNonLocalAddressWithoutNatWorkaroundStrategy() throws Exception {
+ void testParsePassiveModeReplyForNonLocalAddressWithoutNatWorkaroundStrategy() throws Exception {
final FTPClient client = new PassiveNatWorkAroundLocalClient("8.8.8.8");
client.setPassiveNatWorkaroundStrategy(null);
client.setIpAddressFromPasvResponse(true);
@@ -242,7 +242,7 @@ public class FTPClientTest {
}
@Test
- public void testParserCachingNullKey() throws Exception {
+ void testParserCachingNullKey() throws Exception {
final LocalClient client = new LocalClient();
client.setSystemType(FTPClientConfig.SYST_UNIX);
assertNull(client.getEntryParser());
@@ -257,7 +257,7 @@ public class FTPClientTest {
}
@Test
- public void testParserCachingWithKey() throws Exception {
+ void testParserCachingWithKey() throws Exception {
final FTPClient client = new FTPClient();
assertNull(client.getEntryParser());
client.createParser(FTPClientConfig.SYST_UNIX);
@@ -275,7 +275,7 @@ public class FTPClientTest {
}
@Test
- public void testUnparseableFiles() throws Exception {
+ void testUnparseableFiles() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
baos.write("-rwxr-xr-x 2 root root 4096 Mar 2 15:13 zxbox".getBytes());
baos.write(new byte[] { '\r', '\n' });
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPClientTransferModeTest.java b/src/test/java/org/apache/commons/net/ftp/FTPClientTransferModeTest.java
index 5bbaafb5..3dab82d8 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPClientTransferModeTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPClientTransferModeTest.java
@@ -49,7 +49,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
-public class FTPClientTransferModeTest {
+class FTPClientTransferModeTest {
private static final class FtpServerAndPort {
@@ -133,7 +133,7 @@ public class FTPClientTransferModeTest {
@ParameterizedTest
@ValueSource(ints = {FTP.DEFLATE_TRANSFER_MODE})
- public void testRetrievingFiles(final int transferMode) throws Exception {
+ void testRetrievingFiles(final int transferMode) throws Exception {
new File(DEFAULT_HOME).mkdirs();
final String filename = "test_download.txt";
final String fileContent = "Created at " + Instant.now();
@@ -160,7 +160,7 @@ public class FTPClientTransferModeTest {
@ParameterizedTest
@ValueSource(ints = {FTP.DEFLATE_TRANSFER_MODE})
- public void testStoringFiles(final int transferMode) throws Exception {
+ void testStoringFiles(final int transferMode) throws Exception {
runWithFTPserver((port, user, password) -> {
final FTPClient client = new FTPClient();
try {
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPCommandTest.java b/src/test/java/org/apache/commons/net/ftp/FTPCommandTest.java
index cd8cf161..2b415dc8 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPCommandTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPCommandTest.java
@@ -19,11 +19,11 @@ package org.apache.commons.net.ftp;
import org.junit.jupiter.api.Test;
-public class FTPCommandTest {
+class FTPCommandTest {
@SuppressWarnings("deprecation") // test of deprecated code
@Test
- public void testArray() {
+ void testArray() {
FTPCommand.checkArray();
}
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPFileTest.java b/src/test/java/org/apache/commons/net/ftp/FTPFileTest.java
index 7817dd9d..a49d09b8 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPFileTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPFileTest.java
@@ -33,10 +33,10 @@ import java.util.TimeZone;
import org.apache.commons.lang3.time.TimeZones;
import org.junit.jupiter.api.Test;
-public class FTPFileTest {
+class FTPFileTest {
@Test
- public void testGetTimestampInstant() {
+ void testGetTimestampInstant() {
final FTPFile file = new FTPFile();
final Calendar timestamp = Calendar.getInstance(TimeZones.GMT);
timestamp.set(2023, Calendar.AUGUST, 4, 23, 40, 55);
@@ -53,93 +53,93 @@ public class FTPFileTest {
}
@Test
- public void testGetTimestampInstantNullCalendar() {
+ void testGetTimestampInstantNullCalendar() {
final FTPFile file = new FTPFile();
assertNull(file.getTimestampInstant());
}
@Test
- public void testHasPermissionFalse() {
+ void testHasPermissionFalse() {
final FTPFile file = new FTPFile();
file.setPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION, false);
assertFalse(file.hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION));
}
@Test
- public void testHasPermissionInvalidFile() {
+ void testHasPermissionInvalidFile() {
final FTPFile invalidFile = new FTPFile("LIST");
assertFalse(invalidFile.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.EXECUTE_PERMISSION));
}
@Test
- public void testHasPermissionTrue() {
+ void testHasPermissionTrue() {
final FTPFile file = new FTPFile();
file.setPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION, true);
assertTrue(file.hasPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION));
}
@Test
- public void testIsDirectory() {
+ void testIsDirectory() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.DIRECTORY_TYPE);
assertTrue(file.isDirectory());
}
@Test
- public void testIsFile() {
+ void testIsFile() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.FILE_TYPE);
assertTrue(file.isFile());
}
@Test
- public void testIsSymbolicLink() {
+ void testIsSymbolicLink() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.SYMBOLIC_LINK_TYPE);
assertTrue(file.isSymbolicLink());
}
@Test
- public void testIsUnknown() {
+ void testIsUnknown() {
final FTPFile file = new FTPFile();
assertTrue(file.isUnknown());
}
@Test
- public void testToFormattedStringDirectoryType() {
+ void testToFormattedStringDirectoryType() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.DIRECTORY_TYPE);
assertTrue(file.toFormattedString().startsWith("d"));
}
@Test
- public void testToFormattedStringFileType() {
+ void testToFormattedStringFileType() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.FILE_TYPE);
assertTrue(file.toFormattedString().startsWith("-"));
}
@Test
- public void testToFormattedStringInvalidFile() {
+ void testToFormattedStringInvalidFile() {
final FTPFile invalidFile = new FTPFile("LIST");
assertEquals("[Invalid: could not parse file entry]", invalidFile.toFormattedString());
}
@Test
- public void testToFormattedStringSymbolicLinkType() {
+ void testToFormattedStringSymbolicLinkType() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.SYMBOLIC_LINK_TYPE);
assertTrue(file.toFormattedString().startsWith("l"));
}
@Test
- public void testToFormattedStringUnknownType() {
+ void testToFormattedStringUnknownType() {
final FTPFile file = new FTPFile();
assertTrue(file.toFormattedString().startsWith("?"));
}
@Test
- public void testToFormattedStringWithTimezone() {
+ void testToFormattedStringWithTimezone() {
final FTPFile file = new FTPFile();
file.setType(FTPFile.FILE_TYPE);
file.setSize(32767);
@@ -164,14 +164,14 @@ public class FTPFileTest {
}
@Test
- public void testToString() {
+ void testToString() {
final FTPFile file = new FTPFile();
file.setRawListing("LIST");
assertEquals(file.getRawListing(), file.toString());
}
@Test
- public void testToStringDefault() {
+ void testToStringDefault() {
final FTPFile file = new FTPFile();
assertNull(file.toString());
}
diff --git a/src/test/java/org/apache/commons/net/ftp/FTPSClientGettersTest.java b/src/test/java/org/apache/commons/net/ftp/FTPSClientGettersTest.java
index 5509abce..c4129b14 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPSClientGettersTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientGettersTest.java
@@ -26,10 +26,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests the getters on {@link FTPSClient}.
*/
-public class FTPSClientGettersTest {
+class FTPSClientGettersTest {
@Test
- public void testGetters() {
+ void testGetters() {
final FTPSClient testClient = new FTPSClient("SSL", true);
assertTrue(testClient.isImplicit());
assertEquals("SSL", testClient.getProtocol());
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 5569d166..b7c9ef0f 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
@@ -45,7 +45,7 @@ import org.junit.jupiter.params.provider.MethodSource;
* This test does the above programmatically.
* </p>
*/
-public class FTPSClientTest extends AbstractFtpsTest {
+class FTPSClientTest extends AbstractFtpsTest {
private static final String USER_PROPS_RES = "org/apache/commons/net/ftpsserver/users.properties";
@@ -63,7 +63,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testHasFeature(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testHasFeature(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testHasFeature");
loginClient().disconnect();
@@ -84,7 +84,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testListFilesPathNameEmpty(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testListFilesPathNameEmpty(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testListFilesPathNameEmpty");
testListFiles("");
@@ -94,7 +94,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testListFilesPathNameJunk(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testListFilesPathNameJunk(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testListFilesPathNameJunk");
testListFiles(" Junk ");
@@ -104,7 +104,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testListFilesPathNameNull(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testListFilesPathNameNull(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testListFilesPathNameNull");
testListFiles(null);
@@ -114,7 +114,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testListFilesPathNameRoot(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testListFilesPathNameRoot(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testListFilesPathNameRoot");
testListFiles("/");
@@ -124,7 +124,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testMdtmCalendar(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testMdtmCalendar(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testMdtmCalendar");
testMdtmCalendar("/file.txt");
@@ -148,7 +148,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testMdtmFile(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testMdtmFile(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testMdtmFile");
testMdtmFile("/file.txt");
@@ -172,7 +172,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testMdtmInstant(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testMdtmInstant(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testMdtmInstant");
testMdtmInstant("/file.txt");
@@ -196,7 +196,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testOpenClose(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testOpenClose(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testOpenClose");
final FTPSClient ftpsClient = loginClient();
@@ -212,7 +212,7 @@ public class FTPSClientTest extends AbstractFtpsTest {
@ParameterizedTest(name = "endpointCheckingEnabled={0}")
@MethodSource("endpointCheckingEnabledSource")
@Timeout(TEST_TIMEOUT)
- public void testRetrieveFilePathNameRoot(final boolean endpointCheckingEnabled) throws SocketException, IOException {
+ void testRetrieveFilePathNameRoot(final boolean endpointCheckingEnabled) throws SocketException, IOException {
setEndpointCheckingEnabled(endpointCheckingEnabled);
trace(">>testRetrieveFilePathNameRoot");
retrieveFile("/file.txt");
diff --git a/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java b/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
index 82c2c6cc..93b39a21 100644
--- a/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/ListingFunctionalTest.java
@@ -39,7 +39,7 @@ import org.junit.jupiter.params.provider.MethodSource;
/**
* A functional test suite for checking that site listings work.
*/
-public class ListingFunctionalTest {
+class ListingFunctionalTest {
public static final class TestCase {
private final String hostName;
private final String invalidParserKey;
@@ -148,7 +148,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testInitiateListParsing(final TestCase testCase) throws IOException {
+ void testInitiateListParsing(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
client.changeWorkingDirectory(testCase.validPath);
final FTPListParseEngine engine = client.initiateListParsing();
@@ -161,7 +161,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testInitiateListParsingWithPath(final TestCase testCase) throws IOException {
+ void testInitiateListParsingWithPath(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPListParseEngine engine = client.initiateListParsing(testCase.validParserKey, testCase.validPath);
final List<FTPFile> files = Arrays.asList(engine.getNext(25));
@@ -173,7 +173,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testInitiateListParsingWithPathAndAutodetection(final TestCase testCase) throws IOException {
+ void testInitiateListParsingWithPathAndAutodetection(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPListParseEngine engine = client.initiateListParsing(testCase.validPath);
final List<FTPFile> files = Arrays.asList(engine.getNext(25));
@@ -185,7 +185,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testInitiateListParsingWithPathAndAutodetectionButEmpty(final TestCase testCase) throws IOException {
+ void testInitiateListParsingWithPathAndAutodetectionButEmpty(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPListParseEngine engine = client.initiateListParsing(testCase.invalidPath);
assertFalse(engine.hasNext());
@@ -196,7 +196,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testInitiateListParsingWithPathAndIncorrectParser(final TestCase testCase) throws IOException {
+ void testInitiateListParsingWithPathAndIncorrectParser(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPListParseEngine engine = client.initiateListParsing(testCase.invalidParserKey, testCase.invalidPath);
assertFalse(engine.hasNext());
@@ -207,7 +207,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListFiles(final TestCase testCase) throws IOException {
+ void testListFiles(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPClientConfig config = new FTPClientConfig(testCase.validParserKey);
client.configure(config);
@@ -217,7 +217,7 @@ public class ListingFunctionalTest {
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListFilesWithAutodection(final TestCase testCase) throws IOException {
+ void testListFilesWithAutodection(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
client.changeWorkingDirectory(testCase.validPath);
final List<FTPFile> files = Arrays.asList(client.listFiles());
@@ -229,7 +229,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListFilesWithIncorrectParser(final TestCase testCase) throws IOException {
+ void testListFilesWithIncorrectParser(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPClientConfig config = new FTPClientConfig(testCase.invalidParserKey);
client.configure(config);
@@ -244,7 +244,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListFilesWithPathAndAutodectionButEmpty(final TestCase testCase) throws IOException {
+ void testListFilesWithPathAndAutodectionButEmpty(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final FTPFile[] files = client.listFiles(testCase.invalidPath);
assertEquals(0, files.length);
@@ -255,7 +255,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListFilesWithPathAndAutodetection(final TestCase testCase) throws IOException {
+ void testListFilesWithPathAndAutodetection(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final List<FTPFile> files = Arrays.asList(client.listFiles(testCase.validPath));
assertTrue(findByName(files, testCase.validFilename), files.toString());
@@ -266,7 +266,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListNames(final TestCase testCase) throws IOException {
+ void testListNames(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
client.changeWorkingDirectory(testCase.validPath);
final String[] names = client.listNames();
@@ -280,7 +280,7 @@ public class ListingFunctionalTest {
*/
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListNamesWithPath(final TestCase testCase) throws IOException {
+ void testListNamesWithPath(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final String[] listNames = client.listNames(testCase.validPath);
assertNotNull(listNames, "listNames not null");
@@ -290,7 +290,7 @@ public class ListingFunctionalTest {
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testListNamesWithPathButEmpty(final TestCase testCase) throws IOException {
+ void testListNamesWithPathButEmpty(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
final String[] names = client.listNames(testCase.invalidPath);
assertTrue(ArrayUtils.isEmpty(names));
@@ -298,7 +298,7 @@ public class ListingFunctionalTest {
@ParameterizedTest(name = "hostname={0}")
@MethodSource("testCases")
- public void testPrintWorkingDirectory(final TestCase testCase) throws IOException {
+ void testPrintWorkingDirectory(final TestCase testCase) throws IOException {
client = createFTPClient(testCase.hostName);
client.changeWorkingDirectory(testCase.validPath);
final String pwd = client.printWorkingDirectory();
diff --git a/src/test/java/org/apache/commons/net/ftp/TestConnectTimeout.java b/src/test/java/org/apache/commons/net/ftp/TestConnectTimeout.java
index 3544a499..f8cdde3c 100644
--- a/src/test/java/org/apache/commons/net/ftp/TestConnectTimeout.java
+++ b/src/test/java/org/apache/commons/net/ftp/TestConnectTimeout.java
@@ -30,10 +30,10 @@ import org.junit.jupiter.api.Test;
/**
* Test the socket connect timeout functionality
*/
-public class TestConnectTimeout {
+class TestConnectTimeout {
@Test
- public void testConnectTimeout() throws SocketException, IOException {
+ void testConnectTimeout() throws SocketException, IOException {
final FTPClient client = new FTPClient();
client.setConnectTimeout(1000);
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/AbstractFTPParseTest.java b/src/test/java/org/apache/commons/net/ftp/parser/AbstractFTPParseTest.java
index 7c2b1710..b5792695 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/AbstractFTPParseTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/AbstractFTPParseTest.java
@@ -111,7 +111,7 @@ public abstract class AbstractFTPParseTest {
}
@Test
- public void testBadListing() {
+ void testBadListing() {
final String[] badsamples = getBadListing();
for (final String test : badsamples) {
@@ -124,10 +124,10 @@ public abstract class AbstractFTPParseTest {
}
// Force subclasses to test precision
- public abstract void testDefaultPrecision();
+ abstract void testDefaultPrecision();
@Test
- public void testGoodListing() {
+ void testGoodListing() {
final String[] goodsamples = getGoodListing();
for (final String test : goodsamples) {
@@ -144,14 +144,14 @@ public abstract class AbstractFTPParseTest {
*
* @throws Exception on error
*/
- public abstract void testParseFieldsOnDirectory() throws Exception;
+ abstract void testParseFieldsOnDirectory() throws Exception;
/**
* Method testParseFieldsOnFile. Provide a test to show that fields on a file entry are parsed correctly.
*
* @throws Exception on error
*/
- public abstract void testParseFieldsOnFile() throws Exception;
+ abstract void testParseFieldsOnFile() throws Exception;
protected void testPrecision(final String listEntry, final CalendarUnit expectedPrecision) {
final FTPFile file = getParser().parseFTPEntry(listEntry);
@@ -176,5 +176,5 @@ public abstract class AbstractFTPParseTest {
}
}
- public abstract void testRecentPrecision();
+ abstract void testRecentPrecision();
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/CompositeFTPParseTestFramework.java b/src/test/java/org/apache/commons/net/ftp/parser/CompositeFTPParseTestFramework.java
index f63763f7..0288ba57 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/CompositeFTPParseTestFramework.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/CompositeFTPParseTestFramework.java
@@ -58,7 +58,7 @@ public abstract class CompositeFTPParseTestFramework extends AbstractFTPParseTes
*/
@Override
@Test
- public void testBadListing() {
+ void testBadListing() {
final String badsamples[][] = getBadListings();
for (final String[] badsample : badsamples) {
@@ -78,7 +78,7 @@ public abstract class CompositeFTPParseTestFramework extends AbstractFTPParseTes
* @see org.apache.commons.net.ftp.parser.FTPParseTestFramework#testGoodListing()
*/
@Test
- public void testConsistentListing() {
+ void testConsistentListing() {
final String goodsamples[][] = getGoodListings();
for (final String[] goodsample : goodsamples) {
@@ -96,7 +96,7 @@ public abstract class CompositeFTPParseTestFramework extends AbstractFTPParseTes
// or the other, this tests that a parser that has succeeded
// on one format will fail if another format is substituted.
@Test
- public void testInconsistentListing() {
+ void testInconsistentListing() {
final String goodsamples[][] = getGoodListings();
final FTPFileEntryParser parser = getParser();
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java b/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
index 74f0c506..4833d67b 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
@@ -28,7 +28,7 @@ import org.apache.commons.net.ftp.FTPClientConfig;
import org.apache.commons.net.ftp.FTPFileEntryParser;
import org.junit.jupiter.api.Test;
-public class DefaultFTPFileEntryParserFactoryTest {
+class DefaultFTPFileEntryParserFactoryTest {
private void checkParserClass(final FTPFileEntryParserFactory fact, final String key, final Class<?> expected) {
final FTPClientConfig config = key == null ? new FTPClientConfig() : new FTPClientConfig(key);
final FTPFileEntryParser parser = fact.createFileEntryParser(config);
@@ -37,7 +37,7 @@ public class DefaultFTPFileEntryParserFactoryTest {
}
@Test
- public void testDefaultParserFactory() {
+ void testDefaultParserFactory() {
final DefaultFTPFileEntryParserFactory factory = new DefaultFTPFileEntryParserFactory();
FTPFileEntryParser parser = factory.createFileEntryParser("unix");
@@ -124,7 +124,7 @@ public class DefaultFTPFileEntryParserFactoryTest {
}
@Test
- public void testDefaultParserFactoryConfig() throws Exception {
+ void testDefaultParserFactoryConfig() throws Exception {
final DefaultFTPFileEntryParserFactory factory = new DefaultFTPFileEntryParserFactory();
assertThrows(NullPointerException.class, () -> factory.createFileEntryParser((FTPClientConfig) null));
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
index 9991fdf7..3ead102c 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests the EnterpriseUnixFTPEntryParser
*/
-public class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
+class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] BADSAMPLES = { "zrwxr-xr-x 2 root root 4096 Mar 2 15:13 zxbox",
"dxrwr-xr-x 2 root root 4096 Aug 24 2001 zxjdbc", "drwxr-xr-x 2 root root 4096 Jam 4 00:03 zziplib",
@@ -99,7 +99,7 @@ public class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("-C--E-----FTP B QUA1I1 18128 5000000000 Aug 12 2014 QUADTEST", CalendarUnit.DAY_OF_MONTH);
}
@@ -108,7 +108,7 @@ public class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
*/
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
// Everything is a File for now.
}
@@ -117,7 +117,7 @@ public class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
*/
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
// Note: No time zone.
final FTPFile ftpFile = getParser().parseFTPEntry("-C--E-----FTP B QUA1I1 18128 5000000000 Aug 12 13:56 QUADTEST");
final Calendar today = Calendar.getInstance();
@@ -158,7 +158,7 @@ public class EnterpriseUnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
testPrecision("-C--E-----FTP B QUA1I1 18128 5000000000 Aug 12 13:56 QUADTEST", CalendarUnit.MINUTE);
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
index d1eeb52a..4d188e7d 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/FTPConfigEntryParserTest.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
*
* The original system presenting this issue was an AIX system - see bug #27437 for details.
*/
-public class FTPConfigEntryParserTest {
+class FTPConfigEntryParserTest {
private final SimpleDateFormat df = new SimpleDateFormat();
@@ -42,7 +42,7 @@ public class FTPConfigEntryParserTest {
* This is a new format reported on the mailing lists. Parsing this kind of entry necessitated changing the regex in the parser.
*/
@Test
- public void testParseEntryWithSymlink() {
+ void testParseEntryWithSymlink() {
final FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
config.setDefaultDateFormatStr("yyyy-MM-dd HH:mm");
@@ -88,7 +88,7 @@ public class FTPConfigEntryParserTest {
}
@Test
- public void testParseFieldsOnAIX() {
+ void testParseFieldsOnAIX() {
// Set a date format for this server type
final FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
index 9a69cd1d..449a7b51 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImplTest.java
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
/**
* Test the FTPTimestampParser class.
*/
-public class FTPTimestampParserImplTest {
+class FTPTimestampParserImplTest {
private static final int TWO_HOURS_OF_MILLISECONDS = 2 * 60 * 60 * 1000;
@@ -101,7 +101,7 @@ public class FTPTimestampParserImplTest {
// Test leap year if current year is a leap year
@Test
- public void testFeb29IfLeapYear() throws Exception {
+ void testFeb29IfLeapYear() throws Exception {
final GregorianCalendar now = new GregorianCalendar();
final int thisYear = now.get(Calendar.YEAR);
final GregorianCalendar target = new GregorianCalendar(thisYear, Calendar.FEBRUARY, 29);
@@ -114,14 +114,14 @@ public class FTPTimestampParserImplTest {
// Test Feb 29 for a known leap year
@Test
- public void testFeb29LeapYear() throws Exception {
+ void testFeb29LeapYear() throws Exception {
final int year = 2000; // Use same year for current and short date
final GregorianCalendar now = new GregorianCalendar(year, Calendar.APRIL, 1, 12, 0);
checkShortParse("Feb 29th 2000", now, new GregorianCalendar(year, Calendar.FEBRUARY, 29));
}
@Test
- public void testFeb29LeapYear2() throws Exception {
+ void testFeb29LeapYear2() throws Exception {
final int year = 2000; // Use same year for current and short date
final GregorianCalendar now = new GregorianCalendar(year, Calendar.MARCH, 1, 12, 0);
checkShortParse("Feb 29th 2000", now, new GregorianCalendar(year, Calendar.FEBRUARY, 29));
@@ -129,7 +129,7 @@ public class FTPTimestampParserImplTest {
// same date feb 29
@Test
- public void testFeb29LeapYear3() throws Exception {
+ void testFeb29LeapYear3() throws Exception {
final int year = 2000; // Use same year for current and short date
final GregorianCalendar now = new GregorianCalendar(year, Calendar.FEBRUARY, 29, 12, 0);
checkShortParse("Feb 29th 2000", now, new GregorianCalendar(year, Calendar.FEBRUARY, 29));
@@ -137,7 +137,7 @@ public class FTPTimestampParserImplTest {
// future dated Feb 29
@Test
- public void testFeb29LeapYear4() throws Exception {
+ void testFeb29LeapYear4() throws Exception {
final int year = 2000; // Use same year for current and short date
final GregorianCalendar now = new GregorianCalendar(year, Calendar.FEBRUARY, 28, 12, 0);
// Must allow lenient future date here
@@ -146,7 +146,7 @@ public class FTPTimestampParserImplTest {
// Test Feb 29 for a known non-leap year - should fail
@Test
- public void testFeb29NonLeapYear() {
+ void testFeb29NonLeapYear() {
final GregorianCalendar server = new GregorianCalendar(1999, Calendar.APRIL, 1, 12, 0);
// Note: we use a known leap year for the target date to avoid rounding up
final GregorianCalendar input = new GregorianCalendar(2000, Calendar.FEBRUARY, 29);
@@ -156,7 +156,7 @@ public class FTPTimestampParserImplTest {
}
@Test
- public void testNET444() throws Exception {
+ void testNET444() throws Exception {
final FTPTimestampParserImpl parser = new FTPTimestampParserImpl();
parser.setLenientFutureDates(true);
final SimpleDateFormat sdf = new SimpleDateFormat(parser.getRecentDateFormatString());
@@ -180,7 +180,7 @@ public class FTPTimestampParserImplTest {
// This test currently fails, because we assume that short dates are +-6months when parsing Feb 29
@Test
@Disabled
- public void testNET446() throws Exception {
+ void testNET446() throws Exception {
final GregorianCalendar server = new GregorianCalendar(2001, Calendar.JANUARY, 1, 12, 0);
// Note: we use a known leap year for the target date to avoid rounding up
final GregorianCalendar input = new GregorianCalendar(2000, Calendar.FEBRUARY, 29);
@@ -203,14 +203,14 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
*/
@Test
@Disabled
- public void testNet710() throws ParseException {
+ void testNet710() throws ParseException {
final Calendar serverTime = Calendar.getInstance(TimeZone.getTimeZone("EDT"), Locale.US);
serverTime.set(2022, Calendar.MARCH, 16, 14, 0);
new FTPTimestampParserImpl().parseTimestamp("Mar 13 02:33", serverTime);
}
@Test
- public void testParseDec31Lenient() throws Exception {
+ void testParseDec31Lenient() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2007, Calendar.DECEMBER, 30, 12, 0);
checkShortParse("2007-12-30", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -219,7 +219,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseJan01() throws Exception {
+ void testParseJan01() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2007, Calendar.JANUARY, 1, 12, 0);
checkShortParse("2007-01-01", now, now); // should always work
final GregorianCalendar target = new GregorianCalendar(2006, Calendar.DECEMBER, 31, 12, 0);
@@ -228,7 +228,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseJan01Lenient() throws Exception {
+ void testParseJan01Lenient() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2007, Calendar.DECEMBER, 31, 12, 0);
checkShortParse("2007-12-31", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -237,7 +237,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParser() throws ParseException {
+ void testParser() throws ParseException {
// This test requires an English Locale
final Locale locale = Locale.getDefault();
try {
@@ -272,7 +272,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseShortFutureDates1() throws Exception {
+ void testParseShortFutureDates1() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2001, Calendar.MAY, 30, 12, 0);
checkShortParse("2001-5-30", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -291,7 +291,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseShortFutureDates2() throws Exception {
+ void testParseShortFutureDates2() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2004, Calendar.AUGUST, 1, 12, 0);
checkShortParse("2004-8-1", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -310,7 +310,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseShortPastDates1() throws Exception {
+ void testParseShortPastDates1() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2001, Calendar.MAY, 30, 12, 0);
checkShortParse("2001-5-30", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -323,7 +323,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseShortPastDates2() throws Exception {
+ void testParseShortPastDates2() throws Exception {
final GregorianCalendar now = new GregorianCalendar(2004, Calendar.AUGUST, 1, 12, 0);
checkShortParse("2004-8-1", now, now); // should always work
final GregorianCalendar target = (GregorianCalendar) now.clone();
@@ -336,7 +336,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseTimestamp() {
+ void testParseTimestamp() {
final Calendar cal = Calendar.getInstance();
cal.add(Calendar.HOUR_OF_DAY, 1);
cal.set(Calendar.SECOND, 0);
@@ -356,7 +356,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseTimestampAcrossTimeZones() {
+ void testParseTimestampAcrossTimeZones() {
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
@@ -413,7 +413,7 @@ java.text.ParseException: Timestamp 'Mar 13 02:33' could not be parsed using a s
}
@Test
- public void testParseTimestampWithSlop() {
+ void testParseTimestampWithSlop() {
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java b/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
index 701b6c0f..6bfee439 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/MLSDComparison.java
@@ -175,7 +175,7 @@ public class MLSDComparison {
}
@Test
- public void testFile() throws Exception {
+ void testFile() throws Exception {
final File path = new File(DownloadListings.DOWNLOAD_DIR);
final FilenameFilter filter = (dir, name) -> name.endsWith("_mlsd.txt");
final File[] files = path.listFiles(filter);
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
index e7468303..325d108a 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/MLSxEntryParserTest.java
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class MLSxEntryParserTest extends AbstractFTPParseTest {
+class MLSxEntryParserTest extends AbstractFTPParseTest {
private static final String[] badsamples = { "Type=cdir;Modify=20141022065101;UNIX.mode=0775;/no/space", // no space between facts and name
"Type=cdir;Modify=20141022065103;UNIX.mode=0775;", // no name or space
@@ -70,23 +70,23 @@ public class MLSxEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("Type=dir;Modify=20141022065102;UNIX.mode=0775; source", CalendarUnit.SECOND);
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
}
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
}
@Override
@Test
- public void testRecentPrecision() { // borrow this method to test milliseconds
+ void testRecentPrecision() { // borrow this method to test milliseconds
testPrecision("Type=dir;Modify=20141022065102.999;UNIX.mode=0775; source", CalendarUnit.MILLISECOND);
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
index a4f03c7a..56d24120 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
/**
* Test suite addapted to new MVSFTPEntryParser.java.
*/
-public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
+class MVSFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] goodsamplesDatasetList = {
/* Note, if the string begins with SAVE, the parsed entry is stored in the List saveftpfiles */
@@ -125,7 +125,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
// TODO Not sure what dates are parsed
}
@@ -138,7 +138,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
*/
@Override
@Test
- public void testGoodListing() {
+ void testGoodListing() {
final String[] goodsamples = getGoodListing();
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.FILE_LIST_TYPE);
@@ -151,7 +151,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testJesLevel1Listing() {
+ void testJesLevel1Listing() {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.JES_LEVEL_1_LIST_TYPE);
parser.setRegex(MVSFTPEntryParser.JES_LEVEL_1_LIST_REGEX);
@@ -163,7 +163,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testJesLevel2Listing() {
+ void testJesLevel2Listing() {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.JES_LEVEL_2_LIST_TYPE);
parser.setRegex(MVSFTPEntryParser.JES_LEVEL_2_LIST_REGEX);
@@ -175,7 +175,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testMemberListing() {
+ void testMemberListing() {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.MEMBER_LIST_TYPE);
parser.setRegex(MVSFTPEntryParser.MEMBER_LIST_REGEX);
@@ -188,7 +188,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.FILE_LIST_TYPE);
parser.setRegex(MVSFTPEntryParser.FILE_LIST_REGEX);
@@ -212,7 +212,7 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
*/
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
FTPFile file;
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
@@ -245,12 +245,12 @@ public class MVSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
// TODO Auto-generated method stub
}
@Test
- public void testUnixListings() {
+ void testUnixListings() {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
final List<String> list = new ArrayList<>();
Collections.addAll(list, goodsamplesUnixList);
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
index f4c23103..df2ce774 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/MacOsPeterFTPEntryParserTest.java
@@ -28,7 +28,7 @@ import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPFileEntryParser;
import org.junit.jupiter.api.Test;
-public class MacOsPeterFTPEntryParserTest extends AbstractFTPParseTest {
+class MacOsPeterFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] badsamples = { "drwxr-xr-x 123 folder 0 Jan 4 14:49 Steak", };
@@ -77,13 +77,13 @@ public class MacOsPeterFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("-rw-r--r-- 78440 49231 127671 Jul 22 2010 Filename with whitespace.jpg", CalendarUnit.DAY_OF_MONTH);
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x folder 0 Mar 2 15:13 Alias_to_Steak");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isDirectory(), "Should have been a directory.");
@@ -113,7 +113,7 @@ public class MacOsPeterFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 78440 49231 127671 Jul 2 14:51 Filename with whitespace.jpg");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -142,7 +142,7 @@ public class MacOsPeterFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
testPrecision("-rw-r--r-- 78440 49231 127671 Jul 22 14:51 Filename with whitespace.jpg", CalendarUnit.MINUTE);
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
index 4ddefe3d..c6891630 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
+class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
private static final String[][] goodsamples = { { // DOS-style tests
"05-26-95 10:57AM 143712 $LDR$", "05-20-97 03:31PM 681 .bash_history",
@@ -136,7 +136,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("05-26-1995 10:57AM 143712 $LDR$", CalendarUnit.MINUTE);
testPrecision("05-22-97 08:08 828 AUTOEXEC.BAK", CalendarUnit.MINUTE);
}
@@ -145,13 +145,13 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
* test condition reported as bug 20259 - now NET-106. directory with name beginning with a numeric character was not parsing correctly
*/
@Test
- public void testDirectoryBeginningWithNumber() {
+ void testDirectoryBeginningWithNumber() {
final FTPFile f = getParser().parseFTPEntry(directoryBeginningWithNumber);
assertEquals("123xyz", f.getName(), "name");
}
@Test
- public void testDirectoryBeginningWithNumberFollowedBySpaces() {
+ void testDirectoryBeginningWithNumberFollowedBySpaces() {
FTPFile f = getParser().parseFTPEntry("12-03-96 06:38AM <DIR> 123 xyz");
assertEquals("123 xyz", f.getName(), "name");
f = getParser().parseFTPEntry("12-03-96 06:38AM <DIR> 123 abc xyz");
@@ -163,7 +163,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
* Test that group names with embedded spaces can be handled correctly
*/
@Test
- public void testGroupNameWithSpaces() {
+ void testGroupNameWithSpaces() {
final FTPFile f = getParser().parseFTPEntry("drwx------ 4 maxm Domain Users 512 Oct 2 10:59 .metadata");
assertNotNull(f);
assertEquals("maxm", f.getUser());
@@ -171,7 +171,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
}
@Test
- public void testNET339() {
+ void testNET339() {
final FTPFile file = getParser().parseFTPEntry("05-22-97 12:08 5000000000 10 years and under");
assertNotNull(file, "Could not parse entry");
assertEquals("10 years and under", file.getName());
@@ -189,7 +189,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
}
@Test
- public void testNET516() throws Exception { // problem where part of a multi-byte char gets converted to 0x85 = line term
+ void testNET516() throws Exception { // problem where part of a multi-byte char gets converted to 0x85 = line term
final int utf = testNET516(StandardCharsets.UTF_8);
assertEquals(LISTFILE_COUNT, utf);
final int ascii = testNET516(StandardCharsets.US_ASCII);
@@ -211,7 +211,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
*/
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
FTPFile dir = getParser().parseFTPEntry("12-05-96 05:03PM <DIR> absoft2");
assertNotNull(dir, "Could not parse entry.");
assertEquals("Thu Dec 05 17:03:00 1996", df.format(dir.getTimestamp().getTime()));
@@ -232,7 +232,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
*/
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
FTPFile f = getParser().parseFTPEntry("05-22-97 12:08AM 5000000000 AUTOEXEC.BAK");
assertNotNull(f, "Could not parse entry.");
assertEquals("Thu May 22 00:08:00 1997", df.format(f.getTimestamp().getTime()));
@@ -253,7 +253,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
}
@Test
- public void testParseLeadingDigits() {
+ void testParseLeadingDigits() {
final FTPFile file = getParser().parseFTPEntry("05-22-97 12:08AM 5000000000 10 years and under");
assertNotNull(file, "Could not parse entry");
assertEquals("10 years and under", file.getName());
@@ -272,7 +272,7 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
// Not used
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
index bdeb2ed2..6c5859a0 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParserTest.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class NetwareFTPEntryParserTest extends AbstractFTPParseTest {
+class NetwareFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] badsamples = { "a [-----F--] SCION_SYS 512 Apr 13 23:52 SYS",
"d [----AF--] 0 512 10-04-2001 _ADMIN" };
@@ -56,13 +56,13 @@ public class NetwareFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("d [RWCEAFMS] rwinston 512 Nov 24 2005 Favorites", CalendarUnit.DAY_OF_MONTH);
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final String reply = "d [-W---F--] testUser 512 Apr 13 23:12 testFile";
final FTPFile f = getParser().parseFTPEntry(reply);
@@ -87,7 +87,7 @@ public class NetwareFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final String reply = "- [R-CEAFMS] rwinston 19968 Mar 12 15:20 Document name with spaces.doc";
final FTPFile f = getParser().parseFTPEntry(reply);
@@ -104,7 +104,7 @@ public class NetwareFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
testPrecision("- [RWCEAFMS] rwinston 19968 Mar 12 15:20 Executive Summary.doc", CalendarUnit.MINUTE);
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
index ffd9ef7c..ca99094d 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParserTest.java
@@ -24,7 +24,7 @@ import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPFileEntryParser;
import org.junit.jupiter.api.Test;
-public class OS2FTPEntryParserTest extends AbstractFTPParseTest {
+class OS2FTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] badsamples = { " DIR 12-30-97 12:32 jbrekke", " 0 rsa DIR 11-25-97 09:42 junk",
" 0 dir 05-12-97 16:44 LANGUAGE", " 0 DIR 13-05-97 25:49 MPTN",
@@ -59,14 +59,14 @@ public class OS2FTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision(" 0 DIR 05-12-97 16:44 PSFONTS", CalendarUnit.MINUTE);
testPrecision(" 0 DIR 05-19-2000 12:56 local", CalendarUnit.MINUTE);
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final FTPFile dir = getParser().parseFTPEntry(" 0 DIR 11-28-97 09:42 PC");
assertNotNull(dir, "Could not parse entry.");
assertTrue(dir.isDirectory(), "Should have been a directory.");
@@ -77,7 +77,7 @@ public class OS2FTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final FTPFile file = getParser().parseFTPEntry("5000000000 A 11-17-98 16:07 POPUPLOG.OS2");
assertNotNull(file, "Could not parse entry.");
assertTrue(file.isFile(), "Should have been a file.");
@@ -88,7 +88,7 @@ public class OS2FTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
// Not needed
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java b/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
index eae54ec0..58159b0b 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserAdditionalTest.java
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class OS400FTPEntryParserAdditionalTest extends CompositeFTPParseTestFramework {
+class OS400FTPEntryParserAdditionalTest extends CompositeFTPParseTestFramework {
private static final String[][] badsamples = { { "QPGMR 135168 04/03/18 13:18:19 *FILE", "QPGMR 135168 03/24 13:18:19 *FILE",
"QPGMR 135168 04/03/18 30:06:29 *FILE", "QPGMR 04/03/18 13:18:19 *FILE RPGUNITC1.FILE",
"QPGMR 135168 03/24 13:18:19 *FILE RPGUNITC1.FILE", "QPGMR 135168 04/03/18 30:06:29 *FILE RPGUNITC1.FILE",
@@ -64,13 +64,13 @@ public class OS400FTPEntryParserAdditionalTest extends CompositeFTPParseTestFram
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
// Done in other class
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final FTPFile f = getParser().parseFTPEntry("PEP 36864 04/03/24 14:06:34 *DIR dir1/");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isDirectory(), "Should have been a directory.");
@@ -92,7 +92,7 @@ public class OS400FTPEntryParserAdditionalTest extends CompositeFTPParseTestFram
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final FTPFile f = getParser().parseFTPEntry("PEP 5000000000 04/03/24 14:06:29 *STMF build.xml");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -113,7 +113,7 @@ public class OS400FTPEntryParserAdditionalTest extends CompositeFTPParseTestFram
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
// Done in other class
}
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
index 2b8e3791..c3a23f3d 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
+class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
private static final String[][] badsamples = {
{ "PEP 4019 04/03/18 18:58:16 STMF einladung.zip", "PEP 422 03/24 14:06:26 *STMF readme",
"PEP 6409 04/03/24 30:06:29 *STMF build.xml", "PEP USR 36864 04/03/24 14:06:34 *DIR dir1/",
@@ -80,12 +80,12 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("PEP 4019 04/03/18 18:58:16 *STMF einladung.zip", CalendarUnit.SECOND);
}
@Test
- public void testNET573() {
+ void testNET573() {
final FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_AS400);
conf.setDefaultDateFormatStr("MM/dd/yy HH:mm:ss");
final FTPFileEntryParser parser = new OS400FTPEntryParser(conf);
@@ -114,7 +114,7 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
*/
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final FTPFile f = getParser().parseFTPEntry("PEP 36864 04/03/24 14:06:34 *DIR dir1/");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isDirectory(), "Should have been a directory.");
@@ -139,7 +139,7 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
*/
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final FTPFile f = getParser().parseFTPEntry("PEP 5000000000 04/03/24 14:06:29 *STMF build.xml");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -162,7 +162,7 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
* Test file names with spaces.
*/
@Test
- public void testParseFileNameWithSpaces() {
+ void testParseFileNameWithSpaces() {
final FTPFile f = getParser().parseFTPEntry("MYUSER 3 06/12/21 12:00:00 *STMF file with space.txt");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -171,7 +171,7 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
testPrecision("----rwxr-x 1 PEP 0 4019 Mar 18 18:58 einladung.zip", CalendarUnit.MINUTE);
}
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
index 022f403b..024734d2 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
+class UnixFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] badsamples = { "zrwxr-xr-x 2 root root 4096 Mar 2 15:13 zxbox",
"dxrwr-xr-x 2 root root 4096 Aug 24 2001 zxjdbc", "drwxr-xr-x 2 root root 4096 Jam 4 00:03 zziplib",
@@ -148,7 +148,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testCorrectGroupNameParsing() {
+ void testCorrectGroupNameParsing() {
final FTPFile f = getParser().parseFTPEntry("-rw-r--r-- 1 ftpuser ftpusers 12414535 Mar 17 11:07 test 1999 abc.pdf");
assertNotNull(f);
assertEquals(1, f.getHardLinkCount());
@@ -174,12 +174,12 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("drwxr-xr-x 2 user group 4096 Mar 2 2014 zxbox", CalendarUnit.DAY_OF_MONTH);
}
@Test
- public void testFilenamesWithEmbeddedNumbers() {
+ void testFilenamesWithEmbeddedNumbers() {
final FTPFile f = getParser().parseFTPEntry("-rw-rw-rw- 1 user group 5840 Mar 19 09:34 123 456 abc.csv");
assertEquals("123 456 abc.csv", f.getName());
assertEquals(5840, f.getSize());
@@ -188,7 +188,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testGroupNameWithSpaces() {
+ void testGroupNameWithSpaces() {
final FTPFile f = getParser().parseFTPEntry("drwx------ 4 maxm Domain Users 512 Oct 2 10:59 .metadata");
assertNotNull(f);
assertEquals("maxm", f.getUser());
@@ -196,28 +196,28 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testLeadingSpacesDefault() { // the default has been changed to keep spaces
+ void testLeadingSpacesDefault() { // the default has been changed to keep spaces
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox");
assertNotNull(f);
assertEquals(" zxbox", f.getName()); // leading spaces retained
}
@Test
- public void testLeadingSpacesNET566() { // check new behavior
+ void testLeadingSpacesNET566() { // check new behavior
final FTPFile f = new UnixFTPEntryParser(null, false).parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox");
assertNotNull(f);
assertEquals(" zxbox", f.getName()); // leading spaces retained
}
@Test
- public void testNameWIthPunctuation() {
+ void testNameWIthPunctuation() {
final FTPFile f = getParser().parseFTPEntry("drwx------ 4 maxm Domain Users 512 Oct 2 10:59 abc(test)123.pdf");
assertNotNull(f);
assertEquals("abc(test)123.pdf", f.getName());
}
@Test
- public void testNET294() {
+ void testNET294() {
final FTPFile f = getParser().parseFTPEntry("-rwxrwx--- 1 ftp ftp-admin 816026400 Oct 5 2008 bloplab 7 cd1.img");
assertNotNull(f);
assertEquals("ftp", f.getUser());
@@ -229,7 +229,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testNoSpacesBeforeFileSize() {
+ void testNoSpacesBeforeFileSize() {
final FTPFile f = getParser().parseFTPEntry("drwxr-x---+1464 chrism chrism 41472 Feb 25 13:17 20090225");
assertNotNull(f);
assertEquals(41472, f.getSize());
@@ -240,7 +240,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testNumericDateFormat() {
+ void testNumericDateFormat() {
final String testNumericDF = "-rw-r----- 1 neeme neeme 346 2005-04-08 11:22 services.vsp";
final String testNumericDF2 = "lrwxrwxrwx 1 neeme neeme 23 2005-03-02 18:06 macros -> ./../../global/macros/.";
@@ -266,7 +266,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testOwnerAndGroupNameWithSpaces() {
+ void testOwnerAndGroupNameWithSpaces() {
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x 2 john smith test group 4096 Mar 2 15:13 zxbox");
assertNotNull(f);
assertEquals("john smith", f.getUser());
@@ -274,7 +274,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testOwnerNameWithSpaces() {
+ void testOwnerNameWithSpaces() {
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox");
assertNotNull(f);
assertEquals("john smith", f.getUser());
@@ -282,7 +282,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x 2 user group 4096 Mar 2 15:13 zxbox");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isDirectory(), "Should have been a directory.");
@@ -312,7 +312,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user my group 500 5000000000 Mar 2 15:13 zxbox");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -340,7 +340,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testParseFieldsOnFileChineseTime() {
+ void testParseFieldsOnFileChineseTime() {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user group 4096 3\u6708 2 15:13 zxbox");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -368,7 +368,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testParseFieldsOnFileChineseYear() {
+ void testParseFieldsOnFileChineseYear() {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user group 4096 3\u6708 2 2003 \u8a66\u9a13\u30d5\u30a1\u30a4\u30eb.csv");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -392,7 +392,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
// https://mail-archives.apache.org/mod_mbox/commons-dev/200408.mbox/%3c4122F3C1.9090402@tanukisoftware.com%3e
@Test
- public void testParseFieldsOnFileJapaneseTime() {
+ void testParseFieldsOnFileJapaneseTime() {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user group 4096 3\u6708 2\u65e5 15:13 zxbox");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -421,7 +421,7 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
// https://mail-archives.apache.org/mod_mbox/commons-dev/200408.mbox/%3c4122F3C1.9090402@tanukisoftware.com%3e
@Test
- public void testParseFieldsOnFileJapaneseYear() {
+ void testParseFieldsOnFileJapaneseYear() {
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user group 4096 3\u6708 2\u65e5 2003\u5e74 \u8a66\u9a13\u30d5\u30a1\u30a4\u30eb.csv");
assertNotNull(f, "Could not parse entry.");
assertTrue(f.isFile(), "Should have been a file.");
@@ -445,19 +445,19 @@ public class UnixFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
testPrecision("drwxr-xr-x 2 user group 4096 Mar 2 15:13 zxbox", CalendarUnit.MINUTE);
}
@Test
- public void testTrailingSpaces() {
+ void testTrailingSpaces() {
final FTPFile f = getParser().parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox ");
assertNotNull(f);
assertEquals("zxbox ", f.getName());
}
@Test
- public void testTrimLeadingSpacesNET566() { // check can trim spaces as before
+ void testTrimLeadingSpacesNET566() { // check can trim spaces as before
final FTPFile f = new UnixFTPEntryParser(null, true).parseFTPEntry("drwxr-xr-x 2 john smith group 4096 Mar 2 15:13 zxbox");
assertNotNull(f);
assertEquals("zxbox", f.getName()); // leading spaces trimmed
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java b/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
index 2f50ef91..e5f8af78 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParserTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test;
/**
*/
-public class VMSFTPEntryParserTest extends AbstractFTPParseTest {
+class VMSFTPEntryParserTest extends AbstractFTPParseTest {
private static final String[] BAD_SAMPLES = {
"1-JUN.LIS;2 9/9 JUN-2-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,)",
@@ -143,13 +143,13 @@ public class VMSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testDefaultPrecision() {
+ void testDefaultPrecision() {
testPrecision("1-JUN.LIS;1 9/9 2-JUN-1998 07:32:04 [TRANSLATED] (RWED,RD,,)", CalendarUnit.SECOND);
}
@Override
@Test
- public void testParseFieldsOnDirectory() throws Exception {
+ void testParseFieldsOnDirectory() throws Exception {
FTPFile dir = getParser().parseFTPEntry("DATA.DIR;1 1/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)");
assertTrue(dir.isDirectory(), "Should be a directory.");
@@ -172,7 +172,7 @@ public class VMSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testParseFieldsOnFile() throws Exception {
+ void testParseFieldsOnFile() throws Exception {
FTPFile file = getParser().parseFTPEntry("1-JUN.LIS;1 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RW,R)");
assertTrue(file.isFile(), "Should be a file.");
assertEquals("1-JUN.LIS", file.getName());
@@ -194,12 +194,12 @@ public class VMSFTPEntryParserTest extends AbstractFTPParseTest {
@Override
@Test
- public void testRecentPrecision() {
+ void testRecentPrecision() {
// Not used
}
@Test
- public void testWholeListParse() throws IOException {
+ void testWholeListParse() throws IOException {
final VMSFTPEntryParser parser = new VMSFTPEntryParser();
parser.configure(null);
final FTPListParseEngine engine = new FTPListParseEngine(parser);
@@ -214,7 +214,7 @@ public class VMSFTPEntryParserTest extends AbstractFTPParseTest {
}
@Test
- public void testWholeListParseWithVersioning() throws IOException {
+ void testWholeListParseWithVersioning() throws IOException {
final VMSFTPEntryParser parser = new VMSVersioningFTPEntryParser();
parser.configure(null);
diff --git a/src/test/java/org/apache/commons/net/imap/AuthenticatingIMAPClientTest.java b/src/test/java/org/apache/commons/net/imap/AuthenticatingIMAPClientTest.java
index 5be2b7c5..cfa042b5 100644
--- a/src/test/java/org/apache/commons/net/imap/AuthenticatingIMAPClientTest.java
+++ b/src/test/java/org/apache/commons/net/imap/AuthenticatingIMAPClientTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-public class AuthenticatingIMAPClientTest {
+class AuthenticatingIMAPClientTest {
private static Stream<Arguments> authMethods() {
return Stream.of(
diff --git a/src/test/java/org/apache/commons/net/imap/IMAPCommandTest.java b/src/test/java/org/apache/commons/net/imap/IMAPCommandTest.java
index d054cc0c..3e5a04e9 100644
--- a/src/test/java/org/apache/commons/net/imap/IMAPCommandTest.java
+++ b/src/test/java/org/apache/commons/net/imap/IMAPCommandTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-public class IMAPCommandTest {
+class IMAPCommandTest {
private static Stream<Arguments> imapCommands() {
return Stream.of(
diff --git a/src/test/java/org/apache/commons/net/imap/IMAPReplyTest.java b/src/test/java/org/apache/commons/net/imap/IMAPReplyTest.java
index 8cf26051..cccd6952 100644
--- a/src/test/java/org/apache/commons/net/imap/IMAPReplyTest.java
+++ b/src/test/java/org/apache/commons/net/imap/IMAPReplyTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
-public class IMAPReplyTest {
+class IMAPReplyTest {
private static Stream<String> invalidLiteralCommands() {
return Stream.of(
@@ -73,19 +73,19 @@ public class IMAPReplyTest {
}
@Test
- public void testGetReplyCodeBadLine() throws IOException {
+ void testGetReplyCodeBadLine() throws IOException {
final String badLine = "A044 BAD No such command as \"FOOBAR\"";
assertEquals(IMAPReply.BAD, IMAPReply.getReplyCode(badLine));
}
@Test
- public void testGetReplyCodeContinuationLine() throws IOException {
+ void testGetReplyCodeContinuationLine() throws IOException {
final String continuationLine = "+ Ready for additional command text";
assertEquals(IMAPReply.CONT, IMAPReply.getReplyCode(continuationLine));
}
@Test
- public void testGetReplyCodeMalformedLine() {
+ void testGetReplyCodeMalformedLine() {
final String malformedTaggedLine = "A064 FOO-BAR 0";
final MalformedServerReplyException replyException = assertThrows(MalformedServerReplyException.class,
() -> IMAPReply.getReplyCode(malformedTaggedLine));
@@ -93,13 +93,13 @@ public class IMAPReplyTest {
}
@Test
- public void testGetReplyCodeNoLine() throws IOException {
+ void testGetReplyCodeNoLine() throws IOException {
final String noLine = "A223 NO COPY failed: disk is full";
assertEquals(IMAPReply.NO, IMAPReply.getReplyCode(noLine));
}
@Test
- public void testGetReplyCodeOkLine() throws IOException {
+ void testGetReplyCodeOkLine() throws IOException {
assertEquals(IMAPReply.OK, IMAPReply.getReplyCode("A001 OK LOGIN completed"));
assertEquals(IMAPReply.OK, IMAPReply.getReplyCode("AAAA OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT"
+ " SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT" + " MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS"
@@ -114,19 +114,19 @@ public class IMAPReplyTest {
}
@Test
- public void testGetUntaggedReplyCodeBadLine() throws IOException {
+ void testGetUntaggedReplyCodeBadLine() throws IOException {
final String badLine = "* BAD Empty command line";
assertEquals(IMAPReply.BAD, IMAPReply.getUntaggedReplyCode(badLine));
}
@Test
- public void testGetUntaggedReplyCodeContinuationLine() throws IOException {
+ void testGetUntaggedReplyCodeContinuationLine() throws IOException {
final String continuationLine = "+ Ready for additional command text";
assertEquals(IMAPReply.CONT, IMAPReply.getUntaggedReplyCode(continuationLine));
}
@Test
- public void testGetUntaggedReplyCodeMalformedLine() {
+ void testGetUntaggedReplyCodeMalformedLine() {
// invalid experimental comm response (missing X prefix)
final String malformedUntaggedLine = "* FOO-BAR hello-world";
final MalformedServerReplyException replyException = assertThrows(MalformedServerReplyException.class,
@@ -135,13 +135,13 @@ public class IMAPReplyTest {
}
@Test
- public void testGetUntaggedReplyCodeNoLine() throws IOException {
+ void testGetUntaggedReplyCodeNoLine() throws IOException {
final String noLine = "* NO Disk is 98% full, please delete unnecessary data";
assertEquals(IMAPReply.NO, IMAPReply.getUntaggedReplyCode(noLine));
}
@Test
- public void testGetUntaggedReplyCodeOkLine() throws IOException {
+ void testGetUntaggedReplyCodeOkLine() throws IOException {
assertEquals(IMAPReply.OK, IMAPReply.getUntaggedReplyCode("* OK Salvage successful, no data lost"));
assertEquals(IMAPReply.OK,
IMAPReply.getUntaggedReplyCode("* OK The Microsoft Exchange IMAP4 service is ready. [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]"));
@@ -150,49 +150,49 @@ public class IMAPReplyTest {
}
@Test
- public void testIsContinuationReplyCode() {
+ void testIsContinuationReplyCode() {
final int replyCode = 3;
assertTrue(IMAPReply.isContinuation(replyCode));
}
@Test
- public void testIsContinuationReplyCodeInvalidCode() {
+ void testIsContinuationReplyCodeInvalidCode() {
final int invalidContinuationReplyCode = 1;
assertFalse(IMAPReply.isContinuation(invalidContinuationReplyCode));
}
@Test
- public void testIsContinuationReplyLine() {
+ void testIsContinuationReplyLine() {
final String replyLine = "+FLAGS completed";
assertTrue(IMAPReply.isContinuation(replyLine));
}
@Test
- public void testIsContinuationReplyLineInvalidLine() {
+ void testIsContinuationReplyLineInvalidLine() {
final String invalidContinuationReplyLine = "* 22 EXPUNGE";
assertFalse(IMAPReply.isContinuation(invalidContinuationReplyLine));
}
@Test
- public void testIsSuccessReplyCode() {
+ void testIsSuccessReplyCode() {
final int successfulReplyCode = 0;
assertTrue(IMAPReply.isSuccess(successfulReplyCode));
}
@Test
- public void testIsSuccessReplyCodeUnsuccessfulCode() {
+ void testIsSuccessReplyCodeUnsuccessfulCode() {
final int unsuccessfulReplyCode = 2;
assertFalse(IMAPReply.isSuccess(unsuccessfulReplyCode));
}
@Test
- public void testIsUntaggedReplyLine() {
+ void testIsUntaggedReplyLine() {
final String replyLine = "* 18 EXISTS";
assertTrue(IMAPReply.isUntagged(replyLine));
}
@Test
- public void testIsUntaggedReplyLineInvalidLine() {
+ void testIsUntaggedReplyLineInvalidLine() {
final String taggedLine = "a001 OK LOGOUT completed";
assertFalse(IMAPReply.isUntagged(taggedLine));
}
diff --git a/src/test/java/org/apache/commons/net/imap/IMAPTest.java b/src/test/java/org/apache/commons/net/imap/IMAPTest.java
index 630626ce..970586b1 100644
--- a/src/test/java/org/apache/commons/net/imap/IMAPTest.java
+++ b/src/test/java/org/apache/commons/net/imap/IMAPTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
-public class IMAPTest {
+class IMAPTest {
private static Stream<String> mailboxNamesToBeQuoted() {
return Stream.of(
@@ -51,7 +51,7 @@ public class IMAPTest {
}
@Test
- public void testCheckGenerator() {
+ void testCheckGenerator() {
// This test assumes:
// - 26 letters in the generator alphabet
// - the generator uses a fixed size tag
@@ -76,7 +76,7 @@ public class IMAPTest {
}
@Test
- public void testConstructDefaultIMAP() {
+ void testConstructDefaultIMAP() {
final IMAP imap = new IMAP();
assertEquals(IMAP.DEFAULT_PORT, imap.getDefaultPort());
assertEquals(IMAP.IMAPState.DISCONNECTED_STATE, imap.getState());
@@ -84,18 +84,18 @@ public class IMAPTest {
}
@Test
- public void testQuoteMailboxNameNullInput() {
+ void testQuoteMailboxNameNullInput() {
assertNull(IMAP.quoteMailboxName(null));
}
@Test
- public void testQuoteMailboxNoQuotingIfNoSpacePresent() {
+ void testQuoteMailboxNoQuotingIfNoSpacePresent() {
final String stringToQuote = "Foobar\"";
assertEquals(stringToQuote, IMAP.quoteMailboxName(stringToQuote));
}
@Test
- public void testTrueChunkListener() {
+ void testTrueChunkListener() {
assertTrue(IMAP.TRUE_CHUNK_LISTENER.chunkReceived(new IMAP()));
}
diff --git a/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java b/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
index 2cef0e54..06b91bdc 100644
--- a/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
+++ b/src/test/java/org/apache/commons/net/io/DotTerminatedMessageReaderTest.java
@@ -24,7 +24,7 @@ import java.io.StringReader;
import org.junit.jupiter.api.Test;
-public class DotTerminatedMessageReaderTest {
+class DotTerminatedMessageReaderTest {
private static final String CRLF = "\r\n";
private static final String DOT = ".";
@@ -34,7 +34,7 @@ public class DotTerminatedMessageReaderTest {
private final char[] buf = new char[64];
@Test
- public void testDoubleCrBeforeDot() throws IOException {
+ void testDoubleCrBeforeDot() throws IOException {
final String test = "Hello World!\r" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -47,7 +47,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testEmbeddedDot1() throws IOException {
+ void testEmbeddedDot1() throws IOException {
final String test = "Hello . World!" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -60,7 +60,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testEmbeddedDot2() throws IOException {
+ void testEmbeddedDot2() throws IOException {
final String test = "Hello .. World!" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -73,7 +73,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testEmbeddedDot3() throws IOException {
+ void testEmbeddedDot3() throws IOException {
final String test = "Hello World." + CRLF + "more" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -86,7 +86,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testEmbeddedDot4() throws IOException {
+ void testEmbeddedDot4() throws IOException {
final String test = "Hello World\r.\nmore" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -99,7 +99,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testEmbeddedNewlines() throws IOException {
+ void testEmbeddedNewlines() throws IOException {
final String test = "Hello" + CRLF + "World\nA\rB" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -112,7 +112,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testLeadingDot() throws IOException {
+ void testLeadingDot() throws IOException {
final String test = "Hello World!" + CRLF + "..text" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -125,7 +125,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testReadLine1() throws Exception {
+ void testReadLine1() throws Exception {
final String test = "Hello World" + CRLF + "more" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -140,7 +140,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testReadLine2() throws Exception {
+ void testReadLine2() throws Exception {
final String test = "Hello World\r.\nmore" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -155,7 +155,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testReadSimpleStringCrLfLineEnding() throws IOException {
+ void testReadSimpleStringCrLfLineEnding() throws IOException {
final String test = "Hello World!" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -168,7 +168,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testReadSimpleStringLfLineEnding() throws IOException {
+ void testReadSimpleStringLfLineEnding() throws IOException {
final String test = "Hello World!" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
@@ -181,7 +181,7 @@ public class DotTerminatedMessageReaderTest {
}
@Test
- public void testSingleDotWithTrailingText() throws IOException {
+ void testSingleDotWithTrailingText() throws IOException {
final String test = "Hello World!" + CRLF + ".text" + EOM;
reader = new DotTerminatedMessageReader(new StringReader(test));
diff --git a/src/test/java/org/apache/commons/net/io/ToNetASCIIInputStreamTest.java b/src/test/java/org/apache/commons/net/io/ToNetASCIIInputStreamTest.java
index 2e30ab0c..0ed81a40 100644
--- a/src/test/java/org/apache/commons/net/io/ToNetASCIIInputStreamTest.java
+++ b/src/test/java/org/apache/commons/net/io/ToNetASCIIInputStreamTest.java
@@ -26,7 +26,7 @@ import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Test;
-public class ToNetASCIIInputStreamTest {
+class ToNetASCIIInputStreamTest {
private void byteTest(final boolean byByte, final String input, final String expect) throws IOException {
final byte[] data = input.getBytes(StandardCharsets.US_ASCII);
@@ -66,7 +66,7 @@ public class ToNetASCIIInputStreamTest {
}
@Test
- public void testToNetASCIIInputStream_single_bytes() throws Exception {
+ void testToNetASCIIInputStream_single_bytes() throws Exception {
byteTest(true, "", "");
byteTest(true, "\r", "\r");
byteTest(true, "\n", "\r\n");
@@ -79,7 +79,7 @@ public class ToNetASCIIInputStreamTest {
}
@Test
- public void testToNetASCIIInputStream1() throws Exception {
+ void testToNetASCIIInputStream1() throws Exception {
byteTest(false, "", "");
byteTest(false, "\r", "\r");
byteTest(false, "a", "a");
diff --git a/src/test/java/org/apache/commons/net/nntp/TestThreader.java b/src/test/java/org/apache/commons/net/nntp/TestThreader.java
index 9fa494cf..169261cf 100644
--- a/src/test/java/org/apache/commons/net/nntp/TestThreader.java
+++ b/src/test/java/org/apache/commons/net/nntp/TestThreader.java
@@ -27,20 +27,20 @@ import org.junit.jupiter.api.Test;
/**
* Test the Threader
*/
-public class TestThreader {
+class TestThreader {
private static final Threadable[] EMPTY_THREADABLE_ARRAY = {};
@SuppressWarnings("deprecation") // test of deprecated method
@Test
- public void testEmptyArray() { // NET-539
+ void testEmptyArray() { // NET-539
final Threader t = new Threader();
final Threadable[] messages = EMPTY_THREADABLE_ARRAY;
assertNull(t.thread(messages));
}
@Test
- public void testEmptyIterable() { // NET-539
+ void testEmptyIterable() { // NET-539
final Threader t = new Threader();
final Threadable[] messages = EMPTY_THREADABLE_ARRAY;
final Iterable<Threadable> asList = Arrays.asList(messages);
@@ -48,7 +48,7 @@ public class TestThreader {
}
@Test
- public void testEmptyList() { // NET-539
+ void testEmptyList() { // NET-539
final Threader t = new Threader();
final Threadable[] messages = EMPTY_THREADABLE_ARRAY;
final List<Threadable> asList = Arrays.asList(messages);
@@ -57,21 +57,21 @@ public class TestThreader {
@Test
@SuppressWarnings("deprecation") // test of deprecated method
- public void testNullArray() { // NET-539
+ void testNullArray() { // NET-539
final Threader t = new Threader();
final Threadable[] messages = null;
assertNull(t.thread(messages));
}
@Test
- public void testNullIterable() {
+ void testNullIterable() {
final Threader t = new Threader();
final Iterable<Threadable> messages = null;
assertNull(t.thread(messages));
}
@Test
- public void testNullList() {
+ void testNullList() {
final Threader t = new Threader();
final List<Threadable> messages = null;
assertNull(t.thread(messages));
diff --git a/src/test/java/org/apache/commons/net/ntp/TestNtpClient.java b/src/test/java/org/apache/commons/net/ntp/TestNtpClient.java
index 339e68a5..ed061b37 100644
--- a/src/test/java/org/apache/commons/net/ntp/TestNtpClient.java
+++ b/src/test/java/org/apache/commons/net/ntp/TestNtpClient.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for NtpClient using SimpleNTPServer
*/
-public class TestNtpClient {
+class TestNtpClient {
private static SimpleNTPServer server;
@@ -73,7 +73,7 @@ public class TestNtpClient {
}
@Test
- public void testGetTime() throws IOException {
+ void testGetTime() throws IOException {
final long currentTimeMillis = System.currentTimeMillis();
final NTPUDPClient client = new NTPUDPClient();
// timeout if response takes longer than 2 seconds
diff --git a/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java b/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
index 38f28d01..6d7c6bf0 100644
--- a/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
+++ b/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
@@ -26,7 +26,7 @@ import java.net.DatagramPacket;
import org.junit.jupiter.api.Test;
-public class TestNtpPacket {
+class TestNtpPacket {
// pre-canned NTP packet
// [version:3, mode:4, poll:4, refId=0x81531472, precision:-17, delay:100, dispersion(ms):51.605224609375,
@@ -43,7 +43,7 @@ public class TestNtpPacket {
}
@Test
- public void testCreate() {
+ void testCreate() {
final NtpV3Packet message = new NtpV3Impl();
message.setLeapIndicator(0); // byte 0 [bit numbers 7-6]
message.setVersion(NtpV3Packet.VERSION_3); // byte 0 [bit numbers 5-4]
@@ -85,7 +85,7 @@ public class TestNtpPacket {
}
@Test
- public void testCreateAndSetByte0() {
+ void testCreateAndSetByte0() {
// LI + VN + Mode all part of first byte -- make sure set order does not matter
final NtpV3Packet message = new NtpV3Impl();
@@ -139,14 +139,14 @@ public class TestNtpPacket {
}
@Test
- public void testCreateFromBadPacket() {
+ void testCreateFromBadPacket() {
final NtpV3Packet message = new NtpV3Impl();
final DatagramPacket dp = new DatagramPacket(ntpPacket, ntpPacket.length - 4); // drop 4-bytes from packet
assertThrows(IllegalArgumentException.class, () -> message.setDatagramPacket(dp));
}
@Test
- public void testCreateFromBytes() {
+ void testCreateFromBytes() {
final NtpV3Packet message = new NtpV3Impl();
final DatagramPacket dp = new DatagramPacket(ntpPacket, ntpPacket.length);
message.setDatagramPacket(dp);
@@ -154,13 +154,13 @@ public class TestNtpPacket {
}
@Test
- public void testCreateFromNullPacket() {
+ void testCreateFromNullPacket() {
final NtpV3Packet message = new NtpV3Impl();
assertThrows(IllegalArgumentException.class, () -> message.setDatagramPacket(null));
}
@Test
- public void testCreateNtpV4() {
+ void testCreateNtpV4() {
final NtpV3Packet message = new NtpV3Impl();
message.setVersion(NtpV3Packet.VERSION_4);
message.setStratum(3);
@@ -179,7 +179,7 @@ public class TestNtpPacket {
}
@Test
- public void testEquals() {
+ void testEquals() {
final NtpV3Packet message1 = new NtpV3Impl();
final DatagramPacket dp = new DatagramPacket(ntpPacket, ntpPacket.length);
message1.setDatagramPacket(dp);
diff --git a/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java b/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
index aa0a4121..e3b3711d 100644
--- a/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
+++ b/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
@@ -31,10 +31,10 @@ import java.util.List;
import org.junit.jupiter.api.Test;
-public class TestTimeInfo {
+class TestTimeInfo {
@Test
- public void testAddress() throws UnknownHostException {
+ void testAddress() throws UnknownHostException {
final NtpV3Packet packet = new NtpV3Impl();
final TimeInfo info = new TimeInfo(packet, System.currentTimeMillis());
assertNull(info.getAddress());
@@ -43,7 +43,7 @@ public class TestTimeInfo {
}
@Test
- public void testComputeDetails() {
+ void testComputeDetails() {
// if (origTime > returnTime) // assert destTime >= origTime
final NtpV3Packet packet = new NtpV3Impl();
final long returnTimeMillis = System.currentTimeMillis();
@@ -77,7 +77,7 @@ public class TestTimeInfo {
}
@Test
- public void testEquals() {
+ void testEquals() {
final NtpV3Packet packet = new NtpV3Impl();
final long returnTime = System.currentTimeMillis();
final TimeInfo info = new TimeInfo(packet, returnTime);
@@ -94,13 +94,13 @@ public class TestTimeInfo {
}
@Test
- public void testException() {
+ void testException() {
final NtpV3Packet packet = null;
assertThrows(IllegalArgumentException.class, () -> new TimeInfo(packet, 1L));
}
@Test
- public void testNotEquals() {
+ void testNotEquals() {
final NtpV3Packet packet = new NtpV3Impl();
final long returnTime = System.currentTimeMillis();
final TimeInfo info = new TimeInfo(packet, returnTime);
@@ -127,7 +127,7 @@ public class TestTimeInfo {
}
@Test
- public void testZeroTime() {
+ void testZeroTime() {
final NtpV3Packet packet = new NtpV3Impl();
final TimeInfo info = new TimeInfo(packet, 0);
info.computeDetails();
diff --git a/src/test/java/org/apache/commons/net/ntp/TimeStampTest.java b/src/test/java/org/apache/commons/net/ntp/TimeStampTest.java
index 9ce5008c..7b0cc673 100644
--- a/src/test/java/org/apache/commons/net/ntp/TimeStampTest.java
+++ b/src/test/java/org/apache/commons/net/ntp/TimeStampTest.java
@@ -30,14 +30,14 @@ import org.junit.jupiter.api.Test;
/**
* Test class that validates assertions for the basic TimeStamp operations and comparisons.
*/
-public class TimeStampTest {
+class TimeStampTest {
private static final String TIME1 = "c1a9ae1c.cf6ac48d"; // Tue, Dec 17 2002 14:07:24.810 UTC
private static final String TIME2 = "c1a9ae1c.cf6ac48f"; // Tue, Dec 17 2002 14:07:24.810 UTC
private static final String TIME3 = "c1a9ae1d.cf6ac48e"; // Tue, Dec 17 2002 14:07:25.810 UTC
@Test
- public void testCompare() {
+ void testCompare() {
final TimeStamp ts1 = new TimeStamp(TIME1); // Tue, Dec 17 2002 14:07:24.810 UTC
final TimeStamp ts2 = new TimeStamp(TIME1);
@@ -69,7 +69,7 @@ public class TimeStampTest {
}
@Test
- public void testDateConversion() {
+ void testDateConversion() {
// convert current date to NtpTimeStamp then compare Java date
// computed from NTP timestamp with original Java date.
final Calendar refCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
@@ -81,7 +81,7 @@ public class TimeStampTest {
}
@Test
- public void testNotSame() {
+ void testNotSame() {
final TimeStamp time = TimeStamp.getCurrentTime();
Object other = Integer.valueOf(0);
if (time.equals(other)) {
@@ -94,7 +94,7 @@ public class TimeStampTest {
}
@Test
- public void testUTCString() {
+ void testUTCString() {
final TimeStamp ts1 = new TimeStamp(TIME1); // Tue, Dec 17 2002 14:07:24.810 UTC
final String actual = ts1.toUTCString();
assertEquals("Tue, Dec 17 2002 14:07:24.810 UTC", actual);
diff --git a/src/test/java/org/apache/commons/net/pop3/POP3ClientCommandsTest.java b/src/test/java/org/apache/commons/net/pop3/POP3ClientCommandsTest.java
index 1cc8f767..eadf8f28 100644
--- a/src/test/java/org/apache/commons/net/pop3/POP3ClientCommandsTest.java
+++ b/src/test/java/org/apache/commons/net/pop3/POP3ClientCommandsTest.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.Test;
* The tests were originally run on a default installation of James. Your mileage may vary based on the POP3 server you run the tests against. Some servers are
* more standards-compliant than others.
*/
-public class POP3ClientCommandsTest {
+class POP3ClientCommandsTest {
POP3Client pop3Client;
String user = POP3Constants.user;
@@ -69,7 +69,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testDelete() throws Exception {
+ void testDelete() throws Exception {
reset();
connect();
login();
@@ -99,7 +99,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testDeleteWithReset() throws Exception {
+ void testDeleteWithReset() throws Exception {
reset();
connect();
login();
@@ -132,7 +132,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListMessageOnEmptyMailbox() throws Exception {
+ void testListMessageOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -143,7 +143,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListMessageOnFullMailbox() throws Exception {
+ void testListMessageOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -174,7 +174,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListMessagesOnEmptyMailbox() throws Exception {
+ void testListMessagesOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -189,7 +189,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListMessagesOnFullMailbox() throws Exception {
+ void testListMessagesOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -211,7 +211,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListUniqueIdentifierOnEmptyMailbox() throws Exception {
+ void testListUniqueIdentifierOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -222,7 +222,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListUniqueIDOnFullMailbox() throws Exception {
+ void testListUniqueIDOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -252,7 +252,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListUniqueIDsOnEmptyMailbox() throws Exception {
+ void testListUniqueIDsOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -267,7 +267,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testListUniqueIDsOnFullMailbox() throws Exception {
+ void testListUniqueIDsOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -288,7 +288,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testNoopCommand() throws Exception {
+ void testNoopCommand() throws Exception {
reset();
connect();
@@ -305,7 +305,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testResetAndDeleteShouldFails() throws Exception {
+ void testResetAndDeleteShouldFails() throws Exception {
reset();
connect();
login();
@@ -317,7 +317,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageOnEmptyMailbox() throws Exception {
+ void testRetrieveMessageOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -325,7 +325,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageOnFullMailbox() throws Exception {
+ void testRetrieveMessageOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -365,7 +365,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageShouldFails() throws Exception {
+ void testRetrieveMessageShouldFails() throws Exception {
reset();
connect();
login();
@@ -385,7 +385,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageTopOnEmptyMailbox() throws Exception {
+ void testRetrieveMessageTopOnEmptyMailbox() throws Exception {
reset();
connect();
assertTrue(pop3Client.login(emptyUser, password));
@@ -393,7 +393,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageTopOnFullMailbox() throws Exception {
+ void testRetrieveMessageTopOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -410,7 +410,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveMessageTopShouldFails() throws Exception {
+ void testRetrieveMessageTopShouldFails() throws Exception {
reset();
connect();
login();
@@ -430,7 +430,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testRetrieveOverSizedMessageTopOnFullMailbox() throws Exception {
+ void testRetrieveOverSizedMessageTopOnFullMailbox() throws Exception {
reset();
connect();
login();
@@ -467,7 +467,7 @@ public class POP3ClientCommandsTest {
}
@Test
- public void testStatus() throws Exception {
+ void testStatus() throws Exception {
reset();
connect();
diff --git a/src/test/java/org/apache/commons/net/pop3/POP3ClientTest.java b/src/test/java/org/apache/commons/net/pop3/POP3ClientTest.java
index 004fdab9..5abe3c38 100644
--- a/src/test/java/org/apache/commons/net/pop3/POP3ClientTest.java
+++ b/src/test/java/org/apache/commons/net/pop3/POP3ClientTest.java
@@ -35,7 +35,7 @@ import org.junit.jupiter.api.Test;
* The tests were originally run on a default installation of James. Your mileage may vary based on the POP3 server you run the tests against. Some servers are
* more standards-compliant than others.
*/
-public class POP3ClientTest {
+class POP3ClientTest {
POP3Client p;
String user = POP3Constants.user;
@@ -66,7 +66,7 @@ public class POP3ClientTest {
}
@Test
- public void testInvalidLoginWithBadName() throws Exception {
+ void testInvalidLoginWithBadName() throws Exception {
reset();
connect();
@@ -75,7 +75,7 @@ public class POP3ClientTest {
}
@Test
- public void testInvalidLoginWithBadPassword() throws Exception {
+ void testInvalidLoginWithBadPassword() throws Exception {
reset();
connect();
@@ -87,7 +87,7 @@ public class POP3ClientTest {
* Test to try to run the login method from the disconnected, transaction and update states
*/
@Test
- public void testLoginFromWrongState() throws Exception {
+ void testLoginFromWrongState() throws Exception {
reset();
// Not currently connected, not in authorization state
@@ -108,7 +108,7 @@ public class POP3ClientTest {
}
@Test
- public void testLogoutFromAllStates() throws Exception {
+ void testLogoutFromAllStates() throws Exception {
// From 'transaction' state
reset();
connect();
@@ -128,7 +128,7 @@ public class POP3ClientTest {
* Simple test to logon to a valid server using a valid user name and password.
*/
@Test
- public void testValidLoginWithNameAndPassword() throws Exception {
+ void testValidLoginWithNameAndPassword() throws Exception {
reset();
connect();
diff --git a/src/test/java/org/apache/commons/net/pop3/POP3ConstructorTest.java b/src/test/java/org/apache/commons/net/pop3/POP3ConstructorTest.java
index 93f954aa..7de556ba 100644
--- a/src/test/java/org/apache/commons/net/pop3/POP3ConstructorTest.java
+++ b/src/test/java/org/apache/commons/net/pop3/POP3ConstructorTest.java
@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
* The tests were originally run on a default installation of James. Your mileage may vary based on the POP3 server you run the tests against. Some servers are
* more standards-compliant than others.
*/
-public class POP3ConstructorTest {
+class POP3ConstructorTest {
String user = POP3Constants.user;
String emptyUser = POP3Constants.emptyuser;
String password = POP3Constants.password;
@@ -44,7 +44,7 @@ public class POP3ConstructorTest {
* test will have to be updated.
*/
@Test
- public void testConstants() {
+ void testConstants() {
// From POP3
assertEquals(110, POP3.DEFAULT_PORT);
assertEquals(-1, POP3.DISCONNECTED_STATE);
@@ -68,7 +68,7 @@ public class POP3ConstructorTest {
}
@Test
- public void testPOP3ClientStateTransition() throws Exception {
+ void testPOP3ClientStateTransition() throws Exception {
final POP3Client pop = new POP3Client();
// Initial state
@@ -141,7 +141,7 @@ public class POP3ConstructorTest {
}
@Test
- public void testPOP3DefaultConstructor() {
+ void testPOP3DefaultConstructor() {
final POP3 pop = new POP3();
assertEquals(110, pop.getDefaultPort());
diff --git a/src/test/java/org/apache/commons/net/smtp/SimpleSMTPHeaderTestCase.java b/src/test/java/org/apache/commons/net/smtp/SimpleSMTPHeaderTestCase.java
index de1163d7..098218b3 100644
--- a/src/test/java/org/apache/commons/net/smtp/SimpleSMTPHeaderTestCase.java
+++ b/src/test/java/org/apache/commons/net/smtp/SimpleSMTPHeaderTestCase.java
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link SimpleSMTPHeader}.
*/
-public class SimpleSMTPHeaderTestCase {
+class SimpleSMTPHeaderTestCase {
private Date beforeDate;
@@ -80,14 +80,14 @@ public class SimpleSMTPHeaderTestCase {
}
@Test
- public void testToString() {
+ void testToString() {
// Note that the DotTerminatedMessageWriter converts LF to CRLF
final SimpleSMTPHeader header = new SimpleSMTPHeader("from@here.invalid", "to@there.invalid", "Test email");
assertEquals("From: from@here.invalid\nTo: to@there.invalid\nSubject: Test email\n\n", checkDate(header.toString()));
}
@Test
- public void testToStringAddHeader() {
+ void testToStringAddHeader() {
final SimpleSMTPHeader header = new SimpleSMTPHeader("from@here.invalid", null, null);
assertNotNull(header);
header.addHeaderField("X-Header1", "value 1");
@@ -97,7 +97,7 @@ public class SimpleSMTPHeaderTestCase {
}
@Test
- public void testToStringAddHeaderDate() {
+ void testToStringAddHeaderDate() {
final SimpleSMTPHeader header = new SimpleSMTPHeader("from@here.invalid", null, null);
assertNotNull(header);
header.addHeaderField("Date", "dummy date");
@@ -106,12 +106,12 @@ public class SimpleSMTPHeaderTestCase {
}
@Test
- public void testToStringNoFrom() {
+ void testToStringNoFrom() {
assertThrows(IllegalArgumentException.class, () -> new SimpleSMTPHeader(null, null, null));
}
@Test
- public void testToStringNoSubject() {
+ void testToStringNoSubject() {
final SimpleSMTPHeader header = new SimpleSMTPHeader("from@here.invalid", "to@there.invalid", null);
assertNotNull(header);
// Note that the DotTerminatedMessageWriter converts LF to CRLF
@@ -119,7 +119,7 @@ public class SimpleSMTPHeaderTestCase {
}
@Test
- public void testToStringNoTo() {
+ void testToStringNoTo() {
final SimpleSMTPHeader header = new SimpleSMTPHeader("from@here.invalid", null, null);
assertNotNull(header);
// Note that the DotTerminatedMessageWriter converts LF to CRLF
diff --git a/src/test/java/org/apache/commons/net/telnet/AbstractTelnetOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/AbstractTelnetOptionHandlerTest.java
index 49989553..f5898d4c 100644
--- a/src/test/java/org/apache/commons/net/telnet/AbstractTelnetOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/AbstractTelnetOptionHandlerTest.java
@@ -33,7 +33,7 @@ public abstract class AbstractTelnetOptionHandlerTest {
/**
* test of the constructors. The derived class may add test of the option code.
*/
- public void testConstructors() {
+ void testConstructors() {
// add test of the option code
assertFalse(opthand1.getInitLocal());
assertFalse(opthand1.getInitRemote());
@@ -55,7 +55,7 @@ public abstract class AbstractTelnetOptionHandlerTest {
* test of setDo/getDo
*/
@Test
- public void testDo() {
+ void testDo() {
opthand2.setDo(true);
opthand3.setDo(false);
@@ -68,7 +68,7 @@ public abstract class AbstractTelnetOptionHandlerTest {
* test of setWill/getWill
*/
@Test
- public void testWill() {
+ void testWill() {
opthand2.setWill(true);
opthand3.setWill(false);
diff --git a/src/test/java/org/apache/commons/net/telnet/EchoOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/EchoOptionHandlerTest.java
index 265219a4..997b90ab 100644
--- a/src/test/java/org/apache/commons/net/telnet/EchoOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/EchoOptionHandlerTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for EchoOptionHandler
*/
-public class EchoOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
+class EchoOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
/**
* setUp for the test.
@@ -41,7 +41,7 @@ public class EchoOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
* test of server-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testAnswerSubnegotiation() {
+ void testAnswerSubnegotiation() {
final int[] subn = { TelnetCommand.IAC, TelnetCommand.SB, TelnetOption.ECHO, 1, TelnetCommand.IAC, TelnetCommand.SE, };
final int[] resp1 = opthand1.answerSubnegotiation(subn, subn.length);
@@ -54,7 +54,7 @@ public class EchoOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
*/
@Override
@Test
- public void testConstructors() {
+ void testConstructors() {
assertEquals(TelnetOption.ECHO, opthand1.getOptionCode());
super.testConstructors();
}
@@ -63,7 +63,7 @@ public class EchoOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
* test of client-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testStartSubnegotiation() {
+ void testStartSubnegotiation() {
final int[] resp1 = opthand1.startSubnegotiationLocal();
final int[] resp2 = opthand1.startSubnegotiationRemote();
diff --git a/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java b/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
index 3f9e9a52..897cc5a5 100644
--- a/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/InvalidTelnetOptionExceptionTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for InvalidTelnetOptionException
*/
-public class InvalidTelnetOptionExceptionTest {
+class InvalidTelnetOptionExceptionTest {
private InvalidTelnetOptionException exc1;
private String msg1;
private int code1;
@@ -43,7 +43,7 @@ public class InvalidTelnetOptionExceptionTest {
* test of the constructors.
*/
@Test
- public void testConstructors() {
+ void testConstructors() {
assertTrue(exc1.getMessage().contains(msg1));
assertTrue(exc1.getMessage().contains("" + code1));
}
diff --git a/src/test/java/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java
index 8c418212..9291f2e6 100644
--- a/src/test/java/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/SimpleOptionHandlerTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for SimpleOptionHandler
*/
-public class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
+class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
/**
* setUp for the test.
@@ -41,7 +41,7 @@ public class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
* test of server-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testAnswerSubnegotiation() {
+ void testAnswerSubnegotiation() {
final int[] subn = { TelnetCommand.IAC, TelnetCommand.SB, 4, 1, TelnetCommand.IAC, TelnetCommand.SE, };
final int[] resp1 = opthand1.answerSubnegotiation(subn, subn.length);
@@ -54,7 +54,7 @@ public class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
*/
@Override
@Test
- public void testConstructors() {
+ void testConstructors() {
assertEquals(4, opthand1.getOptionCode());
assertEquals(8, opthand2.getOptionCode());
assertEquals(91, opthand3.getOptionCode());
@@ -65,7 +65,7 @@ public class SimpleOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
* test of client-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testStartSubnegotiation() {
+ void testStartSubnegotiation() {
final int[] resp1 = opthand1.startSubnegotiationLocal();
final int[] resp2 = opthand1.startSubnegotiationRemote();
diff --git a/src/test/java/org/apache/commons/net/telnet/SuppressGAOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/SuppressGAOptionHandlerTest.java
index 4c1ed6a6..acf8f89e 100644
--- a/src/test/java/org/apache/commons/net/telnet/SuppressGAOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/SuppressGAOptionHandlerTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for SuppressGAOptionHandler
*/
-public class SuppressGAOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
+class SuppressGAOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
/**
* setUp for the test.
@@ -41,7 +41,7 @@ public class SuppressGAOptionHandlerTest extends AbstractTelnetOptionHandlerTest
* test of server-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testAnswerSubnegotiation() {
+ void testAnswerSubnegotiation() {
final int[] subn = { TelnetCommand.IAC, TelnetCommand.SB, TelnetOption.SUPPRESS_GO_AHEAD, 1, TelnetCommand.IAC, TelnetCommand.SE, };
final int[] resp1 = opthand1.answerSubnegotiation(subn, subn.length);
@@ -54,7 +54,7 @@ public class SuppressGAOptionHandlerTest extends AbstractTelnetOptionHandlerTest
*/
@Override
@Test
- public void testConstructors() {
+ void testConstructors() {
assertEquals(TelnetOption.SUPPRESS_GO_AHEAD, opthand1.getOptionCode());
super.testConstructors();
}
@@ -63,7 +63,7 @@ public class SuppressGAOptionHandlerTest extends AbstractTelnetOptionHandlerTest
* test of client-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testStartSubnegotiation() {
+ void testStartSubnegotiation() {
final int[] resp1 = opthand1.startSubnegotiationLocal();
final int[] resp2 = opthand1.startSubnegotiationRemote();
diff --git a/src/test/java/org/apache/commons/net/telnet/TelnetClientFunctionalTest.java b/src/test/java/org/apache/commons/net/telnet/TelnetClientFunctionalTest.java
index cd019c74..4faee3f5 100644
--- a/src/test/java/org/apache/commons/net/telnet/TelnetClientFunctionalTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/TelnetClientFunctionalTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit functional test for TelnetClient. Connects to the weather forecast service rainmaker.wunderground.com and asks for Los Angeles forecast.
*/
-public class TelnetClientFunctionalTest {
+class TelnetClientFunctionalTest {
protected TelnetClient tc1;
/**
@@ -42,7 +42,7 @@ public class TelnetClientFunctionalTest {
* Do the functional test: - connect to the weather service - press return on the first menu - send LAX on the second menu - send X to exit
*/
@Test
- public void testFunctionalTest() throws Exception {
+ void testFunctionalTest() throws Exception {
boolean testresult = false;
tc1.connect("rainmaker.wunderground.com", 3000);
diff --git a/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java b/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
index e847561f..7a2094fe 100644
--- a/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for TelnetClient.s Implements protocol compliance tests
*/
-public class TelnetClientTest implements TelnetNotificationHandler {
+class TelnetClientTest implements TelnetNotificationHandler {
/**
* Handy holder to hold both sides of the connection used in testing for clarity.
@@ -223,7 +223,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* test of AYT functionality
*/
@Test
- public void testAYT() throws Exception {
+ void testAYT() throws Exception {
boolean aytTrueOk = false;
boolean aytFalseOk = false;
@@ -261,7 +261,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* protocol compliance test in case of option handler removal
*/
@Test
- public void testDeleteOptionHandler() throws Exception {
+ void testDeleteOptionHandler() throws Exception {
boolean removeOk = false;
boolean removeInvalidOk1 = false;
boolean removeInvalidOk2 = false;
@@ -315,7 +315,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* tests the initial condition of the sessions
*/
@Test
- public void testInitial() throws Exception {
+ void testInitial() throws Exception {
boolean connect1Ok = false;
boolean connect2Ok = false;
boolean connect3Ok = false;
@@ -381,7 +381,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* test of max subnegotiation length
*/
@Test
- public void testMaxSubnegotiationLength() throws Exception {
+ void testMaxSubnegotiationLength() throws Exception {
final byte[] send = { (byte) TelnetCommand.IAC, (byte) TelnetCommand.SB, (byte) 99, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6,
(byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) 12, (byte) 13, (byte) 14, (byte) 15, (byte) TelnetCommand.IAC,
(byte) TelnetCommand.SE, };
@@ -425,7 +425,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* test of option negotiation notification
*/
@Test
- public void testNotification() throws Exception {
+ void testNotification() throws Exception {
final byte[] buffread1 = new byte[6];
final byte[] send1 = { (byte) TelnetCommand.IAC, (byte) TelnetCommand.DO, (byte) 15, (byte) TelnetCommand.IAC, (byte) TelnetCommand.WILL, (byte) 15, };
@@ -477,7 +477,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* protocol compliance test for option negotiation
*/
@Test
- public void testOptionNegotiation() throws Exception {
+ void testOptionNegotiation() throws Exception {
boolean negotiation1Ok = false;
final byte[] buffread1 = new byte[6];
final byte[] send1 = { (byte) TelnetCommand.IAC, (byte) TelnetCommand.DO, (byte) 15, (byte) TelnetCommand.IAC, (byte) TelnetCommand.WILL, (byte) 15, };
@@ -601,7 +601,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* protocol compliance test for option renegotiation
*/
@Test
- public void testOptionRenegotiation() throws Exception {
+ void testOptionRenegotiation() throws Exception {
boolean negotiation1Ok = false;
final byte[] buffread = new byte[6];
@@ -650,7 +650,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* test of setReaderThread
*/
@Test
- public void testSetReaderThread() throws Exception {
+ void testSetReaderThread() throws Exception {
boolean negotiation1Ok = false;
boolean negotiation2Ok = false;
boolean readOk = false;
@@ -726,7 +726,7 @@ public class TelnetClientTest implements TelnetNotificationHandler {
* test of Spy functionality
*/
@Test
- public void testSpy() throws Exception {
+ void testSpy() throws Exception {
boolean test1spyOk = false;
boolean test2spyOk = false;
boolean stopspyOk = false;
diff --git a/src/test/java/org/apache/commons/net/telnet/TelnetOptionTest.java b/src/test/java/org/apache/commons/net/telnet/TelnetOptionTest.java
index f7aa0abe..bb2c6ec7 100644
--- a/src/test/java/org/apache/commons/net/telnet/TelnetOptionTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/TelnetOptionTest.java
@@ -25,13 +25,13 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for TelnetOption
*/
-public class TelnetOptionTest {
+class TelnetOptionTest {
/**
* test of the getOption method.
*/
@Test
- public void testGetOption() {
+ void testGetOption() {
assertEquals("BINARY", TelnetOption.getOption(0));
assertEquals("UNASSIGNED", TelnetOption.getOption(91));
assertEquals("Extended-Options-List", TelnetOption.getOption(255));
@@ -41,7 +41,7 @@ public class TelnetOptionTest {
* test of the isValidOption method.
*/
@Test
- public void testisValidOption() {
+ void testisValidOption() {
assertTrue(TelnetOption.isValidOption(0));
assertTrue(TelnetOption.isValidOption(91));
assertTrue(TelnetOption.isValidOption(255));
diff --git a/src/test/java/org/apache/commons/net/telnet/TelnetTestResponder.java b/src/test/java/org/apache/commons/net/telnet/TelnetTestResponder.java
index 64abf1a1..23d29466 100644
--- a/src/test/java/org/apache/commons/net/telnet/TelnetTestResponder.java
+++ b/src/test/java/org/apache/commons/net/telnet/TelnetTestResponder.java
@@ -23,7 +23,7 @@ import java.io.OutputStream;
* Simple stream responder. Waits for strings on an input stream and answers sending corresponfing strings on an output stream. The reader runs in a separate
* thread.
*/
-public class TelnetTestResponder implements Runnable {
+class TelnetTestResponder implements Runnable {
InputStream in;
OutputStream out;
String inputs[];
diff --git a/src/test/java/org/apache/commons/net/telnet/TelnetTestSimpleServer.java b/src/test/java/org/apache/commons/net/telnet/TelnetTestSimpleServer.java
index 07d08fab..39c63c7b 100644
--- a/src/test/java/org/apache/commons/net/telnet/TelnetTestSimpleServer.java
+++ b/src/test/java/org/apache/commons/net/telnet/TelnetTestSimpleServer.java
@@ -27,7 +27,7 @@ import org.apache.commons.io.IOUtils;
/**
* Simple TCP server. Waits for connections on a TCP port in a separate thread.
*/
-public class TelnetTestSimpleServer implements Runnable {
+class TelnetTestSimpleServer implements Runnable {
ServerSocket serverSocket;
Socket clientSocket;
Thread listener;
diff --git a/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java
index 2515ea11..4e7d1651 100644
--- a/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java
@@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-public class TerminalTypeOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
+class TerminalTypeOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
/*
* compares two arrays of int
*/
@@ -52,7 +52,7 @@ public class TerminalTypeOptionHandlerTest extends AbstractTelnetOptionHandlerTe
* test of client-driven subnegotiation. Checks that the terminal type is sent
*/
@Test
- public void testAnswerSubnegotiation() {
+ void testAnswerSubnegotiation() {
final int[] subn = { TelnetOption.TERMINAL_TYPE, 1 };
final int[] expected1 = { TelnetOption.TERMINAL_TYPE, 0, 'V', 'T', '1', '0', '0' };
@@ -68,7 +68,7 @@ public class TerminalTypeOptionHandlerTest extends AbstractTelnetOptionHandlerTe
@Override
@Test
- public void testConstructors() {
+ void testConstructors() {
assertEquals(TelnetOption.TERMINAL_TYPE, opthand1.getOptionCode());
super.testConstructors();
}
@@ -77,7 +77,7 @@ public class TerminalTypeOptionHandlerTest extends AbstractTelnetOptionHandlerTe
* test of client-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testStartSubnegotiation() {
+ void testStartSubnegotiation() {
final int[] resp1 = opthand1.startSubnegotiationLocal();
final int[] resp2 = opthand1.startSubnegotiationRemote();
diff --git a/src/test/java/org/apache/commons/net/telnet/WindowSizeOptionHandlerTest.java b/src/test/java/org/apache/commons/net/telnet/WindowSizeOptionHandlerTest.java
index e7a08d8b..bdd9b858 100644
--- a/src/test/java/org/apache/commons/net/telnet/WindowSizeOptionHandlerTest.java
+++ b/src/test/java/org/apache/commons/net/telnet/WindowSizeOptionHandlerTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
/**
* JUnit test class for TerminalTypeOptionHandler
*/
-public class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
+class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest {
/**
* compares two arrays of int
@@ -51,7 +51,7 @@ public class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest
* test of client-driven subnegotiation. Checks that nothing is sent
*/
@Test
- public void testAnswerSubnegotiation() {
+ void testAnswerSubnegotiation() {
final int[] subn = { TelnetOption.WINDOW_SIZE, 24, 80 };
final int[] resp1 = opthand1.answerSubnegotiation(subn, subn.length);
@@ -68,7 +68,7 @@ public class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest
*/
@Override
@Test
- public void testConstructors() {
+ void testConstructors() {
assertEquals(TelnetOption.WINDOW_SIZE, opthand1.getOptionCode());
super.testConstructors();
}
@@ -77,7 +77,7 @@ public class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest
* test of client-driven subnegotiation. Checks that no subnegotiation is made.
*/
@Test
- public void testStartSubnegotiation() {
+ void testStartSubnegotiation() {
assertNull(opthand1.startSubnegotiationRemote());
assertNull(opthand2.startSubnegotiationRemote());
assertNull(opthand3.startSubnegotiationRemote());
@@ -87,7 +87,7 @@ public class WindowSizeOptionHandlerTest extends AbstractTelnetOptionHandlerTest
* test of client-driven subnegotiation.
*/
@Test
- public void testStartSubnegotiationLocal() {
+ void testStartSubnegotiationLocal() {
final int[] exp1 = { 31, 0, 80, 0, 24 };
final int[] start1 = opthand1.startSubnegotiationLocal();
assertEquals(5, start1.length);
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPAckPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPAckPacketTest.java
index b4267241..b4eaedd3 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPAckPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPAckPacketTest.java
@@ -27,15 +27,15 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPAckPacket}.
*/
-public class TFTPAckPacketTest {
+class TFTPAckPacketTest {
@Test
- public void testNewDatagram() throws UnknownHostException {
+ void testNewDatagram() throws UnknownHostException {
assertNotNull(new TFTPAckPacket(InetAddress.getLocalHost(), 0, 0).newDatagram());
}
@Test
- public void testToString() throws UnknownHostException {
+ void testToString() throws UnknownHostException {
assertNotNull(new TFTPAckPacket(InetAddress.getLocalHost(), 0, 0).toString());
}
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPDataPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPDataPacketTest.java
index a09bb0bf..76c758a3 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPDataPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPDataPacketTest.java
@@ -27,15 +27,15 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPDataPacket}.
*/
-public class TFTPDataPacketTest {
+class TFTPDataPacketTest {
@Test
- public void testNewDatagram() throws UnknownHostException {
+ void testNewDatagram() throws UnknownHostException {
assertNotNull(new TFTPDataPacket(InetAddress.getLocalHost(), 0, 0, new byte[0]).newDatagram());
}
@Test
- public void testToString() throws UnknownHostException {
+ void testToString() throws UnknownHostException {
assertNotNull(new TFTPDataPacket(InetAddress.getLocalHost(), 0, 0, new byte[0]).toString());
}
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPErrorPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPErrorPacketTest.java
index 3441fe95..6183cb7d 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPErrorPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPErrorPacketTest.java
@@ -27,15 +27,15 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPErrorPacket}.
*/
-public class TFTPErrorPacketTest {
+class TFTPErrorPacketTest {
@Test
- public void testNewDatagram() throws UnknownHostException {
+ void testNewDatagram() throws UnknownHostException {
assertNotNull(new TFTPErrorPacket(InetAddress.getLocalHost(), 0, 0, "").newDatagram());
}
@Test
- public void testToString() throws UnknownHostException {
+ void testToString() throws UnknownHostException {
assertNotNull(new TFTPErrorPacket(InetAddress.getLocalHost(), 0, 0, "").toString());
}
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPPacketExceptionTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPPacketExceptionTest.java
index f228ab04..0f98e3af 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPPacketExceptionTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPPacketExceptionTest.java
@@ -25,10 +25,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPPacketException}.
*/
-public class TFTPPacketExceptionTest {
+class TFTPPacketExceptionTest {
@Test
- public void testContructor() {
+ void testContructor() {
assertNull(new TFTPPacketException().getMessage());
assertEquals("A", new TFTPPacketException("A").getMessage());
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPReadRequestPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPReadRequestPacketTest.java
index 63665d9b..c41e7264 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPReadRequestPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPReadRequestPacketTest.java
@@ -27,10 +27,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPReadRequestPacket}.
*/
-public class TFTPReadRequestPacketTest {
+class TFTPReadRequestPacketTest {
@Test
- public void testToString() throws UnknownHostException {
+ void testToString() throws UnknownHostException {
assertNotNull(new TFTPReadRequestPacket(InetAddress.getLocalHost(), 0, "", 0).toString());
}
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPRequestPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPRequestPacketTest.java
index bbb94b48..15328642 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPRequestPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPRequestPacketTest.java
@@ -60,7 +60,7 @@ class TFTPRequestPacketTest {
}
@Test
- public void testGetOptions() throws UnknownHostException, TFTPPacketException {
+ void testGetOptions() throws UnknownHostException, TFTPPacketException {
final DatagramPacket datagramPacket = getDatagramPacket();
final TFTPReadRequestPacket requestPacket = new TFTPReadRequestPacket(datagramPacket);
assertNotNull(requestPacket.toString());
@@ -70,7 +70,7 @@ class TFTPRequestPacketTest {
}
@Test
- public void testNewDatagram() throws TFTPPacketException, UnknownHostException {
+ void testNewDatagram() throws TFTPPacketException, UnknownHostException {
final DatagramPacket datagramPacket = getDatagramPacket();
final TFTPReadRequestPacket requestPacket = new TFTPReadRequestPacket(datagramPacket);
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPServerPathTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPServerPathTest.java
index 14cf884e..b9dc4f91 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPServerPathTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPServerPathTest.java
@@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test;
* Basic tests to ensure that the TFTP Server is honoring its read/write mode, and preventing files from being read or written from outside of the assigned
* roots.
*/
-public class TFTPServerPathTest {
+class TFTPServerPathTest {
private static final int SERVER_PORT = 6901;
private static final String FILE_PREFIX = "TFTPServerPathTest_";
@@ -108,7 +108,7 @@ public class TFTPServerPathTest {
}
@Test
- public void testReadOnly() throws IOException {
+ void testReadOnly() throws IOException {
// Start a read-only server
tftpServer = startTftpServer(ServerMode.GET_ONLY);
final String serverAddress = "localhost";
@@ -139,7 +139,7 @@ public class TFTPServerPathTest {
}
@Test
- public void testWriteOnly() throws IOException {
+ void testWriteOnly() throws IOException {
// Start a write-only server
tftpServer = startTftpServer(ServerMode.PUT_ONLY);
final String serverAddress = "localhost";
@@ -165,7 +165,7 @@ public class TFTPServerPathTest {
}
@Test
- public void testWriteOutsideHome() throws IOException {
+ void testWriteOutsideHome() throws IOException {
// Start a read/write server
tftpServer = startTftpServer(ServerMode.GET_AND_PUT);
final String serverAddress = "localhost";
@@ -182,7 +182,7 @@ public class TFTPServerPathTest {
}
@Test
- public void testWriteVerifyContents() throws IOException {
+ void testWriteVerifyContents() throws IOException {
// Start a write-only server
tftpServer = startTftpServer(ServerMode.GET_AND_PUT);
final String serverAddress = "localhost";
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
index 26faa699..f73c22e9 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test;
/**
* Test the TFTP Server and TFTP Client by creating some FILES in the system temp folder and then uploading and downloading them.
*/
-public class TFTPTest {
+class TFTPTest {
private static final int SERVER_PORT = 6902;
private static TFTPServer tftpS;
private static final File SERVER_DIR = FileUtils.getTempDirectory();
@@ -100,7 +100,7 @@ public class TFTPTest {
}
@Test
- public void testASCIIDownloads() {
+ void testASCIIDownloads() {
// test with the smaller FILES
for (int i = 0; i < 6; i++) {
try {
@@ -113,7 +113,7 @@ public class TFTPTest {
}
@Test
- public void testASCIIUploads() throws Exception {
+ void testASCIIUploads() throws Exception {
// test with the smaller FILES
for (int i = 0; i < 6; i++) {
testUpload(TFTP.ASCII_MODE, FILES[i]);
@@ -121,7 +121,7 @@ public class TFTPTest {
}
@Test
- public void testDiscardPackets() throws IOException {
+ void testDiscardPackets() throws IOException {
try (TFTP tftp = new TFTP()) {
assertThrows(NullPointerException.class, tftp::discardPackets);
tftp.open();
@@ -154,13 +154,13 @@ public class TFTPTest {
}
@Test
- public void testGetModeName() {
+ void testGetModeName() {
assertNotNull(TFTP.getModeName(0));
assertNotNull(TFTP.getModeName(1));
}
@Test
- public void testHugeDownloads() throws Exception {
+ void testHugeDownloads() throws Exception {
// test with the smaller FILES
for (int i = 5; i < FILES.length; i++) {
testDownload(TFTP.BINARY_MODE, FILES[i]);
@@ -168,14 +168,14 @@ public class TFTPTest {
}
@Test
- public void testHugeUploads() throws Exception {
+ void testHugeUploads() throws Exception {
for (int i = 5; i < FILES.length; i++) {
testUpload(TFTP.BINARY_MODE, FILES[i]);
}
}
@Test
- public void testResizeBuffer() {
+ void testResizeBuffer() {
try (TFTPClient tftp = new TFTPClient()) {
final int bufferSize = 1024;
tftp.resetBuffersToSize(bufferSize);
@@ -184,7 +184,7 @@ public class TFTPTest {
}
@Test
- public void testSend() throws IOException {
+ void testSend() throws IOException {
try (TFTP tftp = new TFTP()) {
tftp.open();
tftp.send(new TFTPDataPacket(InetAddress.getLocalHost(), tftp.getLocalPort(), 0, new byte[10]));
@@ -192,7 +192,7 @@ public class TFTPTest {
}
@Test
- public void testTFTPBinaryDownloads() throws Exception {
+ void testTFTPBinaryDownloads() throws Exception {
// test with the smaller FILES
for (int i = 0; i < 6; i++) {
testDownload(TFTP.BINARY_MODE, FILES[i]);
@@ -200,7 +200,7 @@ public class TFTPTest {
}
@Test
- public void testTFTPBinaryUploads() throws Exception {
+ void testTFTPBinaryUploads() throws Exception {
// test with the smaller FILES
for (int i = 0; i < 6; i++) {
testUpload(TFTP.BINARY_MODE, FILES[i]);
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPWriteRequestPacketTest.java b/src/test/java/org/apache/commons/net/tftp/TFTPWriteRequestPacketTest.java
index 42902be1..50796719 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPWriteRequestPacketTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPWriteRequestPacketTest.java
@@ -27,10 +27,10 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TFTPReadRequestPacket}.
*/
-public class TFTPWriteRequestPacketTest {
+class TFTPWriteRequestPacketTest {
@Test
- public void testToString() throws UnknownHostException {
+ void testToString() throws UnknownHostException {
assertNotNull(new TFTPReadRequestPacket(InetAddress.getLocalHost(), 0, "", 0).toString());
}
diff --git a/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java b/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
index c905f76a..758828b9 100644
--- a/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
+++ b/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
@@ -27,7 +27,7 @@ import java.util.TimeZone;
import org.junit.jupiter.api.Test;
-public class TimeTCPClientTest {
+class TimeTCPClientTest {
private TimeTestSimpleServer server1;
private int _port = 3333; // default test port
@@ -58,7 +58,7 @@ public class TimeTCPClientTest {
* Tests the times retrieved via the Time protocol implementation.
*/
@Test
- public void testCompareTimes() throws Exception {
+ void testCompareTimes() throws Exception {
openConnections();
final long time;
@@ -108,7 +108,7 @@ public class TimeTCPClientTest {
* Tests the constant basetime used by TimeClient against tha computed from Calendar class.
*/
@Test
- public void testInitial() {
+ void testInitial() {
final TimeZone utcZone = TimeZone.getTimeZone("UTC");
final Calendar calendar = Calendar.getInstance(utcZone);
calendar.set(1900, Calendar.JANUARY, 1, 0, 0, 0);
diff --git a/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java b/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
index dc874ecf..8d6ca092 100644
--- a/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
+++ b/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
@@ -32,7 +32,7 @@ import org.apache.commons.io.IOUtils;
* <p>
* Note this is for <strong>debugging purposes only</strong> and not meant to be run as a realiable time service.
*/
-public class TimeTestSimpleServer implements Runnable {
+class TimeTestSimpleServer implements Runnable {
/**
* baseline time 1900-01-01T00:00:00 UTC
diff --git a/src/test/java/org/apache/commons/net/time/TimeUDPClientTest.java b/src/test/java/org/apache/commons/net/time/TimeUDPClientTest.java
index 02bae875..ca1b4420 100644
--- a/src/test/java/org/apache/commons/net/time/TimeUDPClientTest.java
+++ b/src/test/java/org/apache/commons/net/time/TimeUDPClientTest.java
@@ -27,17 +27,17 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TimeUDPClient}.
*/
-public class TimeUDPClientTest {
+class TimeUDPClientTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
try (TimeUDPClient client = new TimeUDPClient()) {
// empty
}
}
@Test
- public void testGetDate() {
+ void testGetDate() {
try (TimeUDPClient client = new TimeUDPClient()) {
// Not connected failures
assertThrows(NullPointerException.class, () -> client.getDate(InetAddress.getLocalHost()));
@@ -46,7 +46,7 @@ public class TimeUDPClientTest {
}
@Test
- public void testGetTime() {
+ void testGetTime() {
try (TimeUDPClient client = new TimeUDPClient()) {
// Not connected failures
assertThrows(NullPointerException.class, () -> client.getTime(InetAddress.getLocalHost()));
@@ -55,7 +55,7 @@ public class TimeUDPClientTest {
}
@Test
- public void testToTime() {
+ void testToTime() {
final byte[] timeData = new byte[4];
assertEquals(0, TimeUDPClient.toTime(timeData));
}
diff --git a/src/test/java/org/apache/commons/net/util/Base64Test.java b/src/test/java/org/apache/commons/net/util/Base64Test.java
index 14548f2e..62f47701 100644
--- a/src/test/java/org/apache/commons/net/util/Base64Test.java
+++ b/src/test/java/org/apache/commons/net/util/Base64Test.java
@@ -36,7 +36,7 @@ import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.Test;
@SuppressWarnings({ "deprecation" })
-public class Base64Test {
+class Base64Test {
private static String toString(final byte[] encodedData) {
return encodedData != null ? new String(encodedData, StandardCharsets.UTF_8) : null;
@@ -78,20 +78,20 @@ public class Base64Test {
}
@Test
- public void testBase64() {
+ void testBase64() {
final Base64 b64 = new Base64();
assertFalse(b64.isUrlSafe());
}
@Test
- public void testBase64Boolean() {
+ void testBase64Boolean() {
final Base64 b64 = new Base64(true);
assertTrue(b64.isUrlSafe());
assertArrayEquals(new byte[] {}, b64.getLineSeparator());
}
@Test
- public void testBase64Int() {
+ void testBase64Int() {
Base64 b64;
b64 = new Base64(8);
assertFalse(b64.isUrlSafe());
@@ -101,7 +101,7 @@ public class Base64Test {
}
@Test
- public void testBase64IntByteArray() {
+ void testBase64IntByteArray() {
final Base64 b64;
b64 = new Base64(8, new byte[] {});
assertFalse(b64.isUrlSafe());
@@ -121,7 +121,7 @@ public class Base64Test {
}
@Test
- public void testBase64IntByteArrayBoolean() {
+ void testBase64IntByteArrayBoolean() {
Base64 b64;
b64 = new Base64(8, new byte[] {}, false);
assertFalse(b64.isUrlSafe());
@@ -131,34 +131,34 @@ public class Base64Test {
}
@Test
- public void testDecodeBase64ByteArray() {
+ void testDecodeBase64ByteArray() {
checkDecoders("light w", new byte[] { 'b', 'G', 'l', 'n', 'a', 'H', 'Q', 'g', 'd', 'w', '=', '=' });
}
@Test
- public void testDecodeBase64String() {
+ void testDecodeBase64String() {
checkDecoders("light w", "bGlnaHQgdw==");
}
@Test
- public void testDecodeByteArray() {
+ void testDecodeByteArray() {
checkDecoders("foobar", new byte[] { 'Z', 'm', '9', 'v', 'Y', 'm', 'F', 'y' });
}
@Test
- public void testDecodeByteArrayEmpty() {
+ void testDecodeByteArrayEmpty() {
checkDecoders("", new byte[] {});
checkDecoders(null, (byte[]) null);
}
@Test
- public void testDecodeByteArrayNull() {
+ void testDecodeByteArrayNull() {
assertNull(new Base64().decode((byte[]) null));
}
@Test
- public void testDecodeInteger() {
+ void testDecodeInteger() {
testDecodeInteger(BigInteger.ONE);
testDecodeInteger(BigInteger.TEN);
testDecodeInteger(BigInteger.ZERO);
@@ -169,18 +169,18 @@ public class Base64Test {
}
@Test
- public void testDecodeNullString() {
+ void testDecodeNullString() {
final Base64 base64 = new Base64();
assertThrows(NullPointerException.class, () -> base64.decode((String) null));
}
@Test
- public void testDecodeString() {
+ void testDecodeString() {
checkDecoders("Hello World!", "SGVsbG8gV29ybGQh");
}
@Test
- public void testEncodeBase64ByteArrayBoolean() {
+ void testEncodeBase64ByteArrayBoolean() {
final byte[] binaryData = { '1', '2', '3' };
final byte[] urlUnsafeData = "<<???>>".getBytes();
final byte[] urlUnsafeDataChunky = "<<???>><<???>><<???>><<???>><<???>><<???>><<???>><<???>><<???>><<???>><<???>>".getBytes();
@@ -230,7 +230,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64ByteArrayBooleanBoolean() {
+ void testEncodeBase64ByteArrayBooleanBoolean() {
final byte[] binaryData = { '1', '2', '3' };
byte[] encoded;
encoded = Base64.encodeBase64(binaryData, false, false);
@@ -248,7 +248,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64ByteArrayBooleanBooleanInt() {
+ void testEncodeBase64ByteArrayBooleanBooleanInt() {
final byte[] binaryData = { '1', '2', '3' };
byte[] encoded;
encoded = Base64.encodeBase64(binaryData, false, false);
@@ -268,7 +268,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64ByteArrayEdges() {
+ void testEncodeBase64ByteArrayEdges() {
final byte[] binaryData = null;
assertArrayEquals(binaryData, Base64.encodeBase64(binaryData));
final byte[] binaryData2 = {};
@@ -276,7 +276,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64Chunked() {
+ void testEncodeBase64Chunked() {
byte[] bytesToEncode = { 'f', 'o', 'o', 'b', 'a', 'r' };
byte[] encodedData = Base64.encodeBase64Chunked(bytesToEncode);
assertEquals("Zm9vYmFy\r\n", toString(encodedData));
@@ -294,7 +294,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64StringByteArray() {
+ void testEncodeBase64StringByteArray() {
String stringToEncode = "Many hands make light work.";
String encodedData = Base64.encodeBase64String(stringToEncode.getBytes());
assertEquals("TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu\r\n", encodedData);
@@ -312,7 +312,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64StringByteArrayBoolean() {
+ void testEncodeBase64StringByteArrayBoolean() {
final byte[] bytesToEncode = "light work.".getBytes();
final String chunkedResult = Base64.encodeBase64String(bytesToEncode, true);
assertEquals("bGlnaHQgd29yay4=\r\n", chunkedResult);
@@ -321,7 +321,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64StringUnChunked() {
+ void testEncodeBase64StringUnChunked() {
byte[] bytesToEncode = "Many hands make light work.".getBytes();
String encodedData = Base64.encodeBase64StringUnChunked(bytesToEncode);
assertEquals("TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu", encodedData);
@@ -337,7 +337,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64URLSafe() {
+ void testEncodeBase64URLSafe() {
byte[] bytesToEncode = "Many hands make light work.".getBytes();
byte[] encodedData = Base64.encodeBase64URLSafe(bytesToEncode);
assertEquals("TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu", toString(encodedData));
@@ -365,7 +365,7 @@ public class Base64Test {
}
@Test
- public void testEncodeBase64URLSafeString() {
+ void testEncodeBase64URLSafeString() {
byte[] bytesToEncode = "Many hands make light work.".getBytes();
String encodedData = Base64.encodeBase64URLSafeString(bytesToEncode);
assertEquals("TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu", encodedData);
@@ -382,26 +382,26 @@ public class Base64Test {
}
@Test
- public void testEncodeByteArray() {
+ void testEncodeByteArray() {
final Base64 base64 = new Base64();
final byte[] bytesToEncode = { 'l', 'i', 'g', 'h', 't', ' ', 'w', 'o', 'r' };
assertEquals("bGlnaHQgd29y\r\n", new String(base64.encode(bytesToEncode), StandardCharsets.UTF_8));
}
@Test
- public void testEncodeByteArrayEmpty() {
+ void testEncodeByteArrayEmpty() {
assertNull(new Base64().encode((byte[]) null));
final byte[] empty = {};
assertSame(empty, new Base64().encode(empty));
}
@Test
- public void testEncodeByteArrayNull() {
+ void testEncodeByteArrayNull() {
assertNull(new Base64().encode((byte[]) null));
}
@Test
- public void testEncodeInteger() {
+ void testEncodeInteger() {
testEncodeInteger(BigInteger.ONE);
testEncodeInteger(BigInteger.TEN);
testEncodeInteger(BigInteger.ZERO);
@@ -414,20 +414,20 @@ public class Base64Test {
}
@Test
- public void testEncodeToString() {
+ void testEncodeToString() {
final Base64 base64 = new Base64();
final byte[] bytesToEncode = { 'l', 'i', 'g', 'h', 't', ' ', 'w', 'o', 'r' };
assertEquals("bGlnaHQgd29y\r\n", base64.encodeToString(bytesToEncode));
}
@Test
- public void testIsArrayByteBase64() {
+ void testIsArrayByteBase64() {
assertTrue(Base64.isArrayByteBase64(new byte[] { 'b', ' ' }));
assertFalse(Base64.isArrayByteBase64(new byte[] { '?' }));
}
@Test
- public void testIsBase64() {
+ void testIsBase64() {
assertTrue(Base64.isBase64((byte) '='));
assertTrue(Base64.isBase64((byte) 'b'));
assertFalse(Base64.isBase64((byte) ' '));
diff --git a/src/test/java/org/apache/commons/net/util/CharsetsTest.java b/src/test/java/org/apache/commons/net/util/CharsetsTest.java
index ca8989e9..1fa1466a 100644
--- a/src/test/java/org/apache/commons/net/util/CharsetsTest.java
+++ b/src/test/java/org/apache/commons/net/util/CharsetsTest.java
@@ -27,21 +27,21 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link Charsets}.
*/
-public class CharsetsTest {
+class CharsetsTest {
@Test
- public void testToCharset() {
+ void testToCharset() {
assertEquals(StandardCharsets.UTF_8, Charsets.toCharset(StandardCharsets.UTF_8.name()));
}
@Test
- public void testToCharsetDefault() {
+ void testToCharsetDefault() {
assertEquals(StandardCharsets.UTF_8, Charsets.toCharset(null, StandardCharsets.UTF_8.name()));
}
@SuppressWarnings("deprecation")
@Test
- public void testToConstructor() {
+ void testToConstructor() {
assertDoesNotThrow(Charsets::new);
}
}
diff --git a/src/test/java/org/apache/commons/net/util/ListenerListTest.java b/src/test/java/org/apache/commons/net/util/ListenerListTest.java
index 2a4b1e32..3d859ac2 100644
--- a/src/test/java/org/apache/commons/net/util/ListenerListTest.java
+++ b/src/test/java/org/apache/commons/net/util/ListenerListTest.java
@@ -29,14 +29,14 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link ListenerList}.
*/
-public class ListenerListTest {
+class ListenerListTest {
static class EventListenerImpl implements EventListener {
// empty
}
@Test
- public void testAdd() {
+ void testAdd() {
final EventListenerImpl eventListenerImpl = new EventListenerImpl();
final ListenerList listenerList = new ListenerList();
listenerList.addListener(eventListenerImpl);
@@ -44,12 +44,12 @@ public class ListenerListTest {
}
@Test
- public void testConstructor() {
+ void testConstructor() {
assertEquals(0, new ListenerList().getListenerCount());
}
@Test
- public void testIterator() {
+ void testIterator() {
final EventListenerImpl eventListenerImpl = new EventListenerImpl();
final ListenerList listenerList = new ListenerList();
listenerList.addListener(eventListenerImpl);
@@ -58,7 +58,7 @@ public class ListenerListTest {
assertSame(eventListenerImpl, iterator.next());
}
@Test
- public void testRemove() {
+ void testRemove() {
final EventListenerImpl eventListenerImpl = new EventListenerImpl();
final ListenerList listenerList = new ListenerList();
listenerList.addListener(eventListenerImpl);
diff --git a/src/test/java/org/apache/commons/net/util/SubnetUtils6Test.java b/src/test/java/org/apache/commons/net/util/SubnetUtils6Test.java
index 04f61e75..51f9d3c1 100644
--- a/src/test/java/org/apache/commons/net/util/SubnetUtils6Test.java
+++ b/src/test/java/org/apache/commons/net/util/SubnetUtils6Test.java
@@ -33,12 +33,12 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link SubnetUtils6}.
*/
-public class SubnetUtils6Test {
+class SubnetUtils6Test {
private static final BigInteger TWO = BigInteger.valueOf(2);
@Test
- public void testBasicCidr64() {
+ void testBasicCidr64() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::1/64");
final SubnetInfo info = utils.getInfo();
@@ -51,7 +51,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testBasicCidr128() {
+ void testBasicCidr128() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::1/128");
final SubnetInfo info = utils.getInfo();
@@ -62,7 +62,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testCidr0() {
+ void testCidr0() {
final SubnetUtils6 utils = new SubnetUtils6("::/0");
final SubnetInfo info = utils.getInfo();
@@ -73,7 +73,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testCidr48() {
+ void testCidr48() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8:abcd::/48");
final SubnetInfo info = utils.getInfo();
@@ -83,7 +83,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testCompressedAddress() {
+ void testCompressedAddress() {
final SubnetUtils6 utils = new SubnetUtils6("fe80::1/10");
final SubnetInfo info = utils.getInfo();
@@ -95,7 +95,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testConstructorWithSeparateArgs() {
+ void testConstructorWithSeparateArgs() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::1", 64);
final SubnetInfo info = utils.getInfo();
@@ -104,7 +104,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testFullAddress() {
+ void testFullAddress() {
final SubnetUtils6 utils = new SubnetUtils6("2001:0db8:0000:0000:0000:0000:0000:0001/64");
final SubnetInfo info = utils.getInfo();
@@ -113,7 +113,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testGetCidrSignature() {
+ void testGetCidrSignature() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::1/64");
final SubnetInfo info = utils.getInfo();
@@ -121,7 +121,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testInvalidCidr() {
+ void testInvalidCidr() {
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6(null));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("2001:db8::1"));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("2001:db8::1/"));
@@ -132,20 +132,20 @@ public class SubnetUtils6Test {
}
@Test
- public void testInvalidTwoArgConstructor() {
+ void testInvalidTwoArgConstructor() {
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("2001:db8::1", 129));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("2001:db8::1", -1));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("not-an-address", 64));
}
@Test
- public void testInvalidIPv4Address() {
+ void testInvalidIPv4Address() {
// IPv4 addresses should be rejected
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils6("192.168.1.1/24"));
}
@Test
- public void testIsInRange() {
+ void testIsInRange() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::/32");
final SubnetInfo info = utils.getInfo();
@@ -163,7 +163,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testIsInRangeWithInvalidString() {
+ void testIsInRangeWithInvalidString() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::/32");
final SubnetInfo info = utils.getInfo();
@@ -172,7 +172,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testIsInRangeWithBigInteger() throws UnknownHostException {
+ void testIsInRangeWithBigInteger() throws UnknownHostException {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::/32");
final SubnetInfo info = utils.getInfo();
@@ -186,7 +186,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testIsInRangeWithByteArray() throws UnknownHostException {
+ void testIsInRangeWithByteArray() throws UnknownHostException {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::/32");
final SubnetInfo info = utils.getInfo();
@@ -203,7 +203,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testIsInRangeWithInet6Address() throws UnknownHostException {
+ void testIsInRangeWithInet6Address() throws UnknownHostException {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::/32");
final SubnetInfo info = utils.getInfo();
@@ -219,7 +219,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testLinkLocalAddress() {
+ void testLinkLocalAddress() {
final SubnetUtils6 utils = new SubnetUtils6("fe80::/10");
final SubnetInfo info = utils.getInfo();
@@ -229,7 +229,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testLoopbackAddress() {
+ void testLoopbackAddress() {
final SubnetUtils6 utils = new SubnetUtils6("::1/128");
final SubnetInfo info = utils.getInfo();
@@ -239,7 +239,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testToString() {
+ void testToString() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::1/64");
final SubnetInfo info = utils.getInfo();
final String str = utils.toString();
@@ -263,7 +263,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testUniqueLocalAddress() {
+ void testUniqueLocalAddress() {
// ULA range is fc00::/7
final SubnetUtils6 utils = new SubnetUtils6("fd00::/8");
final SubnetInfo info = utils.getInfo();
@@ -274,7 +274,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testHighBitAddress() {
+ void testHighBitAddress() {
final SubnetUtils6 utils = new SubnetUtils6("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128");
final SubnetInfo info = utils.getInfo();
@@ -285,7 +285,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testGetLowAddress() {
+ void testGetLowAddress() {
final SubnetUtils6 utils = new SubnetUtils6("2001:db8::100/120");
final SubnetInfo info = utils.getInfo();
@@ -299,7 +299,7 @@ public class SubnetUtils6Test {
* RFC 5952 Section 1: all representations of the same address must parse identically.
*/
@Test
- public void testRfc5952Section1EquivalentRepresentations() {
+ void testRfc5952Section1EquivalentRepresentations() {
assertEquivalentSubnets(
"2001:db8:0:0:1:0:0:1/128",
"2001:0db8:0:0:1:0:0:1/128",
@@ -316,7 +316,7 @@ public class SubnetUtils6Test {
* RFC 5952 Section 2.1: leading zeros in each 16-bit group must not affect parsing.
*/
@Test
- public void testRfc5952Section21LeadingZeros() {
+ void testRfc5952Section21LeadingZeros() {
assertEquivalentSubnets(
"2001:db8:aaaa:bbbb:cccc:dddd:eeee:0001/128",
"2001:db8:aaaa:bbbb:cccc:dddd:eeee:001/128",
@@ -329,7 +329,7 @@ public class SubnetUtils6Test {
* RFC 5952 Section 2.2: various :: compression positions must resolve to the same address.
*/
@Test
- public void testRfc5952Section22ZeroCompression() {
+ void testRfc5952Section22ZeroCompression() {
assertEquivalentSubnets(
"2001:db8:0:0:0:0:0:1/128",
"2001:db8:0:0:0::1/128",
@@ -343,7 +343,7 @@ public class SubnetUtils6Test {
* RFC 5952 Section 2.3: uppercase, lowercase, and mixed-case hex digits must parse identically.
*/
@Test
- public void testRfc5952Section23CaseInsensitivity() {
+ void testRfc5952Section23CaseInsensitivity() {
assertEquivalentSubnets(
"2001:db8:aaaa:bbbb:cccc:dddd:eeee:aaaa/128",
"2001:db8:aaaa:bbbb:cccc:dddd:eeee:AAAA/128",
@@ -357,7 +357,7 @@ public class SubnetUtils6Test {
* Verifies that {@code 2001:0db8::0001} and {@code 2001:db8::1} produce the same output.
*/
@Test
- public void testRfc5952Section41CanonicalLeadingZeros() {
+ void testRfc5952Section41CanonicalLeadingZeros() {
final SubnetInfo a = new SubnetUtils6("2001:0db8::0001/128").getInfo();
final SubnetInfo b = new SubnetUtils6("2001:db8::1/128").getInfo();
assertEquals(a.getAddress(), b.getAddress());
@@ -368,7 +368,7 @@ public class SubnetUtils6Test {
* Both forms represent the same address.
*/
@Test
- public void testRfc5952Section421MaximumShortening() {
+ void testRfc5952Section421MaximumShortening() {
final SubnetInfo a = new SubnetUtils6("2001:db8::0:1/128").getInfo();
final SubnetInfo b = new SubnetUtils6("2001:db8::1/128").getInfo();
assertEquals(a.getAddress(), b.getAddress());
@@ -379,7 +379,7 @@ public class SubnetUtils6Test {
* Both input forms must parse to the same address.
*/
@Test
- public void testRfc5952Section423FirstLongestRunCompressed() {
+ void testRfc5952Section423FirstLongestRunCompressed() {
assertEquivalentSubnets(
"2001:db8:0:0:1:0:0:1/128",
"2001:db8::1:0:0:1/128",
@@ -401,7 +401,7 @@ public class SubnetUtils6Test {
}
@Test
- public void testRfc5952Section5SpecialAddresses() {
+ void testRfc5952Section5SpecialAddresses() {
final SubnetInfo loopback = new SubnetUtils6("::1/128").getInfo();
assertEquals("0:0:0:0:0:0:0:1", loopback.getAddress());
diff --git a/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java b/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
index 9bd305ea..71ae4557 100644
--- a/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
+++ b/src/test/java/org/apache/commons/net/util/SubnetUtilsNet728Test.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
/**
* Tests https://issues.apache.org/jira/browse/NET-728
*/
-public class SubnetUtilsNet728Test {
+class SubnetUtilsNet728Test {
private static final String CIDR_SUFFIX_30 = "30";
private static final String CIDR_SUFFIX_32 = "32";
diff --git a/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java b/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
index 970c246d..dca5bc18 100644
--- a/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
+++ b/src/test/java/org/apache/commons/net/util/SubnetUtilsTest.java
@@ -42,7 +42,7 @@ import org.junit.jupiter.params.provider.FieldSource;
* Tests {@link SubnetUtils}.
*/
@SuppressWarnings("deprecation") // deliberate use of deprecated methods
-public class SubnetUtilsTest {
+class SubnetUtilsTest {
/**
* Fixture values includes counting the host.
@@ -79,7 +79,7 @@ public class SubnetUtilsTest {
// @formatter:on
@Test
- public void testAddresses() {
+ void testAddresses() {
final SubnetUtils utils = new SubnetUtils("192.168.0.1/29");
final SubnetInfo info = utils.getInfo();
assertTrue(info.isInRange("192.168.0.1"));
@@ -102,7 +102,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testAddressIllegalArgument() {
+ void testAddressIllegalArgument() {
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils("bad"));
}
@@ -110,7 +110,7 @@ public class SubnetUtilsTest {
* Test using the inclusiveHostCount flag, which includes the network and broadcast addresses in host counts
*/
@Test
- public void testCidrAddresses() {
+ void testCidrAddresses() {
SubnetUtils utils = new SubnetUtils("192.168.0.1/8");
utils.setInclusiveHostCount(true);
SubnetInfo info = utils.getInfo();
@@ -276,7 +276,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testInvalidMasks() {
+ void testInvalidMasks() {
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils("192.168.0.1/"));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils("192.168.0.1/33"));
assertThrows(IllegalArgumentException.class, () -> new SubnetUtils("192.168.0.1/111"));
@@ -284,7 +284,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET428_31() {
+ void testNET428_31() {
final SubnetUtils subnetUtils = new SubnetUtils("1.2.3.4/31");
assertEquals(0, subnetUtils.getInfo().getAddressCount());
final String[] address = subnetUtils.getInfo().getAllAddresses();
@@ -293,7 +293,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET428_32() {
+ void testNET428_32() {
final SubnetUtils subnetUtils = new SubnetUtils("1.2.3.4/32");
assertEquals(0, subnetUtils.getInfo().getAddressCount());
final String[] address = subnetUtils.getInfo().getAllAddresses();
@@ -302,7 +302,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET520() {
+ void testNET520() {
final SubnetUtils utils = new SubnetUtils("0.0.0.0/0");
utils.setInclusiveHostCount(true);
final SubnetInfo info = utils.getInfo();
@@ -314,7 +314,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET521() {
+ void testNET521() {
SubnetUtils utils;
SubnetInfo info;
@@ -337,7 +337,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET624() {
+ void testNET624() {
assertDoesNotThrow(() -> new SubnetUtils("0.0.0.0/0"));
assertDoesNotThrow(() -> new SubnetUtils("0.0.0.0", "0.0.0.0"));
assertDoesNotThrow(() -> new SubnetUtils("0.0.0.0", "128.0.0.0"));
@@ -346,7 +346,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET641() {
+ void testNET641() {
assertFalse(new SubnetUtils("192.168.1.0/00").getInfo().isInRange("0.0.0.0"));
assertFalse(new SubnetUtils("192.168.1.0/30").getInfo().isInRange("0.0.0.0"));
assertFalse(new SubnetUtils("192.168.1.0/31").getInfo().isInRange("0.0.0.0"));
@@ -354,7 +354,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET675() {
+ void testNET675() {
final SubnetUtils utils = new SubnetUtils("192.168.0.15/32");
utils.setInclusiveHostCount(true);
final SubnetInfo info = utils.getInfo();
@@ -362,7 +362,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testNET679() {
+ void testNET679() {
final SubnetUtils utils = new SubnetUtils("10.213.160.0/16");
utils.setInclusiveHostCount(true);
final SubnetInfo info = utils.getInfo();
@@ -371,13 +371,13 @@ public class SubnetUtilsTest {
}
@Test
- public void testNext() {
+ void testNext() {
final SubnetUtils utils = new SubnetUtils("192.168.0.1/29");
assertEquals("192.168.0.2", utils.getNext().getInfo().getAddress());
}
@Test
- public void testParseSimpleNetmask() {
+ void testParseSimpleNetmask() {
final String address = "192.168.0.1";
final String[] masks = { "255.0.0.0", "255.255.0.0", "255.255.255.0", "255.255.255.248" };
final String[] bcastAddresses = { "192.255.255.255", "192.168.255.255", "192.168.0.255", "192.168.0.7" };
@@ -405,7 +405,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testParseSimpleNetmaskExclusive() {
+ void testParseSimpleNetmaskExclusive() {
final String address = "192.168.15.7";
final String[] masks = { "255.255.255.252", "255.255.255.254", "255.255.255.255" };
final String[] bcast = { "192.168.15.7", "192.168.15.7", "192.168.15.7" };
@@ -430,7 +430,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testParseSimpleNetmaskInclusive() {
+ void testParseSimpleNetmaskInclusive() {
final String address = "192.168.15.7";
final String[] masks = { "255.255.255.252", "255.255.255.254", "255.255.255.255" };
final String[] bcast = { "192.168.15.7", "192.168.15.7", "192.168.15.7" };
@@ -454,13 +454,13 @@ public class SubnetUtilsTest {
}
@Test
- public void testPrevious() {
+ void testPrevious() {
final SubnetUtils utils = new SubnetUtils("192.168.0.1/29");
assertEquals("192.168.0.0", utils.getPrevious().getInfo().getAddress());
}
@Test
- public void testSubnetAddressIterable() {
+ void testSubnetAddressIterable() {
testSubnetAddressIterable("192.168.1.0/24", 254);
}
@@ -476,7 +476,7 @@ public class SubnetUtilsTest {
@ParameterizedTest
@FieldSource("CIDR_SIZES")
- public void testSubnetAddressIterableCount(final ImmutablePair<String, Long> pair) {
+ void testSubnetAddressIterableCount(final ImmutablePair<String, Long> pair) {
final String cidrNotation = pair.getKey();
final long max = pair.getValue();
final SubnetUtils subnetUtils = new SubnetUtils(cidrNotation);
@@ -486,7 +486,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testSubnetAddressStream() {
+ void testSubnetAddressStream() {
testSubnetAddressStream("192.168.1.0/24", 254);
}
@@ -502,7 +502,7 @@ public class SubnetUtilsTest {
@ParameterizedTest
@FieldSource("CIDR_SIZES")
- public void testSubnetAddressStreamCount(final ImmutablePair<String, Long> pair) {
+ void testSubnetAddressStreamCount(final ImmutablePair<String, Long> pair) {
final String cidrNotation = pair.getKey();
final long max = pair.getValue();
final SubnetUtils subnetUtils = new SubnetUtils(cidrNotation);
@@ -512,7 +512,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testToString() {
+ void testToString() {
final String cidrNotation = "192.168.0.1/29";
final SubnetUtils utils = new SubnetUtils(cidrNotation);
assertTrue(utils.toString().contains(cidrNotation));
@@ -521,7 +521,7 @@ public class SubnetUtilsTest {
}
@Test
- public void testZeroAddressAndCidr() {
+ void testZeroAddressAndCidr() {
testSubnetAddressStream("0.0.0.0/0", 0);
}
}
diff --git a/src/test/java/org/apache/commons/net/util/TrustManagerUtilsTest.java b/src/test/java/org/apache/commons/net/util/TrustManagerUtilsTest.java
index f65d90d4..edfba0df 100644
--- a/src/test/java/org/apache/commons/net/util/TrustManagerUtilsTest.java
+++ b/src/test/java/org/apache/commons/net/util/TrustManagerUtilsTest.java
@@ -29,26 +29,26 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link TrustManagerUtils}.
*/
-public class TrustManagerUtilsTest {
+class TrustManagerUtilsTest {
@Test
- public void testGetAcceptAllTrustManager() {
+ void testGetAcceptAllTrustManager() {
assertNotNull(TrustManagerUtils.getAcceptAllTrustManager());
}
@Test
- public void testGetDefaultTrustManager() throws KeyStoreException, GeneralSecurityException {
+ void testGetDefaultTrustManager() throws KeyStoreException, GeneralSecurityException {
assertNotNull(TrustManagerUtils.getDefaultTrustManager(KeyStore.getInstance(KeyStore.getDefaultType())));
}
@Test
- public void testGetValidateServerCertificateTrustManager() {
+ void testGetValidateServerCertificateTrustManager() {
assertNotNull(TrustManagerUtils.getValidateServerCertificateTrustManager());
}
@SuppressWarnings("deprecation")
@Test
- public void testToConstructor() {
+ void testToConstructor() {
assertDoesNotThrow(TrustManagerUtils::new);
}
diff --git a/src/test/java/org/apache/commons/net/util/UtilTest.java b/src/test/java/org/apache/commons/net/util/UtilTest.java
index df1e70ef..ecda95dc 100644
--- a/src/test/java/org/apache/commons/net/util/UtilTest.java
+++ b/src/test/java/org/apache/commons/net/util/UtilTest.java
@@ -35,7 +35,7 @@ import org.apache.commons.net.io.CopyStreamListener;
import org.apache.commons.net.io.Util;
import org.junit.jupiter.api.Test;
-public class UtilTest {
+class UtilTest {
static class CSL implements CopyStreamListener {
@@ -103,13 +103,13 @@ public class UtilTest {
private final OutputStream dst = new ByteArrayOutputStream();
@Test
- public void testcloseQuietly() {
+ void testcloseQuietly() {
Util.closeQuietly((Closeable) null);
Util.closeQuietly((Socket) null);
}
@Test
- public void testNET550_Reader() throws Exception {
+ void testNET550_Reader() throws Exception {
final char[] buff = { 'a', 'b', 'c', 'd' }; // must be multiple of 2
final int bufflen = buff.length;
{ // Check buffer size 1 processes in chunks of 1
@@ -145,7 +145,7 @@ public class UtilTest {
}
@Test
- public void testNET550_Stream() throws Exception {
+ void testNET550_Stream() throws Exception {
final byte[] buff = { 'a', 'b', 'c', 'd' }; // must be multiple of 2
final int bufflen = buff.length;
{ // Check buffer size 1 processes in chunks of 1
@@ -181,42 +181,42 @@ public class UtilTest {
}
@Test
- public void testReader_1() throws Exception {
+ void testReader_1() throws Exception {
final long streamSize = 0;
final int bufferSize = -1;
Util.copyReader(source, dest, bufferSize, streamSize, new CSL(1, 1, streamSize));
}
@Test
- public void testReader0() throws Exception {
+ void testReader0() throws Exception {
final long streamSize = 0;
final int bufferSize = 0;
Util.copyReader(source, dest, bufferSize, streamSize, new CSL(1, 1, streamSize));
}
@Test
- public void testReader1() throws Exception {
+ void testReader1() throws Exception {
final long streamSize = 0;
final int bufferSize = 1;
Util.copyReader(source, dest, bufferSize, streamSize, new CSL(1, 1, streamSize));
}
@Test
- public void testStream_1() throws Exception {
+ void testStream_1() throws Exception {
final long streamSize = 0;
final int bufferSize = -1;
Util.copyStream(src, dst, bufferSize, streamSize, new CSL(1, 1, streamSize));
}
@Test
- public void testStream0() throws Exception {
+ void testStream0() throws Exception {
final long streamSize = 0;
final int bufferSize = 0;
Util.copyStream(src, dst, bufferSize, streamSize, new CSL(1, 1, streamSize));
}
@Test
- public void testStream1() throws Exception {
+ void testStream1() throws Exception {
final long streamSize = 0;
final int bufferSize = 1;
Util.copyStream(src, dst, bufferSize, streamSize, new CSL(1, 1, streamSize));
diff --git a/src/test/java/org/apache/commons/net/whois/WhoisClientTest.java b/src/test/java/org/apache/commons/net/whois/WhoisClientTest.java
index 7361cd23..2fbd4206 100644
--- a/src/test/java/org/apache/commons/net/whois/WhoisClientTest.java
+++ b/src/test/java/org/apache/commons/net/whois/WhoisClientTest.java
@@ -27,20 +27,20 @@ import org.junit.jupiter.api.Test;
/**
* Tests {@link WhoisClient}.
*/
-public class WhoisClientTest {
+class WhoisClientTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
assertDoesNotThrow(WhoisClient::new);
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
assertEquals(WhoisClient.DEFAULT_PORT, new WhoisClient().getDefaultPort());
}
@Test
- public void testDisconnect() throws IOException {
+ void testDisconnect() throws IOException {
new WhoisClient().disconnect();
}