Service Virtualization

Expand all | Collapse all

Magic date error

Rajasekhar Reddy

Rajasekhar ReddyMay 27, 2018 03:31 PM

  • 1.  Magic date error

    Posted May 24, 2018 05:58 PM

    Hi team,

     

    I have created the virtual service from request and response pairs. In response, date elements are there and these values have been replaced by magic date formula. When any request hit the deployed service, proper response is coming but in VSE.log file I could see the below error.

    kindly let me know what is the issue here. Thank you.

     

    2018-05-24 21:14:03,203Z (17:14) [VS Name[VS_NAME]/95] ERROR com.itko.lisa.test.ParseInState - Could not evaluate expression '=doDateDeltaFromCurrent("yyyy-MM-dd","-34D");/*2018-04-04*/'
    java.lang.IllegalArgumentException: Looking for "," in magic date expression but did not find it. Syntax error
     at com.itko.lisa.test.ParseInState$Hit.doDateDelta(ParseInState.java:520)
     at com.itko.lisa.test.ParseInState$Hit.doDateDeltaCurrent(ParseInState.java:511)
     at com.itko.lisa.test.ParseInState$Hit.evaluate(ParseInState.java:400)
     at com.itko.lisa.test.ParseInState.parseInState(ParseInState.java:150)
     at com.itko.lisa.test.ParseInState.parseInState(ParseInState.java:92)
     at com.itko.lisa.test.ParseInState$Hit.handleNestedProps(ParseInState.java:483)
     at com.itko.lisa.test.ParseInState$Hit.evalPropertyVal(ParseInState.java:441)
     at com.itko.lisa.test.ParseInState$Hit.evaluate(ParseInState.java:419)
     at com.itko.lisa.test.ParseInState.parseInState(ParseInState.java:279)
     at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1952)
     at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1934)
     at com.itko.lisa.test.TestExec.parseInState(TestExec.java:1930)
     at com.itko.lisa.utils.ParseTextContentNode.execute(ParseTextContentNode.java:65)
     at com.itko.lisa.test.TestNode.executeNode(TestNode.java:981)
     at com.itko.lisa.test.TestCase.execute(TestCase.java:1294)
     at com.itko.lisa.test.TestCase.execute(TestCase.java:1198)
     at com.itko.lisa.test.TestCase.executeNextNode(TestCase.java:1183)
     at com.itko.lisa.test.TestCase.executeTest(TestCase.java:1124)
     at com.itko.lisa.coordinator.Instance.run(Instance.java:204)

     

    Regards,

    Rajasekhar



  • 2.  Re: Magic date error

    Broadcom Employee
    Posted May 24, 2018 06:12 PM

    I think there might be some syntax error. Can you please share the snippet of your response?



  • 3.  Re: Magic date error

    Posted May 25, 2018 01:02 PM

    Thank You prema.

     

    PFB the response:

    <ExtAcctBal>
                    <ExtBalType>YTDInterest</ExtBalType>
                    <CurAmt>
                        <Amt>44.76</Amt>
                        <CurCode>USD</CurCode>
                    </CurAmt>
                    <EffDt>{{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}</EffDt>
                </ExtAcctBal>
                <ExtAcctBal>
                    <ExtBalType>LastYrInt</ExtBalType>
                    <CurAmt>
                        <Amt>261.02</Amt>
                        <CurCode>USD</CurCode>
                    </CurAmt>
                    <EffDt>{{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}</EffDt>
                </ExtAcctBal>
                <ExtAcctBal>
                    <ExtBalType>Orig</ExtBalType>
                    <CurAmt>
                        <Amt>3075.00</Amt>
                        <CurCode>USD</CurCode>
                    </CurAmt>
                    <EffDt>{{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}</EffDt>
                </ExtAcctBal>
                <ExtAcctBal>
                    <ExtBalType>TotalInterest</ExtBalType>
                    <CurAmt>
                        <Amt>545.53</Amt>
                        <CurCode>USD</CurCode>
                    </CurAmt>
                    <EffDt>{{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}</EffDt>
                </ExtAcctBal>
                <ExtAcctBal>
                    <ExtBalType>Unpaid/AccruedInt</ExtBalType>
                    <CurAmt>
                        <Amt>4.35</Amt>
                        <CurCode>USD</CurCode>
                    </CurAmt>
                    <EffDt>{{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}</EffDt>
                </ExtAcctBal>



  • 4.  Re: Magic date error

    Broadcom Employee
    Posted May 25, 2018 04:10 PM

    What version of DevTest are you seeing this issue?



  • 5.  Re: Magic date error
    Best Answer

    Posted May 29, 2018 03:00 PM

    Hello Rajasekhar,

     

    Could you try to use

    {{doDateDeltaFromCurrent("yyyy-MM-dd","-34D");/*2018-04-04*/}}

    instead of 

    {{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}

     

    let us know how it works.

     

    Heloisa



  • 6.  Re: Magic date error

    Posted May 27, 2018 03:31 PM

    Hi Shiney,

     

    We are using DevTest 10.1 version.



  • 7.  Re: Magic date error

    Posted May 31, 2018 03:24 PM

    Hi Maria,

     

    Thank you. it is working fine now after changing to {{=doDateDeltaFromCurrent("yyyy-MM-dd","-34D");/*2018-04-04*/}}.

    Can you please tell me why the DevTest by default, saving it as below when we create virtual service.

    {{=doDateDeltaFromCurrent(&quot;yyyy-MM-dd&quot;,&quot;-34D&quot;);/*2018-04-04*/}}

     

    Thank You

    Rajasekhar



  • 8.  Re: Magic date error

    Broadcom Employee
    Posted Jun 01, 2018 10:53 AM

    Hello Rajasekhar,

     

                     Can you please list the DPH (Data Protocol Handlers) that you applied for the response? What type of service is this?

     

    Thanks,

    Surya



  • 9.  Re: Magic date error

    Posted Jun 04, 2018 11:58 AM

    Hi Surya,

    I have only WebService(SOAP) DPH in VSM and it is SOAP/HTTP service.

     

    Thank You

    Rajasekhar



  • 10.  Re: Magic date error

    Posted Jun 06, 2018 01:03 AM

    Hi Rajasekhar,

     

    I would need to do some research and maybe check with my next level why this is happening.

     

    Would you be able to open a support ticket for this? If possible, please attach the VSM and VSI to the support ticket.

     

    Thank you,

    Heloisa



  • 11.  RE: Re: Magic date error

    Posted Mar 08, 2021 04:18 PM
    Hi all,

    I also have this issue. Indeed, by replacing the &quot; by ", I'm able to fix the problem. However, I would like to be able to record " on the first place.
    I've already opened a ticket. Do you have any insight on that regard? An improvement would be great!

    Best regards,
    Mark Boisjoli

    ------------------------------
    Desjardins
    ------------------------------



  • 12.  RE: Magic date error

    Posted Mar 09, 2021 12:35 AM
    Hi Rajsekhar,

    Please refer to below link for similar problem:

    https://community.broadcom.com/communities/community-home/digestviewer/viewthread?MID=801101

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------