You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2020/07/20 17:32:29 UTC

[cxf] branch 3.3.x-fixes updated (a309fda -> e9b429f)

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a change to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from a309fda  Recording .gitmergeinfo Changes
     new fb141c6  [CXF-8281]add a test for using Chinese as attachment file name
     new e9b429f  [CXF-8318]NullPointerException in PrettyLoggingFilter

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:
 .../cxf/ext/logging/event/PrettyLoggingFilter.java |   1 +
 .../apache/cxf/systest/mtom/ClientMtomXopTest.java |  37 +++++++++++++++++++++
 .../test/resources/\346\265\213\350\257\225.bmp"   | Bin
 3 files changed, 38 insertions(+)
 copy systests/uncategorized/src/test/resources/me.bmp => "systests/uncategorized/src/test/resources/\346\265\213\350\257\225.bmp" (100%)


[cxf] 02/02: [CXF-8318]NullPointerException in PrettyLoggingFilter

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit e9b429f3e965631ae80c49b6806feef0bf3cdbad
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Mon Jul 20 13:31:20 2020 -0400

    [CXF-8318]NullPointerException in PrettyLoggingFilter
    
    (cherry picked from commit 9d6e9ab732fd139a70cd25d19ecf04ac91b2d52c)
---
 .../main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
index bc17418..e400ac3 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
@@ -58,6 +58,7 @@ public class PrettyLoggingFilter implements LogEventSender {
             && contentType != null 
             && contentType.indexOf("xml") >= 0
             && contentType.toLowerCase().indexOf("multipart/related") < 0
+            && event.getPayload() != null
             && event.getPayload().length() > 0;
     }
 


[cxf] 01/02: [CXF-8281]add a test for using Chinese as attachment file name

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit fb141c6841f5eff628d19342f97573ff19b9aefc
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Thu Jul 9 07:48:22 2020 -0400

    [CXF-8281]add a test for using Chinese as attachment file name
    
    (cherry picked from commit 247835a2a4babb280bead861f102450f2e62f6a4)
---
 .../apache/cxf/systest/mtom/ClientMtomXopTest.java |  37 +++++++++++++++++++++
 .../test/resources/\346\265\213\350\257\225.bmp"   | Bin 0 -> 163166 bytes
 2 files changed, 37 insertions(+)

diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
index 16a0a2b..e96a21f 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
@@ -358,6 +358,43 @@ public class ClientMtomXopTest extends AbstractBusClientServerTestBase {
     }
 
     @Test
+    public void testMtomWithChineseFileName() throws Exception {
+        TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class, true, true);
+        try {
+            Holder<DataHandler> param = new Holder<>();
+            Holder<String> name;
+
+            URL fileURL = getClass().getClassLoader().getResource("测试.bmp");
+
+            Object[] validationTypes = new Object[]{Boolean.TRUE, SchemaValidationType.IN, SchemaValidationType.BOTH};
+            for (Object validationType : validationTypes) {
+                ((BindingProvider)mtomPort).getRequestContext().put(Message.SCHEMA_VALIDATION_ENABLED,
+                                                                    validationType);
+                param.value = new DataHandler(fileURL);
+                name = new Holder<>("have name");
+                mtomPort.testXop(name, param);
+               
+                assertEquals("can't get file name", "return detail   测试.bmp", java.net.URLDecoder.decode(name.value));
+                assertNotNull(param.value);
+            }
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        } catch (Exception ex) {
+            if (ex.getMessage().contains("Connection reset")
+                && System.getProperty("java.specification.version", "1.5").contains("1.6")) {
+                //There seems to be a bug/interaction with Java 1.6 and Jetty where
+                //Jetty will occasionally send back a RST prior to all the data being
+                //sent back to the client when using localhost (which is what we do)
+                //we'll ignore for now
+                return;
+            }
+            System.out.println(System.getProperties());
+            ex.printStackTrace();
+            throw ex;
+        }
+    }
+    
+    @Test
     public void testMtomWithFileName() throws Exception {
         TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class, true, true);
         try {
diff --git "a/systests/uncategorized/src/test/resources/\346\265\213\350\257\225.bmp" "b/systests/uncategorized/src/test/resources/\346\265\213\350\257\225.bmp"
new file mode 100755
index 0000000..800c536
Binary files /dev/null and "b/systests/uncategorized/src/test/resources/\346\265\213\350\257\225.bmp" differ