citrusframework / citrus-samples

Citrus sample projects using Java DSL tests and Spring Java configuration
https://citrusframework.org/samples/
71 stars 125 forks source link

Update run page #58

Open nodermatt opened 3 years ago

nodermatt commented 3 years ago

The how to run page states to run one can use the -Dembedded switch: mvn clean install -Dembedded=true

This didn't work for me and during my research for a solution I stumbled upon a SO post (by yours truly Christoph ;)) that suggested to use another switch: mvn clean install -Dsystem.under.test.mode=embedded -fae

If you can point me to the file, I'll open a PR to update the page.

On another note, I had to build the todo app separately first: mvn clean install -pl :citrus-sample-todo

because when I ran mvn clean install as suggested in the page, I got a a test failure in the bakery-web module. It seems that the the connection to the app couldn't be established. Not sure what was the problem there. I ran the tests for the http-samples directly which went fine.

mvn clean install -pl :citrus-sample-http -Dsystem.under.test.mode=embedded

[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:verify (integration-tests) @ citrus-sample-http ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ citrus-sample-http ---
[INFO] Installing C:\Users\oderm\IdeaProjects\citrus-samples\samples-http\sample-http\target\citrus-sample-http-3.0.0-M2.jar to C:\Users\oderm\.m2\repository\com\consol\citrus\samples\citrus-sample-http\3.0.0-M2\citrus-sample-http-3
.0.0-M2.jar
[INFO] Installing C:\Users\oderm\IdeaProjects\citrus-samples\samples-http\sample-http\pom.xml to C:\Users\oderm\.m2\repository\com\consol\citrus\samples\citrus-sample-http\3.0.0-M2\citrus-sample-http-3.0.0-M2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  32.620 s
[INFO] Finished at: 2021-01-30T14:48:55+01:00
[INFO] ------------------------------------------------------------------------

mvn clean install output:

14:43:32,447 INFO  port.LoggingReporter|
14:43:32,447 INFO  port.LoggingReporter| TOTAL: 4
14:43:32,447 DEBUG port.LoggingReporter| SKIPPED:       0 (0.0%)
14:43:32,447 INFO  port.LoggingReporter| FAILED:        4 (100.0%)
14:43:32,447 INFO  port.LoggingReporter| SUCCESS:       0 (0.0%)
14:43:32,448 INFO  port.LoggingReporter|
14:43:32,448 INFO  port.LoggingReporter| ------------------------------------------------------------------------
14:43:32,448 DEBUG  report.HtmlReporter| Generating HTML test report
14:43:32,450 DEBUG       util.FileUtils| Reading file resource: 'test-detail.html' (encoding is 'windows-1252')
14:43:32,506 DEBUG       util.FileUtils| Reading file resource: 'test-report.html' (encoding is 'windows-1252')
14:43:32,511 INFO  ctOutputFileReporter| Generated test report: target\citrus-reports\citrus-test-results.html
14:43:32,512 DEBUG report.JUnitReporter| Generating JUnit test report
14:43:32,533 DEBUG       util.FileUtils| Reading file resource: 'junit-test-failed.xml' (encoding is 'windows-1252')
14:43:32,566 DEBUG       util.FileUtils| Reading file resource: 'junit-report.xml' (encoding is 'windows-1252')
[ERROR] Tests run: 4, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 18.055 s <<< FAILURE! - in TestSuite
[ERROR] routeMessagesContentBased(com.consol.citrus.samples.bakery.RouteMessagesHttpIT)  Time elapsed: 4.4 s  <<< FAILURE!
com.consol.citrus.exceptions.TestCaseFailedException: I/O error on POST request for "http://localhost:18001/bakery/services/order": Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refus
ed: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeMessagesContentBased(RouteMessagesHttpIT.java:55)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost:18001/bakery/services/order": Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Con
nection refused: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeMessagesContentBased(RouteMessagesHttpIT.java:55)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeMessagesContentBased(RouteMessagesHttpIT.java:55)
Caused by: java.net.ConnectException: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeMessagesContentBased(RouteMessagesHttpIT.java:55)

[ERROR] routeUnknownOrderType(com.consol.citrus.samples.bakery.RouteMessagesHttpIT)  Time elapsed: 3.878 s  <<< FAILURE!
com.consol.citrus.exceptions.TestCaseFailedException: I/O error on POST request for "http://localhost:18001/bakery/services/order": Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refus
ed: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeUnknownOrderType(RouteMessagesHttpIT.java:109)
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost:18001/bakery/services/order": Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Con
nection refused: connect; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeUnknownOrderType(RouteMessagesHttpIT.java:109)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:18001 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeUnknownOrderType(RouteMessagesHttpIT.java:109)
Caused by: java.net.ConnectException: Connection refused: connect
        at com.consol.citrus.samples.bakery.RouteMessagesHttpIT.routeUnknownOrderType(RouteMessagesHttpIT.java:109)

[ERROR] routeMessagesContentBased(com.consol.citrus.samples.bakery.RouteMessagesJmsIT)  Time elapsed: 1.789 s  <<< FAILURE!
com.consol.citrus.exceptions.TestCaseFailedException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.Conne
ctException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeMessagesContentBased(RouteMessagesJmsIT.java:51)
Caused by: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.n
et.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeMessagesContentBased(RouteMessagesJmsIT.java:51)
Caused by: javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeMessagesContentBased(RouteMessagesJmsIT.java:51)
Caused by: java.net.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeMessagesContentBased(RouteMessagesJmsIT.java:51)

[ERROR] routeUnknownOrderType(com.consol.citrus.samples.bakery.RouteMessagesJmsIT)  Time elapsed: 2.399 s  <<< FAILURE!
com.consol.citrus.exceptions.TestCaseFailedException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.Conne
ctException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeUnknownOrderType(RouteMessagesJmsIT.java:78)
Caused by: org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.n
et.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeUnknownOrderType(RouteMessagesJmsIT.java:78)
Caused by: javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeUnknownOrderType(RouteMessagesJmsIT.java:78)
Caused by: java.net.ConnectException: Connection refused: no further information
        at com.consol.citrus.samples.bakery.RouteMessagesJmsIT.routeUnknownOrderType(RouteMessagesJmsIT.java:78)

14:43:33,677 DEBUG icApplicationContext| Closing org.springframework.context.support.GenericApplicationContext@15043a2f, started on Sat Jan 30 14:43:17 CET 2021
14:43:33,679 DEBUG ntLifecycleProcessor| Destroying component 'workerChocolateEndpoint'
14:43:33,679 DEBUG ntLifecycleProcessor| Destroying component 'workerBlueberryEndpoint'
14:43:33,679 DEBUG ntLifecycleProcessor| Destroying component 'workerCaramelEndpoint'
14:43:33,679 DEBUG ntLifecycleProcessor| Destroying component 'bakeryOrderEndpoint'
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures: 
[ERROR]   RouteMessagesHttpIT>TestNGCitrusTest.run:58->TestNGCitrusTest.run:109->TestNGCitrusTest.invokeTestMethod:130 » TestCaseFailed
[ERROR]   RouteMessagesHttpIT>TestNGCitrusTest.run:58->TestNGCitrusTest.run:109->TestNGCitrusTest.invokeTestMethod:130 » TestCaseFailed
[ERROR]   RouteMessagesJmsIT>TestNGCitrusTest.run:58->TestNGCitrusTest.run:109->TestNGCitrusTest.invokeTestMethod:130 » TestCaseFailed
[ERROR]   RouteMessagesJmsIT>TestNGCitrusTest.run:58->TestNGCitrusTest.run:109->TestNGCitrusTest.invokeTestMethod:130 » TestCaseFailed
[INFO]
[ERROR] Tests run: 4, Failures: 4, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:verify (integration-tests) @ citrus-bakery-web ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Citrus Samples:: Parent 3.0.0-M2:
[INFO]
[INFO] Citrus Samples:: Bakery ............................ SUCCESS [  0.458 s]
[INFO] Citrus Samples:: Bakery Web ........................ FAILURE [ 29.459 s]
[INFO] Citrus Samples:: Bakery Worker ..................... SKIPPED
[INFO] Citrus Samples:: Bakery Report ..................... SKIPPED
[INFO] Citrus Samples:: Bakery Integration ................ SKIPPED
[INFO] Citrus Samples:: Java EE ........................... SKIPPED
[INFO] Citrus Samples:: Flightbooking ..................... SKIPPED
[INFO] Citrus Samples:: Greeting: Java .................... SKIPPED
[INFO] Citrus Samples:: Bookstore ......................... SKIPPED
[INFO] Citrus Samples:: Incident .......................... SKIPPED
[INFO] Citrus Samples:: Demos ............................. SKIPPED
[INFO] Citrus Samples:: Todo App .......................... SKIPPED
[INFO] Citrus Samples:: Apache Camel Context .............. SKIPPED
[INFO] Citrus Samples:: Behaviors ......................... SKIPPED
[INFO] Citrus Samples:: Dictionaries ...................... SKIPPED
[INFO] Citrus Samples:: Message Store ..................... SKIPPED
[INFO] Citrus Samples:: Docker ............................ SKIPPED
[INFO] Citrus Samples:: Kubernetes ........................ SKIPPED
[INFO] Citrus Samples:: Cucumber BDD ...................... SKIPPED
[INFO] Citrus Samples:: Cucumber BDD Spring ............... SKIPPED
[INFO] Citrus Samples:: Cucumber BDD Spring 2 ............. SKIPPED
[INFO] Citrus Samples:: Cucumber Samples .................. SKIPPED
[INFO] Citrus Samples:: Annotation Config ................. SKIPPED
[INFO] Citrus Samples:: Java Config ....................... SKIPPED
[INFO] Citrus Samples:: Mail .............................. SKIPPED
[INFO] Citrus Samples:: Selenium .......................... SKIPPED
[INFO] Citrus Samples:: FTP ............................... SKIPPED
[INFO] Citrus Samples:: SFTP .............................. SKIPPED
[INFO] Citrus Samples:: SCP ............................... SKIPPED
[INFO] Citrus Samples:: FTP Samples ....................... SKIPPED
[INFO] Citrus Samples:: TestNG ............................ SKIPPED
[INFO] Citrus Samples:: Dataprovider ...................... SKIPPED
[INFO] Citrus Samples:: TestNG Samples .................... SKIPPED
[INFO] Citrus Samples:: JUnit ............................. SKIPPED
[INFO] Citrus Samples:: JUnit5 ............................ SKIPPED
[INFO] Citrus Samples:: JUnit Samples ..................... SKIPPED
[INFO] Citrus Samples:: Http :: Swagger API ............... SKIPPED
[INFO] Citrus Samples:: Http .............................. SKIPPED
[INFO] Citrus Samples:: Http Loadtest ..................... SKIPPED
[INFO] Citrus Samples:: Http Static Response .............. SKIPPED
[INFO] Citrus Samples:: Http Query Parameter .............. SKIPPED
[INFO] Citrus Samples:: Http Form Data .................... SKIPPED
[INFO] Citrus Samples:: Http Basic Auth ................... SKIPPED
[INFO] Citrus Samples:: Https ............................. SKIPPED
[INFO] Citrus Samples:: Http Samples ...................... SKIPPED
[INFO] Citrus Samples:: RMI ............................... SKIPPED
[INFO] Citrus Samples:: Reporting ......................... SKIPPED
[INFO] Citrus Samples:: XHTML ............................. SKIPPED
[INFO] Citrus Samples:: XML ............................... SKIPPED
[INFO] Citrus Samples:: OXM ............................... SKIPPED
[INFO] Citrus Samples:: XML Samples ....................... SKIPPED
[INFO] Citrus Samples:: JSON .............................. SKIPPED
[INFO] Citrus Samples:: Databind .......................... SKIPPED
[INFO] Citrus Samples:: Json Samples ...................... SKIPPED
[INFO] Citrus Samples:: Hamcrest .......................... SKIPPED
[INFO] Citrus Samples:: JMS ............................... SKIPPED
[INFO] Citrus Samples:: Kafka ............................. SKIPPED
[INFO] Citrus Samples:: Dynamic Endpoints ................. SKIPPED
[INFO] Citrus Samples:: Binary ............................ SKIPPED
[INFO] Citrus Samples:: WSDL .............................. SKIPPED
[INFO] Citrus Samples:: SOAP .............................. SKIPPED
[INFO] Citrus Samples:: SOAP MTOM ......................... SKIPPED
[INFO] Citrus Samples:: SOAP Attachments .................. SKIPPED
[INFO] Citrus Samples:: SOAP WsSecurity ................... SKIPPED
[INFO] Citrus Samples:: SOAP WsAddressing ................. SKIPPED
[INFO] Citrus Samples:: SOAP SSL .......................... SKIPPED
[INFO] Citrus Samples:: SOAP Static Response .............. SKIPPED
[INFO] Citrus Samples:: SOAP Samples ...................... SKIPPED
[INFO] Citrus Samples:: SQL ............................... SKIPPED
[INFO] Citrus Samples:: JDBC .............................. SKIPPED
[INFO] Citrus Samples:: JDBC Transactions ................. SKIPPED
[INFO] Citrus Samples:: JDBC Callable Statements .......... SKIPPED
[INFO] Citrus Samples:: DB Samples ........................ SKIPPED
[INFO] Citrus Samples:: Test JAR .......................... SKIPPED
[INFO] Citrus Samples:: Test WAR .......................... SKIPPED
[INFO] Citrus Samples:: Remote Samples .................... SKIPPED
[INFO] Citrus Samples:: Parent ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  31.650 s
[INFO] Finished at: 2021-01-30T14:43:34+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.2:verify (integration-tests) on project citrus-bakery-web: There are test failures.