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 2023/02/04 14:29:09 UTC

[commons-vfs] branch master updated (58fee7a0 -> 08a4a5b6)

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 58fee7a0 VFS-832: Sftp channel not put back in doGetInputStream (#370)
     new 160bc451 [VFS-832] Sftp channel not put back in doGetInputStream #370
     new 08a4a5b6 [VFS-832] Sftp channel not put back in doGetInputStream

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:
 .../vfs2/provider/sftp/SftpPutChannelTestCase.java | 26 +++++++++++-----------
 src/changes/changes.xml                            |  3 +++
 2 files changed, 16 insertions(+), 13 deletions(-)


[commons-vfs] 02/02: [VFS-832] Sftp channel not put back in doGetInputStream

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 08a4a5b69604f656eabd5c03765176ae223dc957
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Feb 4 09:29:04 2023 -0500

    [VFS-832] Sftp channel not put back in doGetInputStream
    
    Clean ups
---
 .../vfs2/provider/sftp/SftpPutChannelTestCase.java | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTestCase.java
index c63bb144..35a82599 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTestCase.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpPutChannelTestCase.java
@@ -38,7 +38,7 @@ public class SftpPutChannelTestCase extends AbstractSftpProviderTestCase {
      * to expose the channels count
      */
     private static class CustomServerSession extends ServerSession {
-        public CustomServerSession(FactoryManager server, IoSession ioSession) throws Exception {
+        public CustomServerSession(final FactoryManager server, final IoSession ioSession) throws Exception {
             super(server, ioSession);
         }
 
@@ -49,7 +49,7 @@ public class SftpPutChannelTestCase extends AbstractSftpProviderTestCase {
 
     private static class CustomSessionFactory extends SessionFactory {
         @Override
-        protected AbstractSession doCreateSession(IoSession ioSession) throws Exception {
+        protected AbstractSession doCreateSession(final IoSession ioSession) throws Exception {
             return new CustomServerSession(server, ioSession);
         }
     }
@@ -70,18 +70,13 @@ public class SftpPutChannelTestCase extends AbstractSftpProviderTestCase {
         return suite;
     }
 
-    @Override
-    protected SessionFactory sessionFactory() {
-        return new CustomSessionFactory();
-    }
-
     /**
-     * Returns the capabilities required by the tests of this test case.
+     * Gets the capabilities required by the tests of this test case.
      */
     @Override
     protected Capability[] getRequiredCapabilities() {
-        return new Capability[]{Capability.CREATE, Capability.DELETE, Capability.GET_TYPE, Capability.LIST_CHILDREN,
-            Capability.READ_CONTENT, Capability.WRITE_CONTENT};
+        return new Capability[] { Capability.CREATE, Capability.DELETE, Capability.GET_TYPE, Capability.LIST_CHILDREN, Capability.READ_CONTENT,
+                Capability.WRITE_CONTENT };
     }
 
     @Override
@@ -89,8 +84,13 @@ public class SftpPutChannelTestCase extends AbstractSftpProviderTestCase {
         return false;
     }
 
+    @Override
+    protected SessionFactory sessionFactory() {
+        return new CustomSessionFactory();
+    }
+
     /**
-     * Test SftpFileObject.doGetInputStream return the channel to pool, when there is an exception
+     * Tests SftpFileObject.doGetInputStream return the channel to pool, when there is an exception
      */
     @Test
     public void testDoGetInputStream() throws Exception {
@@ -102,8 +102,8 @@ public class SftpPutChannelTestCase extends AbstractSftpProviderTestCase {
                 try (InputStream ignored = readFolder.resolveFile("not-exists.txt").getContent().getInputStream()) {
                     Assertions.fail("file should not be exists");
                 }
-            } catch (FileSystemException e) {
-                int channelsCount = ((CustomServerSession) Server.getActiveSessions().get(0)).getChannelsCount();
+            } catch (final FileSystemException e) {
+                final int channelsCount = ((CustomServerSession) Server.getActiveSessions().get(0)).getChannelsCount();
                 Assertions.assertTrue(channelsCount < MAX_CHANNELS, "channels count expected less than " + MAX_CHANNELS);
             }
         }


[commons-vfs] 01/02: [VFS-832] Sftp channel not put back in doGetInputStream #370

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 160bc45117b204d1e7dfd2d8ffa353fee0287a31
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Feb 4 09:27:08 2023 -0500

    [VFS-832] Sftp channel not put back in doGetInputStream #370
---
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6d5b83df..efb2b23b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -128,6 +128,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="VFS-683" type="fix" dev="ggregory" due-to="Daryl Odnert, Otto Fowler, Bernd Eckenfels, Dave MacDonald, Ivan Bella, Gary Gregory">
         Class loader thread safety #367.
       </action>
+      <action issue="VFS-832" type="fix" dev="ggregory" due-to="Gary Gregory">
+        Sftp channel not put back in doGetInputStream #370.
+      </action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Seth Falco">
         Add vscode files to gitignore #205.