Open
Conversation
reta
reviewed
Nov 11, 2023
| IOUtils.copyAndCloseInput(in, bos); | ||
| String result = bos.toString(); | ||
| assertTrue("Expect the SOAPService", result.indexOf("<service name=\"SOAPService\">") > 0); | ||
| assertTrue("Expect the SOAPService", result.indexOf("<service name=\"SOAPService\">") > 0 |
Member
There was a problem hiding this comment.
This might be an issue I believe, CXF should return consistent response (either qualified or unqualified namespaces), the test should not try to adapt to that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed the flaky test
testGetWsdlinsideNettyServerTest.javaclass.cxf/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java
Line 86 in 3048785
Root Cause
The test
testGetWsdlhas been reported as flaky when run with the NonDex tool. The test failed because it is trying to find if a certain element(<service name"SOAPService">) is present inside the XML file which is returned by calling WSDL service. But there is slight change in the content of XML returned by the service. For example, in some cases the XML returned contained elements with:wsdlprefix. So instead of<service name"SOAPService">, the XML content contained<wsdl:service name"SOAPService">. As a result the test is failed.Fix
After debugging the code, it is clear that XML content with
wsdl:prefix, means that the elements are qualified by the namespace, and when you see the same tags without the prefix, the XML is still using the WSDL namespace, but it's defined as the default namespace, so the prefix is not necessary. So, the test is fixed by adding a condition to check if the element withwsdl:is present.How this has been tested?
Java: openjdk version "11.0.20.1"
Maven: Apache Maven 3.6.3
Command used -
Command used -
Command used -
NonDex test passed after the fix.