Service Virtualization

 View Only
  • 1.  How to catch custom filter exception/Step Warning messages in TestCase

    Posted May 12, 2021 09:13 AM
    We have a custom filter developed and if any wrong data is passed, it throws an exception like below. So , how can i catch the description "Short" aling with error message for me to handle in code? Like - if name='X12 Filter Syntax Exception' then get the error msg;

    Like, do we have any EventID specified for 'Step warning'? etc



    ------------------------------
    Raji
    ------------------------------


  • 2.  RE: How to catch custom filter exception/Step Warning messages in TestCase

    Broadcom Employee
    Posted May 12, 2021 10:41 AM
    Hi Raji
             The event ID for Step warning is 41.

    --
    regards
    Sankar Natarajan

    This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.





  • 3.  RE: How to catch custom filter exception/Step Warning messages in TestCase

    Posted May 17, 2021 02:29 AM
    thanks Sankar, but the event ID is not being captured while in Java assertion after the filter is failed with step warning. I have below code 

    TestEventListener tel = null;
    try
    {
    tel = new TestEventListener() {
    public void testEvent(TestEvent e) throws Exception {
    String longDesc= e.getLongDesc();

    if(e.getEventId()==41){
    testExec.setStateValue("value",longDesc);
    }

    ------------------------------
    Raji
    ------------------------------



  • 4.  RE: How to catch custom filter exception/Step Warning messages in TestCase

    Posted May 12, 2021 01:21 PM
    Hi Raji,

    If its only related to wrong input, You can try to catch that exception in the filter code itself and set some relevant output set accordingly. This will help you to manage the exception more efficiently.

    Thanks

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