You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (JIRA)" <ji...@apache.org> on 2017/01/27 12:24:24 UTC

[jira] [Comment Edited] (CXF-7229) ClassHelper usages not replacable by ClassUnwrapper

    [ https://issues.apache.org/jira/browse/CXF-7229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15842680#comment-15842680 ] 

Andriy Redko edited comment on CXF-7229 at 1/27/17 12:23 PM:
-------------------------------------------------------------

Hey Sergey,

Sorry, the 'prototype' is not important here, but the test case fails right now because of the instance of book class, the message body writer (Jackson) returns JSON-serialized proxy class instance (the JUnit assert shows that).

{code:java}
org.junit.ComparisonFailure: expected:<{[ "title": "Sample Book"]}> but was:<{["title":"Sample Book","frozen":false,"targetClass":"org.apache.cxf.systest.jaxrs.spring.Book","targetSource":{"target":{"title":"Sample Book"},"static":true,"targetClass":"org.apache.cxf.systest.jaxrs.spring.Book"},"exposeProxy":true,"proxiedInterfaces":[],"proxyTargetClass":false,"preFiltered":false,"advisors":[]]}>
{code}

Another interesting edge case is usage of annotations: the Book instance is annotated using @JsonIgnore for `id` field. However the test case does not progress to this point yet due to improper serialization.

Thanks.

Best Regards,
    Andriy Redko


was (Author: reta):
Hey Sergey,

Sorry, the 'prototype' is not important here, but the test case fails right now because of the instance of book class, the message body writer (Jackson) returns JSON-serialized proxy class instance (the JUnit assert shows that).

{code:java}
org.junit.ComparisonFailure: expected:<{[ "title": "Sample Book"]}> but was:<{["title":"Sample Book","frozen":false,"targetClass":"org.apache.cxf.systest.jaxrs.spring.Book","targetSource":{"target":{"title":"Sample Book"},"static":true,"targetClass":"org.apache.cxf.systest.jaxrs.spring.Book"},"exposeProxy":true,"proxiedInterfaces":[],"proxyTargetClass":false,"preFiltered":false,"advisors":[]]}>
{code:java}

Another interesting edge case is usage of annotations: the Book instance is annotated using @JsonIgnore for `id` field. However the test case does not progress to this point yet due to improper serialization.

Thanks.

Best Regards,
    Andriy Redko

> ClassHelper usages not replacable by ClassUnwrapper
> ---------------------------------------------------
>
>                 Key: CXF-7229
>                 URL: https://issues.apache.org/jira/browse/CXF-7229
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Romain Manni-Bucau
>            Assignee: Andriy Redko
>         Attachments: proxy-test-case.txt
>
>
> ClassUnwrapper and ClassHelper are pretty close and for an app setting a single one should be enough (in particular cause ClassHelper overriding is hacky)
> Spotted org.apache.cxf.jaxrs.utils.InjectionUtils#getRawResponseClass for instance



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)