garydgregory commented on code in PR #300:
URL: https://github.com/apache/commons-vfs/pull/300#discussion_r976581502


##########
commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/http/HttpProviderTestCase.java:
##########
@@ -212,4 +215,36 @@ public void testResolveFolderSlashYesRedirectOn() throws 
FileSystemException {
         testResolveFolderSlash(ConnectionUri + "/read-tests/", true);
     }
 
+    @Test
+    public void testHttpFileSystemFreeUnusedResources() throws Exception {
+        try (StandardFileSystemManager fileSystemManager = new 
StandardFileSystemManager()) {
+            
fileSystemManager.setConfiguration(StandardFileSystemManager.class.getResource("providers.xml"));
+            // use WeakRef
+            fileSystemManager.setFilesCache(new WeakRefFilesCache());
+            fileSystemManager.init();
+
+            String path = 
"http://www.w3schools.com/webservices/tempconvert.asmx?action=WSDL";;

Review Comment:
   Don't use a remote server. This cause the test to fail randomly and 
eventually fail all the time. See the other HTTP test in this class which uses 
an embedded HTTP server.



##########
commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/http4/Http4ProviderTestCase.java:
##########
@@ -216,4 +219,35 @@ public void testResolveFolderSlashYesRedirectOn() throws 
FileSystemException {
         testResolveFolderSlash(ConnectionUri + "/read-tests/", true);
     }
 
+    @Test
+    public void testHttp4FileSystemFreeUnusedResources() throws Exception {
+        try (StandardFileSystemManager fileSystemManager = new 
StandardFileSystemManager()) {
+            
fileSystemManager.setConfiguration(StandardFileSystemManager.class.getResource("providers.xml"));
+            // use WeakRef
+            fileSystemManager.setFilesCache(new WeakRefFilesCache());
+            fileSystemManager.init();
+
+            String path = 
"http4://www.w3schools.com/webservices/tempconvert.asmx?action=WSDL";

Review Comment:
   Don't use a remote server. This cause the test to fail randomly and 
eventually fail all the time. See the other HTTP test in this class which uses 
an embedded HTTP server.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to