Service Virtualization

  • 1.  Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 04:30 AM

    Hi Folks,

     

    Please find below I am getting it while I am trying to execute in my test. Pease let me know how to resolve this?

     

    ============================================================================
    |

    ============================================================================
    | HTTP
    ============================================================================
    | Step:        new user
    ----------------------------------------------------------------------------
    | Message:     java.net.ConnectException: Connection refused: connect
    ----------------------------------------------------------------------------
    | Trapped Exception: Connection refused: connect
    | Trapped Message:   java.net.ConnectException: Connection refused: connect
    ----------------------------------------------------------------------------
    STACK TRACE
    java.net.ConnectException: Connection refused: connect
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
    at com.itko.lisa.test.ReuseSocketHttpProtocolSocketFactory.connectSocket(ReuseSocketHttpProtocolSocketFactory.java:30)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
    at com.itko.lisa.test.CommTrans.doSend(CommTrans.java:1005)
    at com.itko.lisa.test.CommTrans.send(CommTrans.java:801)
    at com.itko.lisa.test.CommTrans.sendGET(CommTrans.java:748)
    at com.itko.lisa.test.URLTrans.doSend(URLTrans.java:280)
    at com.itko.lisa.test.URLTrans.doWebTrans(URLTrans.java:222)
    at com.itko.lisa.test.URLTransBase.execute(URLTransBase.java:491)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:977)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1229)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1144)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1129)
    at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1048)
    at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:68)
    at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:961)
    at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)
    at java.lang.Thread.run(Unknown Source)
    ============================================================================

    ============================================================================
    | Step:        new user
    ----------------------------------------------------------------------------
    | Message:     Connection refused: connect
    ----------------------------------------------------------------------------
    | Trapped Exception: Connection refused: connect
    | Trapped Message:   java.net.ConnectException: Connection refused: connect
    ----------------------------------------------------------------------------
    STACK TRACE
    java.net.ConnectException: Connection refused: connect
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
    at com.itko.lisa.test.ReuseSocketHttpProtocolSocketFactory.connectSocket(ReuseSocketHttpProtocolSocketFactory.java:30)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
    at com.itko.lisa.test.CommTrans.doSend(CommTrans.java:1005)
    at com.itko.lisa.test.CommTrans.send(CommTrans.java:801)
    at com.itko.lisa.test.CommTrans.sendGET(CommTrans.java:748)
    at com.itko.lisa.test.URLTrans.doSend(URLTrans.java:280)
    at com.itko.lisa.test.URLTrans.doWebTrans(URLTrans.java:222)
    at com.itko.lisa.test.URLTransBase.execute(URLTransBase.java:491)
    at com.itko.lisa.test.TestNode.executeNode(TestNode.java:977)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1229)
    at com.itko.lisa.test.TestCase.execute(TestCase.java:1144)
    at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1129)
    at com.itko.lisa.editor.WalkThruPanel.prepAndExecNode(WalkThruPanel.java:1048)
    at com.itko.lisa.editor.WalkThruPanel.access$900(WalkThruPanel.java:68)
    at com.itko.lisa.editor.WalkThruPanel$10.doCallback(WalkThruPanel.java:961)
    at com.itko.util.swing.panels.ProcessingDialog$2.run(ProcessingDialog.java:194)
    at java.lang.Thread.run(Unknown Source)
    ============================================================================



  • 2.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.
    Best Answer

    Posted Feb 04, 2016 04:49 AM

    Hi Saikiran,

     

    This error means the target SUT is not reachable or not responding when the request is sent from this test step.

    Kindly check the connection configuration for the target in this test step and/or ensure the target SUT is available?

     

    Regards

    Tanveer D



  • 3.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 06:32 AM

    Hi Tanveer,

     

    Thank you very much for the reply. yes it is correct. It has been resolved for me.

     

    Regards,
    SaikiranGarapati.



  • 4.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 09:22 AM

    Hi Tanveer,

     

    Can you help me to identify What is Soap Fault Error in Devtest and how to put that one in any of our testcases or Virtual Services?

     

    Regards,

    SaikiranGarapati.



  • 5.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 10:02 AM

    Hi Saikiran,

     

    So SOAP Fault is Error is an embedded assertion enabled by default for all SOAP based test steps. Generally if an error occurs during processing, the response to a SOAP message is a SOAP fault element in the body of the message, and the fault is returned to the sender of the SOAP message. The SOAP fault mechanism returns specific information about the error, including a predefined code, a description, and the address of the SOAP processor that generated the fault. When DevTest receives a SOAP fault to a test step response, Devtest "Aborts the Test Case" by default. This can be changed by modifying the If Error field. See below

     

     

    This embedded Assertion for WebServices Execution (XML) steps for example is available in the Advanced Settings (If you click on PRO on the extreme right corner)

     

    Advanced Settings - DevTest Solutions - 8.0 - CA Technologies Documentation

     

    While all SOAP based test steps will have this SOAP Fault is Error enabled, if you would like your Virtual Service to return a SOAP Fault specifically for a request than you have to configure a SOAP Fault response in the response body of that request in the vsi. You can find many resources on the internet to see what a SOAP Fault response looks like.

     

    Hope that helps!



  • 6.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 10:33 AM

    Hi Tanveer,

     

    Thanks again for your timely reply, I got basic idea and it really helps me a lot, I will explore and let you know the doubts if I have any, Mean while can you help me how to create a String generate pattern for XML data set and Procedure for applying Patches for DevTest 8.0?

     

    And if I add a existing account through XML dataset, how do I ensure that ,it is already in the system through applying SOAP Fault is Error Assertion?

     

    Thanks again.



  • 7.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 11:32 AM

    Hi Saikiran,

    I am not sure I completely follow your questions but I l try to answer.

    Possibly String patterns could be used in your XML dataset by using a pattern {{=[:SSN:]}} in the value for SSN column for example. You can see all the string patterns available here

     

    your dataset could look like -

     

    As in for a web service request which creates an account that already exists, if your SUT returns a SOAP fault in the response to such a request, the embedded SOAP Fault is Error Assertion in your Web Services (XML) test step will anyways pick it up first and abort the test case.

     

    Could you raise a separate thread of the question on patch update, I unfortunately do not have anything to guide you on that.

     

    Regards

    Tanveer



  • 8.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 05, 2016 03:07 AM

    Thank you very much again and I raised a Separate thread for it.



  • 9.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 04, 2016 10:58 AM

    You may also need to change the Meta Data for your response to include an error other than (200 OK) in the HTTP-Response-Code and HTTP-Response-Text as well.  Generally, you would usually return an HTTP 400 or HTTP 500 along with the Soap Fault payload -- but that should be verified with the SUT owner.

     

    If this is a requirement, CLICK on your transaction in the VSI, then CLICK on the Meta Data tab for your response and set HTTP-Response-Code and HTTP-Response-Code-Text to something like "500" and "Fail, Fail", respectively.

    Thanks, Joel 



  • 10.  Re: Help me in Resolving this error (java.net.ConnectException: Connection refused: connect) in my test.

    Posted Feb 05, 2016 03:05 AM

    Thank you very much Joel for your response.