Re: [PR] CXF-SOAP: Cover possible regression prior CXF fix causing indefinitive hang [camel-quarkus]

2024-02-01 Thread via GitHub


zhfeng merged PR #5685:
URL: https://github.com/apache/camel-quarkus/pull/5685


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CXF-SOAP: Cover possible regression prior CXF fix causing indefinitive hang [camel-quarkus]

2024-02-01 Thread via GitHub


JiriOndrusek commented on PR #5685:
URL: https://github.com/apache/camel-quarkus/pull/5685#issuecomment-1921589075

   PR is rebased the dependency `camel-test-junit5` removed


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CXF-SOAP: Cover possible regression prior CXF fix causing indefinitive hang [camel-quarkus]

2024-02-01 Thread via GitHub


JiriOndrusek commented on code in PR #5685:
URL: https://github.com/apache/camel-quarkus/pull/5685#discussion_r1474549753


##
integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java:
##
@@ -86,6 +99,57 @@ void wsdlUpToDate() throws IOException {
 Assertions.fail("The static WSDL copy in " + staticCopyPath
 + " went out of sync with the WSDL served by the 
container. The content was updated by the test, you just need to review and 
commit the changes.");
 }
+}
+
+/**
+ * In case of the wrong security configuration and before this
+ * https://github.com/jboss-fuse/cxf/pull/496;>fix
+ * in CXF (can be simulated on camel-quarkus tag 3.0.0-RC2), the client 
would hang indefinitely.
+ * This tests covers such wrong configuration and verifies that no 
regression causing indefinite hang is present in
+ * the current code.
+ */
+@Test
+@DisabledOnIntegrationTest("Test doesn't have native part, no server for 
SayHello.wsdl exists")
+public void testWrongClientNotHanging() {
 
+Awaitility.await().atMost(30, TimeUnit.SECONDS).pollInterval(10, 
TimeUnit.SECONDS).until(() -> {
+try {
+//always fails because there is no server implementation
+createSayHelloWrongClient().sayHelloWrong("Sheldon");
+} catch (SOAPFaultException e) {
+return "Connection refused".equals(e.getMessage());
+}
+//can not happen (client does not work)
+return false;
+});
 }
+
+SayHelloWrongWS createSayHelloWrongClient() {
+
+final URL serviceUrl = 
Thread.currentThread().getContextClassLoader().getResource("wsdl/HelloWorld.wsdl");
+final Service service = Service.create(serviceUrl, 
SayHelloService.SERVICE);
+
+SayHelloWrongWS port = service.getPort(SayHelloWrongWS.class);
+BindingProvider bp = (BindingProvider) port;
+
+Map requestContext = bp.getRequestContext();
+
+//non-existing server url is used
+requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+String.format("http://localhost:%d/soapservice/sayHelloWrong;, 
AvailablePortFinder.getNextAvailable()));

Review Comment:
   I understand your point. I used the next available port just to be sure that 
the port is really not used. Maybe it is not necessary. I'll remove the 
dependency and hardcode a fixed value



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CXF-SOAP: Cover possible regression prior CXF fix causing indefinitive hang [camel-quarkus]

2024-02-01 Thread via GitHub


jamesnetherton commented on PR #5685:
URL: https://github.com/apache/camel-quarkus/pull/5685#issuecomment-1921224172

   @JiriOndrusek do you mind rebasing on latest `main` just to check it with 
the latest upgrades.
   
   I left an optional nitpick comment too.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] CXF-SOAP: Cover possible regression prior CXF fix causing indefinitive hang [camel-quarkus]

2024-02-01 Thread via GitHub


jamesnetherton commented on code in PR #5685:
URL: https://github.com/apache/camel-quarkus/pull/5685#discussion_r1474387842


##
integration-test-groups/cxf-soap/cxf-soap-ws-security-client/src/test/java/org/apache/camel/quarkus/component/cxf/soap/wss/client/it/CxfSoapWssClientTest.java:
##
@@ -86,6 +99,57 @@ void wsdlUpToDate() throws IOException {
 Assertions.fail("The static WSDL copy in " + staticCopyPath
 + " went out of sync with the WSDL served by the 
container. The content was updated by the test, you just need to review and 
commit the changes.");
 }
+}
+
+/**
+ * In case of the wrong security configuration and before this
+ * https://github.com/jboss-fuse/cxf/pull/496;>fix
+ * in CXF (can be simulated on camel-quarkus tag 3.0.0-RC2), the client 
would hang indefinitely.
+ * This tests covers such wrong configuration and verifies that no 
regression causing indefinite hang is present in
+ * the current code.
+ */
+@Test
+@DisabledOnIntegrationTest("Test doesn't have native part, no server for 
SayHello.wsdl exists")
+public void testWrongClientNotHanging() {
 
+Awaitility.await().atMost(30, TimeUnit.SECONDS).pollInterval(10, 
TimeUnit.SECONDS).until(() -> {
+try {
+//always fails because there is no server implementation
+createSayHelloWrongClient().sayHelloWrong("Sheldon");
+} catch (SOAPFaultException e) {
+return "Connection refused".equals(e.getMessage());
+}
+//can not happen (client does not work)
+return false;
+});
 }
+
+SayHelloWrongWS createSayHelloWrongClient() {
+
+final URL serviceUrl = 
Thread.currentThread().getContextClassLoader().getResource("wsdl/HelloWorld.wsdl");
+final Service service = Service.create(serviceUrl, 
SayHelloService.SERVICE);
+
+SayHelloWrongWS port = service.getPort(SayHelloWrongWS.class);
+BindingProvider bp = (BindingProvider) port;
+
+Map requestContext = bp.getRequestContext();
+
+//non-existing server url is used
+requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+String.format("http://localhost:%d/soapservice/sayHelloWrong;, 
AvailablePortFinder.getNextAvailable()));

Review Comment:
   Nitpick - if we don't actually care about the server URL, can we just hard 
code the port to any value? If so we can remove the dependency on 
`camel-test-junit5`.
   
   



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org