Some unit tests in the travel sample don't throw exceptions when they fail
--------------------------------------------------------------------------
Key: TUSCANY-3407
URL: https://issues.apache.org/jira/browse/TUSCANY-3407
Project: Tuscany
Issue Type: Bug
Components: Java SCA Travel Sample
Reporter: Simon Nash
Assignee: Simon Nash
The problem reported by TUSCANY-3406 did not cause the unit test for
contributions/payment-spring-policy to fail. An error message was printed to
stdout but the unit test returned with successful completion, as shown below.
Errors such as this should result in an exception or a failure return from the
unit test.
[junit] Testsuite: scatours.payment.PaymentTestCase
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 8.474 sec
[junit] ------------- Standard Output ---------------
[junit] - Module validation failed: The system is attempting to engage a
module that is not available: rampart
[junit] - Loading XML bean definitions from URL
[file:/E:/td/book/ts1/travelsample/contributions/payment-spring-policy/target/classes/Payment-context.xml]
[junit] - Module validation failed: The system is attempting to engage a
module that is not available: rampart
[junit] - Refreshing
org.apache.tuscany.sca.implementation.spring.runtime.context.springcontexttie$localgenericapplicationcont...@dea768:
display name
[org.apache.tuscany.sca.implementation.spring.runtime.context.springcontexttie$localgenericapplicationcont...@dea768];
startup date [Sun Jan 03 05:40:43 GMT 2010]; parent:
org.apache.tuscany.sca.implementation.spring.runtime.context.scaparentapplicationcont...@11126f6
[junit] - Bean factory for application context
[org.apache.tuscany.sca.implementation.spring.runtime.context.springcontexttie$localgenericapplicationcont...@dea768]:
org.springframework.beans.factory.xml.xmlbeanfact...@114ef62
[junit] Spring parent context - containsBean called for name: loadTimeWeaver
[junit] - Pre-instantiating singletons in
org.springframework.beans.factory.xml.xmlbeanfact...@114ef62: defining beans
[Payment]; parent:
org.apache.tuscany.sca.implementation.spring.runtime.context.scaparentapplicationcont...@11126f6
[junit] Spring parent context - getBean called for name:
creditCardPaymentReference
[junit] Spring parent context - getBean called for name: emailGateway
[junit] Spring parent context - getBean called for name: customerRegistry
[junit] Username: myname Password: mypassword
[junit] - I/O exception (java.net.ConnectException) caught when processing
request: Connection refused: connect
[junit] - Retrying request
[junit] - I/O exception (java.net.ConnectException) caught when processing
request: Connection refused: connect
[junit] - Retrying request
[junit] - I/O exception (java.net.ConnectException) caught when processing
request: Connection refused: connect
[junit] - Retrying request
[junit] - Unable to sendViaPost to
url[http://localhost:8083/CreditCardPayment]
[junit] java.net.ConnectException: Connection refused: connect
[junit] at java.net.PlainSocketImpl.socketConnect(Native Method)
[junit] at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
[junit] at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
[junit] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
[junit] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
[junit] at java.net.Socket.connect(Socket.java:519)
[junit] at java.net.Socket.connect(Socket.java:469)
[junit] at java.net.Socket.<init>(Socket.java:366)
[junit] at java.net.Socket.<init>(Socket.java:240)
[junit] at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
[junit] at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
[junit] at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
[junit] at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
[junit] at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
[junit] at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
[junit] at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
[junit] at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
[junit] at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
[junit] at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
[junit] at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
[junit] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
[junit] at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
[junit] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
[junit] at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
[junit] at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
[junit] at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
[junit] at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:172)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:170)
[junit] at
org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:124)
[junit] at
org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationReferencePolicyInterceptor.invoke(BasicAuthenticationReferencePolicyInterceptor.java:85)
[junit] at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:67)
[junit] at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:346)
[junit] at
org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:193)
[junit] at $Proxy44.authorize(Unknown Source)
[junit] at
com.tuscanyscatours.payment.impl.PaymentImpl.makePaymentMember(PaymentImpl.java:59)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:597)
[junit] at
org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.doInvoke(SpringInvoker.java:97)
[junit] at
org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.invoke(SpringInvoker.java:113)
[junit] at
org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:67)
[junit] at
org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationServicePolicyInterceptor.invoke(BasicAuthenticationServicePolicyInterceptor.java:82)
[junit] at
org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:129)
[junit] at
org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:104)
[junit] at
org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(RuntimeWireInvoker.java:98)
[junit] at
org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWireImpl.java:159)
[junit] at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.invokeTarget(Axis2ServiceProvider.java:760)
[junit] at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageReceiver.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:70)
[junit] at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
[junit] at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
[junit] at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
[junit] at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
[junit] at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
[junit] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
[junit] at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
[junit] at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
[junit] at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
[junit] at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
[junit] at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
[junit] at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
[junit] at org.mortbay.jetty.Server.handle(Server.java:324)
[junit] at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
[junit] at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
[junit] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
[junit] at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
[junit] at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
[junit] at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
[junit] at org.apache.tuscany.sca.core.work.Work.run(Work.java:63)
[junit] at
org.apache.tuscany.sca.core.work.ThreadPoolWorkManager$DecoratingWork.run(ThreadPoolWorkManager.java:215)
[junit] at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
[junit] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
[junit] at java.lang.Thread.run(Thread.java:619)
[junit] Result = Payment failed due to system error
org.apache.axis2.AxisFault: Connection refused: connect
[junit] - Closing
org.apache.tuscany.sca.implementation.spring.runtime.context.springcontexttie$localgenericapplicationcont...@dea768:
display name
[org.apache.tuscany.sca.implementation.spring.runtime.context.springcontexttie$localgenericapplicationcont...@dea768];
startup date [Sun Jan 03 05:40:43 GMT 2010]; parent:
org.apache.tuscany.sca.implementation.spring.runtime.context.scaparentapplicationcont...@11126f6
[junit] - Destroying singletons in
org.springframework.beans.factory.xml.xmlbeanfact...@114ef62: defining beans
[Payment]; parent:
org.apache.tuscany.sca.implementation.spring.runtime.context.scaparentapplicationcont...@11126f6
[junit] ------------- ---------------- ---------------
[junit] ------------- Standard Error -----------------
[junit] 03-Jan-2010 05:40:39 org.apache.tuscany.sca.node.impl.NodeImpl
<init>
[junit] INFO: Creating node: creditcard.composite
[junit] 03-Jan-2010 05:40:40 org.apache.tuscany.sca.node.impl.NodeImpl
configureNode
[junit] INFO: Loading contribution:
file:/E:/td/book/ts1/travelsample/contributions/payment-spring-policy/../creditcard-payment-jaxb-policy/target/classes/
[junit] 03-Jan-2010 05:40:41 org.apache.tuscany.sca.node.impl.NodeImpl start
[junit] INFO: Starting node: creditcard.composite
[junit] 03-Jan-2010 05:40:42 org.apache.tuscany.sca.http.jetty.JettyServer
addServletMapping
[junit] INFO: Added Servlet mapping: http://GrosMorne:8082/CreditCardPayment
[junit] 03-Jan-2010 05:40:42 org.apache.tuscany.sca.node.impl.NodeImpl
<init>
[junit] INFO: Creating node: null
[junit] 03-Jan-2010 05:40:42 org.apache.tuscany.sca.node.impl.NodeImpl
configureNode
[junit] INFO: Loading contribution:
file:/E:/td/book/ts1/travelsample/contributions/payment-spring-policy/./target/classes/
[junit] 03-Jan-2010 05:40:42 org.apache.tuscany.sca.node.impl.NodeImpl
configureNode
[junit] INFO: Loading contribution:
file:/E:/td/book/ts1/travelsample/contributions/payment-spring-policy/./target/test-classes/
[junit] 03-Jan-2010 05:40:42
org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl
[junit] WARNING: Property not found for component property: Component =
Payment Property = transactionFee
[junit] 03-Jan-2010 05:40:42
org.apache.tuscany.sca.assembly.builder.impl.CompositeBindingURIBuilderImpl
[junit] WARNING: Property not found for component property: Component =
Payment Property = transactionFee
[junit] 03-Jan-2010 05:40:43 org.apache.tuscany.sca.node.impl.NodeImpl start
[junit] INFO: Starting node: null
[junit] 03-Jan-2010 05:40:43 org.apache.tuscany.sca.http.jetty.JettyServer
addServletMapping
[junit] INFO: Added Servlet mapping: http://GrosMorne:8081/Payment
[junit] 03-Jan-2010 05:40:48 org.apache.tuscany.sca.node.impl.NodeImpl stop
[junit] INFO: Stopping node: null
[junit] 03-Jan-2010 05:40:48 org.apache.tuscany.sca.http.jetty.JettyServer
removeServletMapping
[junit] INFO: Removed Servlet mapping: /Payment
[junit] 03-Jan-2010 05:40:48 org.apache.tuscany.sca.node.impl.NodeImpl stop
[junit] INFO: Stopping node: creditcard.composite
[junit] 03-Jan-2010 05:40:48 org.apache.tuscany.sca.http.jetty.JettyServer
removeServletMapping
[junit] INFO: Removed Servlet mapping: /CreditCardPayment
[junit] ------------- ---------------- ---------------
[junit]
[junit] Testcase: testPayment took 4.633 sec
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.