commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1440352 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java
Date Wed, 30 Jan 2013 11:37:23 GMT
Author: tn
Date: Wed Jan 30 11:37:23 2013
New Revision: 1440352

URL: http://svn.apache.org/viewvc?rev=1440352&view=rev
Log:
Fix multiple connection unit test, which failed when there are spaces in the absolute file
path.

Modified:
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java?rev=1440352&r1=1440351&r2=1440352&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java
(original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/ftps/test/FtpsProviderTestCase_Disabled.java
Wed Jan 30 11:37:23 2013
@@ -19,6 +19,7 @@ package org.apache.commons.vfs2.provider
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.net.URLDecoder;
 
 import junit.framework.Test;
 
@@ -122,7 +123,9 @@ public class FtpsProviderTestCase_Disabl
         final URL serverJksResource = ClassLoader.getSystemClassLoader().getResource(SERVER_JKS_RES);
         Assert.assertNotNull(SERVER_JKS_RES, serverJksResource);
         final SslConfigurationFactory ssl = new SslConfigurationFactory();
-        final File keyStoreFile = new File(serverJksResource.getFile());
+        // decode the URL before using it to create a File object as spaces in the filename
+        // are encoded as '%20' by URL class
+        final File keyStoreFile = new File(URLDecoder.decode(serverJksResource.getFile()));
         Assert.assertTrue(keyStoreFile.toString(), keyStoreFile.exists());
         ssl.setKeystoreFile(keyStoreFile);
         ssl.setKeystorePassword("password");



Mime
View raw message