ucb/qa/complex/ucb/UCB.java       |    7 ++++---
 ucb/source/ucp/ftp/ftpcontent.cxx |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit f3c3f1b4da6ca79995c7392045cdf8a36a9b671f
Author:     Michael Stahl <[email protected]>
AuthorDate: Wed Oct 26 14:58:09 2022 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon May 15 14:10:21 2023 +0200

    ucb: FTP UCP: report CURLE_URL_MALFORMAT as IllegalIdentifierException
    
    With curl 7.86, the test JunitTest_ucb_complex starts to fail:
    
    .ftp://noname:nopasswd@*nohost.invalid
    now executing open
    com.sun.star.ucb.InteractiveAugmentedIOException:
            at com.sun.proxy.$Proxy15.execute(Unknown Source)
            at complex.ucb.UCB.executeCommand(UCB.java:63)
            at complex.ucb.UCB.checkWrongFtpConnection(UCB.java:119)
    
    because curl_easy_perform() now returns CURLE_URL_MALFORMAT where
    previously it was CURLE_COULDNT_RESOLVE_HOST.
    
    Map this to an exception the test expects.
    
    Change-Id: Ifdb672946726ddb4cb4d9426b7e70eefac63f040
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141877
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 022e476af44c0dfc97403dc0f3a3b63e731903e6)
    (cherry picked from commit 9d9441ad4aba71f1e2bf854cc7dd6520dd9a5214)

diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx 
b/ucb/source/ucp/ftp/ftpcontent.cxx
index 93cf2bf2b82f..a9f9fb613f49 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -64,6 +64,7 @@
 #include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
 #include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
+#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
 #include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp>
 #include <com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp>
 #include <com/sun/star/ucb/InteractiveIOException.hpp>
@@ -226,6 +227,7 @@ enum ACTION { NOACTION,
               THROWAUTHENTICATIONREQUEST,
               THROWACCESSDENIED,
               THROWINTERACTIVECONNECT,
+              THROWMALFORMED,
               THROWRESOLVENAME,
               THROWQUOTE,
               THROWNOFILE,
@@ -342,6 +344,15 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
                         Environment);
                     break;
                 }
+            case THROWMALFORMED:
+                {
+                    IllegalIdentifierException ex;
+                    aRet <<= ex;
+                    ucbhelper::cancelCommandExecution(
+                        aRet,
+                        Environment);
+                    break;
+                }
             case THROWRESOLVENAME:
                 {
                     InteractiveNetworkResolveNameException excep;
@@ -536,6 +547,10 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
         {
             if(e.code() == CURLE_COULDNT_CONNECT)
                 action = THROWINTERACTIVECONNECT;
+            else if (e.code() == CURLE_URL_MALFORMAT)
+            {
+                action = THROWMALFORMED;
+            }
             else if(e.code() == CURLE_COULDNT_RESOLVE_HOST )
                 action = THROWRESOLVENAME;
             else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT ||
commit dd5cea5709874c128216c08471ba57b0eae828be
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Nov 27 09:08:37 2019 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon May 15 14:10:21 2023 +0200

    more UCB test more robust on my system
    
    ever since a system update, this test receives an
    
    IllegalIdentifierException thrown by
        ContentProvider::queryContent
    in
        ucb/source/ucp/webdav-neon/webdavprovider.cxx
    
    Given that
    (1) On a system where the test passes, no IllegalArgumentException is
    thrown
    (2) Comment in the test indicates that the test should be run with proxy
    enabled, which is not the case in our build
    (3) I am running with a system proxy enabled
    (4) the IllegalIdentifierException looks quite valid
    
    I suspect that I am the victim of a dodgy test and some new proxy
    behaviour in Fedora31.
    
    Change-Id: Id3fb3499a44b5672e4eed0a2749dc287d6e7a3cc
    Reviewed-on: https://gerrit.libreoffice.org/83853
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit 649a37f1f4048eb10303b6d1a46050234807f8ce)
    (cherry picked from commit dbe0b3c93fffd5093a606a3f95cde1b344cb34d7)

diff --git a/ucb/qa/complex/ucb/UCB.java b/ucb/qa/complex/ucb/UCB.java
index ddaac8790297..2a3b1acbc58d 100644
--- a/ucb/qa/complex/ucb/UCB.java
+++ b/ucb/qa/complex/ucb/UCB.java
@@ -117,10 +117,11 @@ public class UCB  {
 
             System.out.println("now executing open");
             executeCommand(content, "open", aArg);
-            fail("Expected 'IllegalArgumentException' was not thrown.");
+            fail("Expected exception 'IllegalArgumentException' or 
'IllegalIdentifierException' was not thrown.");
         } catch (com.sun.star.lang.IllegalArgumentException ex) {
-            //TODO error message;
-            System.out.println("Correct exception thrown: " + 
ex.getClass().toString());
+            // correct
+        } catch (com.sun.star.ucb.IllegalIdentifierException ex) {
+            // correct
         } catch(com.sun.star.ucb.InteractiveNetworkException ex) {
             System.out.println("This Exception is correctly thrown when no 
Proxy in StarOffice is used.");
             System.out.println("To reproduce the bug behaviour, use a Proxy 
and try again.");

Reply via email to