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 2024/05/28 21:16:47 UTC
(commons-net) branch master updated (a61ee765 -> 561b0f39)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
from a61ee765 Add tests
new 043f1e0b Whitespace
new 561b0f39 Add tests
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/commons/net/bsd/RCommandClient.java | 1 +
.../org/apache/commons/net/bsd/RExecClient.java | 2 +-
.../org/apache/commons/net/bsd/RLoginClient.java | 2 +-
.../java/org/apache/commons/net/tftp/TFTPTest.java | 22 +++++++++++++++++++++-
4 files changed, 24 insertions(+), 3 deletions(-)
(commons-net) 01/02: Whitespace
Posted by gg...@apache.org.
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
commit 043f1e0b819dd6afeaeb3eaaaaa09a3bbd481106
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 28 10:53:20 2024 -0400
Whitespace
---
src/main/java/org/apache/commons/net/bsd/RCommandClient.java | 1 +
src/main/java/org/apache/commons/net/bsd/RExecClient.java | 2 +-
src/main/java/org/apache/commons/net/bsd/RLoginClient.java | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/bsd/RCommandClient.java b/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
index d7667195..d2736d89 100644
--- a/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
@@ -60,6 +60,7 @@ import org.apache.commons.net.io.SocketInputStream;
* @see RLoginClient
*/
public class RCommandClient extends RExecClient {
+
/**
* The default rshell port. Set to 514 in BSD Unix.
*/
diff --git a/src/main/java/org/apache/commons/net/bsd/RExecClient.java b/src/main/java/org/apache/commons/net/bsd/RExecClient.java
index 3f297068..e3a8537a 100644
--- a/src/main/java/org/apache/commons/net/bsd/RExecClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RExecClient.java
@@ -48,8 +48,8 @@ import org.apache.commons.net.util.NetConstants;
* @see RCommandClient
* @see RLoginClient
*/
-
public class RExecClient extends SocketClient {
+
/**
* @since 3.3
*/
diff --git a/src/main/java/org/apache/commons/net/bsd/RLoginClient.java b/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
index 21b01fcd..e6fcd3cf 100644
--- a/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
@@ -42,8 +42,8 @@ import java.io.IOException;
* @see RExecClient
* @see RCommandClient
*/
-
public class RLoginClient extends RCommandClient {
+
/**
* The default rlogin port. Set to 513 in BSD UNIX and according to RFC 1282.
*/
(commons-net) 02/02: Add tests
Posted by gg...@apache.org.
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
commit 561b0f39f58a3994885e58c358b05370969a6c4e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 28 17:16:42 2024 -0400
Add tests
---
.../java/org/apache/commons/net/tftp/TFTPTest.java | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
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 36a6e2e6..245b8517 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPTest.java
@@ -16,12 +16,15 @@
*/
package org.apache.commons.net.tftp;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.net.InetAddress;
import junit.framework.TestCase;
@@ -38,7 +41,7 @@ public class TFTPTest extends TestCase {
private static final String FILE_PREFIX = "tftp-";
private static final File[] FILES = new File[8];
- static int testsLeftToRun = 6;
+ static int testsLeftToRun = 9; // TODO Nasty hack.
// only want to do this once...
static {
@@ -111,6 +114,18 @@ public class TFTPTest extends TestCase {
}
}
+ public void testDiscardPackets() {
+ try (TFTP tftp = new TFTP()) {
+ assertThrows(NullPointerException.class, tftp::discardPackets);
+ }
+ }
+
+ public void testSend() {
+ try (TFTP tftp = new TFTP()) {
+ assertThrows(NullPointerException.class, () -> tftp.send(new TFTPDataPacket(InetAddress.getLocalHost(), 0, 0, new byte[0])));
+ }
+ }
+
private void testDownload(final int mode, final File file) throws IOException {
// Create our TFTP instance to handle the file transfer.
try (TFTPClient tftp = new TFTPClient()) {
@@ -134,6 +149,11 @@ public class TFTPTest extends TestCase {
out.delete();
}
}
+
+ public void testGetModeName() {
+ assertNotNull(TFTP.getModeName(0));
+ assertNotNull(TFTP.getModeName(1));
+ }
public void testHugeDownloads() throws Exception {
// test with the smaller FILES