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

Carlos Sierra commented on CXF-7614:
------------------------------------

hi Sergey,

in my current working copy of CXF's master, if I add the line:
{code:java}
sf.setStaticSubresourceResolution(true);{code}
to _org.apache.cxf.systest.jaxrs.BookServer#run_, just after setting the bus, 
then the following tests fail:
{code:java}
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRS20ClientServerBookTest
[INFO] Tests run: 43, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.239 s 
- in org.apache.cxf.systest.jaxrs.JAXRS20ClientServerBookTest
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSAsyncClientTest
[INFO] Tests run: 18, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 104.531 
s - in org.apache.cxf.systest.jaxrs.JAXRSAsyncClientTest
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSAtomBookTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.143 s 
- in org.apache.cxf.systest.jaxrs.JAXRSAtomBookTest
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest
[org.apache.cxf.systest.jaxrs.Book@1f1e58ca, 
org.apache.cxf.systest.jaxrs.Book@1f1e58ca]
[ERROR] Tests run: 219, Failures: 2, Errors: 1, Skipped: 0, Time elapsed: 
31.724 s <<< FAILURE! - in 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest
[ERROR] 
testGetBook123FromSubObject(org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest)
  Time elapsed: 0.009 s  <<< FAILURE!
java.lang.AssertionError: expected:<200> but was:<404>
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.getAndCompare(JAXRSClientServerBookTest.java:2755)
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.getAndCompareAsStrings(JAXRSClientServerBookTest.java:2733)
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.testGetBook123FromSubObject(JAXRSClientServerBookTest.java:2183)

[ERROR] 
testUseParamBeanWebClientSubResource(org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest)
  Time elapsed: 0.003 s  <<< ERROR!
javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.doTestUseParamBeanWebClient(JAXRSClientServerBookTest.java:418)
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.testUseParamBeanWebClientSubResource(JAXRSClientServerBookTest.java:406)

[ERROR] 
testUriInfoMatchedResourcesWithObject(org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest)
  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: expected:<200> but was:<404>
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.getAndCompare(JAXRSClientServerBookTest.java:2755)
    at 
org.apache.cxf.systest.jaxrs.JAXRSClientServerBookTest.testUriInfoMatchedResourcesWithObject(JAXRSClientServerBookTest.java:2615)

[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSClientServerNonSpringBookTest
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.295 s 
- in org.apache.cxf.systest.jaxrs.JAXRSClientServerNonSpringBookTest
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSClientServerODataSearchTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.145 s 
- in org.apache.cxf.systest.jaxrs.JAXRSClientServerODataSearchTest
[INFO] Running org.apache.cxf.systest.jaxrs.JAXRSClientServerProxySpringBookTest
PreDestroy called{code}
precisely the one that you mentioned.

If I remove that line from _org.apache.cxf.systest.jaxrs.BookServer#run_ then 
the tests pass.

Don't you get the same output?

I guess this would be a bug then, as you mentioned.

> DynamicFeature is not invoked for sub resources
> -----------------------------------------------
>
>                 Key: CXF-7614
>                 URL: https://issues.apache.org/jira/browse/CXF-7614
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.2
>            Reporter: Carlos Sierra
>            Priority: Major
>
> According to the javadoc of DynamicFeature the callback method is to be 
> invoked for relevant methods in resource or sub-resources. In the current 
> implementation methods on sub-resource are NOT being invoked.
> {code:java}
> public class ResourceWithSubResource {
>     @Path("/resource1")
>     public SubResource getResource() {
>         return new SubResource("Resource1: ");
>     }
> }{code}
> {code:java}
> public class SubResource {
>     public SubResource(String param) {
>         _param = param;
>     }
>     @GET
>     public String getParam() {
>         return "Returning: " + _param;
>     }
>     @Path("/{path}")
>     public SubResource subPath(@PathParam("path") String subPath) {
>         return new SubResource(_param + "-" + subPath);
>     }
>     private String _param;
> }
> {code}
> in the provided example a _DynamicFeature_ is only invoked for 
> _getResource()_ and it should also be invoked for relevant methods in 
> _SubResource_.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to