[GitHub] [cxf] ropalka opened a new pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] ropalka opened a new pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox

ropalka opened a new pull request #718:
URL: https://github.com/apache/cxf/pull/718


   Fixes https://issues.apache.org/jira/browse/CXF-8361


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] reta edited a comment on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox

reta edited a comment on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-720858753


   Thanks for the PR, @ropalka , could you please add  test cases for the change to `AnnotationHandlerChainBuilderTest`, thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] reta commented on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

reta commented on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-720858753


   Thanks for the PR, @ropalka , could you please add a test cases for the change to `AnnotationHandlerChainBuilderTest`, thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] ropalka commented on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

ropalka commented on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-737844708


   Hello @reta - it is not possible to add test for that because Apache CXF is using javax JAXB impl
   and if I would provide test for that parsing, then jakarta JAXB impl should be used.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] reta commented on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

reta commented on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-738478861


   >
   >
   > Hello @reta - it is not possible to add test for that because Apache CXF is using javax JAXB impl
   > and if I would provide test for that parsing, then jakarta JAXB impl should be used.
   
   Sadly full-fledged tests would be difficult to introduce, at least we could verify the namespace element is properly handled in case of empty handler chain,  not idea but better than nothing.  A few changes in `AnnotationHandlerChainBuilderTest.java`:
   
   ```
       @Test
       public void testJakartaFindEmptyHandlerChainAnnotation() {
           JakartaHandlerTestImpl handlerTestImpl = new JakartaHandlerTestImpl();
           AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder();
           @SuppressWarnings("rawtypes")
           List<Handler> handlers = chainBuilder
               .buildHandlerChainFromClass(handlerTestImpl.getClass(),
                                           null,
                                           null,
                                           null);
           assertNotNull(handlers);
           assertEquals(0, handlers.size());
       }
   
       @WebService()
       @HandlerChain(file = "./handlers-jakarta.xml", name = "TestHandlerChain")
       public class JakartaHandlerTestImpl {
       }
   ```
   
   Resource file `handlers-jakarta.xml`:
   
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <!--
                   Licensed to the Apache Software Foundation (ASF) under one or more
                   contributor license agreements. See the NOTICE file distributed with
                   this work for additional information regarding copyright ownership.
                   The ASF licenses this file to you under the Apache License, Version
                   2.0 (the "License"); you may not use this file except in compliance
                   with the License. You may obtain a copy of the License at
   
                   http://www.apache.org/licenses/LICENSE-2.0 Unless required by
                   applicable law or agreed to in writing, software distributed under the
                   License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
                   CONDITIONS OF ANY KIND, either express or implied. See the License for
                   the specific language governing permissions and limitations under the
                   License.
           -->
   <handler-chains xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:cfg="http://cxf.apache.org/configuration/cfg" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee">
       <handler-chain />
   </handler-chains>
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] reta edited a comment on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

reta edited a comment on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-738478861


   >
   >
   > Hello @reta - it is not possible to add test for that because Apache CXF is using javax JAXB impl
   > and if I would provide test for that parsing, then jakarta JAXB impl should be used.
   
   Sadly full-fledged tests would be difficult to introduce, at least we could verify the namespace element is properly handled in case of empty handler chain,  not idea but better than nothing.  A few changes in `AnnotationHandlerChainBuilderTest.java`:
   
   ```
       @Test
       public void testJakartaFindEmptyHandlerChainAnnotation() {
           JakartaHandlerTestImpl handlerTestImpl = new JakartaHandlerTestImpl();
           AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder();
           @SuppressWarnings("rawtypes")
           List<Handler> handlers = chainBuilder
               .buildHandlerChainFromClass(handlerTestImpl.getClass(),
                                           null,
                                           null,
                                           null);
           assertNotNull(handlers);
           assertEquals(0, handlers.size());
       }
   
       @WebService()
       @HandlerChain(file = "./handlers-jakarta.xml", name = "TestHandlerChain")
       public class JakartaHandlerTestImpl {
       }
   ```
   
   Resource file `handlers-jakarta.xml`:
   
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <!--
                   Licensed to the Apache Software Foundation (ASF) under one or more
                   contributor license agreements. See the NOTICE file distributed with
                   this work for additional information regarding copyright ownership.
                   The ASF licenses this file to you under the Apache License, Version
                   2.0 (the "License"); you may not use this file except in compliance
                   with the License. You may obtain a copy of the License at
   
                   http://www.apache.org/licenses/LICENSE-2.0 Unless required by
                   applicable law or agreed to in writing, software distributed under the
                   License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
                   CONDITIONS OF ANY KIND, either express or implied. See the License for
                   the specific language governing permissions and limitations under the
                   License.
           -->
   <handler-chains xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:cfg="http://cxf.apache.org/configuration/cfg" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee">
       <handler-chain />
   </handler-chains>
   ```
   
   Plus the cases you have added:
   
   ```
                   if (!isJavaEENamespace && !isJakartaEENamespace) {
                       throw new WebServiceException(
                           BundleUtils.getFormattedString(BUNDLE,
                                                          "NOT_VALID_NAMESPACE",
                                                          el.getNamespaceURI()));
                   }
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] ropalka commented on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

ropalka commented on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-738689753


   Done @reta - should I also prepare pull requests against 3.4.x-fixes & master branches ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [cxf] reta commented on pull request #718: [CXF-8361] Added support for jakarta NS in AnnotationHandlerChainBuilder

GitBox
In reply to this post by GitBox

reta commented on pull request #718:
URL: https://github.com/apache/cxf/pull/718#issuecomment-738795083


   Thank you @ropalka , for other branches we are going to backport the change, thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]