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 2020/12/17 15:49:50 UTC
[commons-net] branch master updated: Remove unused exceptions in
tests.
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 00dd878 Remove unused exceptions in tests.
00dd878 is described below
commit 00dd8780fa9de98ec21ad00a18838de4608e42f0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Dec 17 10:49:44 2020 -0500
Remove unused exceptions in tests.
---
src/test/java/org/apache/commons/net/SubnetUtilsTest.java | 4 ++--
src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java | 3 +--
.../commons/net/ftp/parser/CompositeFTPParseTestFramework.java | 6 +++---
.../net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java | 2 +-
.../org/apache/commons/net/ftp/parser/FTPParseTestFramework.java | 4 ++--
.../org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java | 4 ++--
.../org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java | 4 ++--
.../org/apache/commons/net/ftp/parser/OS400FTPEntryParserTest.java | 2 +-
.../org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java | 4 ++--
src/test/java/org/apache/commons/net/tftp/TFTPTest.java | 2 +-
10 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/test/java/org/apache/commons/net/SubnetUtilsTest.java b/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
index dd2f54f..9814552 100644
--- a/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
+++ b/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
@@ -234,7 +234,7 @@ public class SubnetUtilsTest extends TestCase {
}
}
- public void testNET428_31() throws Exception {
+ public void testNET428_31() {
final SubnetUtils subnetUtils = new SubnetUtils("1.2.3.4/31");
assertEquals(0, subnetUtils.getInfo().getAddressCount());
final String[] address = subnetUtils.getInfo().getAllAddresses();
@@ -242,7 +242,7 @@ public class SubnetUtilsTest extends TestCase {
assertEquals(0, address.length);
}
- public void testNET428_32() throws Exception {
+ public void testNET428_32() {
final SubnetUtils subnetUtils = new SubnetUtils("1.2.3.4/32");
assertEquals(0, subnetUtils.getInfo().getAddressCount());
final String[] address = subnetUtils.getInfo().getAllAddresses();
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 ac4e01f..a79f1cd 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
@@ -117,9 +117,8 @@ public class FTPSClientTest {
*
* @param implicit FTPS connection mode
* @throws FtpException
- * @throws IOException
*/
- static void setUpClass(final boolean implicit) throws FtpException, IOException {
+ static void setUpClass(final boolean implicit) throws FtpException {
if (Server != null) {
return;
}
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 e612640..b31baa9 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
@@ -61,7 +61,7 @@ public abstract class CompositeFTPParseTestFramework extends FTPParseTestFramewo
/* (non-Javadoc)
* @see org.apache.commons.net.ftp.parser.FTPParseTestFramework#testGoodListing()
*/
- public void testConsistentListing() throws Exception
+ public void testConsistentListing()
{
final String goodsamples[][] = getGoodListings();
@@ -82,7 +82,7 @@ public abstract class CompositeFTPParseTestFramework extends FTPParseTestFramewo
* @see org.apache.commons.net.ftp.parser.FTPParseTestFramework#testGoodListing()
*/
@Override
- public void testBadListing() throws Exception
+ public void testBadListing()
{
final String badsamples[][] = getBadListings();
@@ -102,7 +102,7 @@ public abstract class CompositeFTPParseTestFramework extends FTPParseTestFramewo
// even though all these listings are good using one parser
// or the other, this tests that a parser that has succeeded
// on one format will fail if another format is substituted.
- public void testInconsistentListing() throws Exception
+ public void testInconsistentListing()
{
final String goodsamples[][] = getGoodListings();
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 02b8656..3665635 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
@@ -23,7 +23,7 @@ import org.apache.commons.net.ftp.FTPFileEntryParser;
public class DefaultFTPFileEntryParserFactoryTest extends TestCase
{
- public void testDefaultParserFactory() throws Exception {
+ public void testDefaultParserFactory() {
final DefaultFTPFileEntryParserFactory factory =
new DefaultFTPFileEntryParserFactory();
diff --git a/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java b/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
index ffbb3b3..a801228 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/FTPParseTestFramework.java
@@ -38,7 +38,7 @@ public abstract class FTPParseTestFramework extends TestCase
super(name);
}
- public void testBadListing() throws Exception
+ public void testBadListing()
{
final String[] badsamples = getBadListing();
@@ -53,7 +53,7 @@ public abstract class FTPParseTestFramework extends TestCase
}
}
- public void testGoodListing() throws Exception
+ public void testGoodListing()
{
final String[] goodsamples = getGoodListing();
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 99d74c6..9196198 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
@@ -128,7 +128,7 @@ public class MVSFTPEntryParserTest extends FTPParseTestFramework {
* @see org.apache.commons.net.ftp.parser.FTPParseTestFramework#testGoodListing()
*/
@Override
- public void testGoodListing() throws Exception {
+ public void testGoodListing() {
final String[] goodsamples = getGoodListing();
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.FILE_LIST_TYPE);
@@ -140,7 +140,7 @@ public class MVSFTPEntryParserTest extends FTPParseTestFramework {
}
}
- public void testMemberListing() throws Exception {
+ public void testMemberListing() {
final MVSFTPEntryParser parser = new MVSFTPEntryParser();
parser.setType(MVSFTPEntryParser.MEMBER_LIST_TYPE);
parser.setRegex(MVSFTPEntryParser.MEMBER_LIST_REGEX);
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 4f3ee0f..96da8b8 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
@@ -222,13 +222,13 @@ public class NTFTPEntryParserTest extends CompositeFTPParseTestFramework
* directory with name beginning with a numeric character
* was not parsing correctly
*/
- public void testDirectoryBeginningWithNumber() throws Exception
+ public void testDirectoryBeginningWithNumber()
{
final FTPFile f = getParser().parseFTPEntry(directoryBeginningWithNumber);
assertEquals("name", "123xyz", f.getName());
}
- public void testDirectoryBeginningWithNumberFollowedBySpaces() throws Exception
+ public void testDirectoryBeginningWithNumberFollowedBySpaces()
{
FTPFile f = getParser().parseFTPEntry("12-03-96 06:38AM <DIR> 123 xyz");
assertEquals("name", "123 xyz", f.getName());
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 497b4a7..c2a9247 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
@@ -183,7 +183,7 @@ public class OS400FTPEntryParserTest extends CompositeFTPParseTestFramework
testPrecision("----rwxr-x 1 PEP 0 4019 Mar 18 18:58 einladung.zip", CalendarUnit.MINUTE);
}
- public void testNET573() throws Exception
+ public void testNET573()
{
final FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_AS400);
conf.setDefaultDateFormatStr("MM/dd/yy HH:mm:ss");
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 79e2fe4..d1ceaca 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
@@ -329,7 +329,7 @@ public class UnixFTPEntryParserTest extends FTPParseTestFramework {
}
// https://mail-archives.apache.org/mod_mbox/commons-dev/200408.mbox/%3c4122F3C1.9090402@tanukisoftware.com%3e
- public void testParseFieldsOnFileJapaneseTime() throws Exception
+ public void testParseFieldsOnFileJapaneseTime()
{
final FTPFile f = getParser().parseFTPEntry("-rwxr-xr-x 2 user group 4096 3\u6708 2\u65e5 15:13 zxbox");
assertNotNull("Could not parse entry.", f);
@@ -358,7 +358,7 @@ public class UnixFTPEntryParserTest extends FTPParseTestFramework {
}
// https://mail-archives.apache.org/mod_mbox/commons-dev/200408.mbox/%3c4122F3C1.9090402@tanukisoftware.com%3e
- public void testParseFieldsOnFileJapaneseYear() throws Exception {
+ public 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("Could not parse entry.", f);
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 4636161..4b1603d 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
@@ -110,7 +110,7 @@ public class TFTPTest extends TestCase
}
}
- public void testASCIIDownloads() throws Exception
+ public void testASCIIDownloads()
{
// test with the smaller files
for (int i = 0; i < 6; i++)