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/04/05 13:00:37 UTC

(commons-vfs) branch master updated (0026a9200 -> 1245cc009)

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-vfs.git


    from 0026a9200 Run builds only on push to master and pull requests
     new f10239d74 Use static imports but only for JUnit instead of FQCN in code.
     new 0d62a6af4 Add missing @Override
     new 1245cc009 Remove useless lambda block.

The 3 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/vfs2/AbstractProviderTestSuite.java   |  4 ++--
 .../vfs2/provider/sftp/SftpPermissionExceptionTest.java      | 12 ++++--------
 .../commons/vfs2/provider/sftp/SftpPutChannelTest.java       |  5 ++---
 3 files changed, 8 insertions(+), 13 deletions(-)


(commons-vfs) 01/03: Use static imports but only for JUnit instead of FQCN in code.

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-vfs.git

commit f10239d74056c7bbccec0c3e3a6def71fd440593
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Apr 5 08:47:16 2026 -0400

    Use static imports but only for JUnit instead of FQCN in code.
---
 .../java/org/apache/commons/vfs2/AbstractProviderTestSuite.java    | 4 ++--
 .../commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java    | 7 ++-----
 .../org/apache/commons/vfs2/provider/sftp/SftpPutChannelTest.java  | 5 ++---
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestSuite.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestSuite.java
index f92002442..f62c7dbdc 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestSuite.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/AbstractProviderTestSuite.java
@@ -20,6 +20,7 @@ import static org.apache.commons.vfs2.VfsTestUtils.getTestDirectory;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 import java.io.File;
 import java.lang.reflect.Method;
@@ -267,8 +268,7 @@ public abstract class AbstractProviderTestSuite {
                     for (final Capability cap : caps) {
                         if (!fs.hasCapability(cap)) {
                             // Skip test if capability is not supported
-                            org.junit.jupiter.api.Assumptions.assumeTrue(false,
-                                "Skipping test because file system does not have capability: " + cap);
+                            assumeTrue(false, "Skipping test because file system does not have capability: " + cap);
                         }
                     }
                 }
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
index 27fcb9581..5f2961ad7 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.vfs2.provider.sftp;
 
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 import org.apache.commons.vfs2.AbstractProviderTestConfig;
 import org.apache.commons.vfs2.FileObject;
@@ -63,21 +64,17 @@ public class SftpPermissionExceptionTest extends ProviderTestSuiteJunit5 {
      */
     @Test
     public void testGetOutputStreamException() throws Exception {
-        org.junit.jupiter.api.Assumptions.assumeTrue(System.getProperty("test.sftp.uri") != null,
-            "Test requires SFTP server configured via system property");
+        assumeTrue(System.getProperty("test.sftp.uri") != null, "Test requires SFTP server configured via system property");
         final FileObject scratchFolder = getWriteFolder();
-
         // Create a read-only file
         final FileObject readOnlyFile = scratchFolder.resolveFile("read-only-file.txt");
         readOnlyFile.createFile();
         readOnlyFile.setWritable(false, false);
-
         // Try to copy to the read-only file - should throw exception
         final FileObject sourceFile = scratchFolder.resolveFile("file1.txt");
         assertThrows(FileSystemException.class, () -> {
             readOnlyFile.copyFrom(sourceFile, null);
         });
-
         // Clean up
         readOnlyFile.setWritable(true, false);
         readOnlyFile.delete();
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTest.java
index b4d531e64..6d625be20 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTest.java
@@ -17,6 +17,7 @@
 package org.apache.commons.vfs2.provider.sftp;
 
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
 
 import java.io.InputStream;
 
@@ -69,15 +70,13 @@ public class SftpPutChannelTest extends ProviderTestSuiteJunit5 {
      */
     @Test
     public void testDoGetInputStream() throws Exception {
-        org.junit.jupiter.api.Assumptions.assumeTrue(System.getProperty("test.sftp.uri") != null,
-            "Test requires SFTP server configured via system property");
+        assumeTrue(System.getProperty("test.sftp.uri") != null, "Test requires SFTP server configured via system property");
         final FileObject file = getReadFolder().resolveFile("file-does-not-exist.txt");
         assertThrows(FileSystemException.class, () -> {
             try (InputStream ignored = file.getContent().getInputStream()) {
                 // Should throw exception before reaching here
             }
         });
-
         // Original test also verified channel count:
         // final int channelCount = AbstractSftpProviderTestCase.getChannelCount();
         // assertEquals(0, channelCount, "Expected 0 channels after exception");


(commons-vfs) 02/03: Add missing @Override

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-vfs.git

commit 0d62a6af44c9da4365090c92cc2dd589825810d6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Apr 5 08:47:36 2026 -0400

    Add missing @Override
---
 .../apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
index 5f2961ad7..6bcc263cf 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
@@ -98,6 +98,7 @@ public class SftpPermissionExceptionTest extends ProviderTestSuiteJunit5 {
             return manager.resolveFile(uri, fileSystemOptions);
         }
 
+        @Override
         public void prepare(final DefaultFileSystemManager manager) throws Exception {
             manager.addProvider("sftp", new SftpFileProvider());
         }


(commons-vfs) 03/03: Remove useless lambda block.

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-vfs.git

commit 1245cc009e866614960f25f9b72050f4f0610493
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Apr 5 09:00:32 2026 -0400

    Remove useless lambda block.
---
 .../commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java       | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
index 6bcc263cf..2e5007a90 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPermissionExceptionTest.java
@@ -72,9 +72,7 @@ public class SftpPermissionExceptionTest extends ProviderTestSuiteJunit5 {
         readOnlyFile.setWritable(false, false);
         // Try to copy to the read-only file - should throw exception
         final FileObject sourceFile = scratchFolder.resolveFile("file1.txt");
-        assertThrows(FileSystemException.class, () -> {
-            readOnlyFile.copyFrom(sourceFile, null);
-        });
+        assertThrows(FileSystemException.class, () -> readOnlyFile.copyFrom(sourceFile, null));
         // Clean up
         readOnlyFile.setWritable(true, false);
         readOnlyFile.delete();