webMethods

 View Only
  • 1.  Unit test error - NumberFormatException on duration time

    Posted Wed September 01, 2021 06:23 AM

    Hi,

    I have created a new TestSuite.
    It has a single unit test which tests a easy addInts function.

    When I try to run the test suite with the single unit test I get an error that seems to be about the duration of the unit test run.

    This is my error :

    and this is the console output :

    As you can see the number written in the number format exception is exactly the duration of the test suite run.

    Have you any ideas on how could I fix it?

    Thanks a lot in advance
    Alessio


    #TestFramework
    #unittest
    #webMethods
    #JUNIT
    #Integration-Server-and-ESB


  • 2.  RE: Unit test error - NumberFormatException on duration time

    Posted Wed September 01, 2021 06:50 AM

    wMTestSuite is meant to test only with static values which you captured during your happy, failure path of your flow service. Dynamic values such as runtime datetime or any dynamic database values should not to be validated using the TestSuites.

    if you can introduce the condition in your testcase to exclude these variables not to be tested during the wMTest execution using xPath.

    image


    #webMethods
    #Integration-Server-and-ESB
    #JUNIT
    #TestFramework
    #unittest


  • 3.  RE: Unit test error - NumberFormatException on duration time

    Posted Wed September 01, 2021 11:35 AM

    Check the locale settings for the run-time environments. Seems to be a mismatch somewhere between expecting ‘.’ vs. ‘,’ as the decimal separator.


    #TestFramework
    #JUNIT
    #webMethods
    #Integration-Server-and-ESB
    #unittest


  • 4.  RE: Unit test error - NumberFormatException on duration time

    Posted Wed September 01, 2021 12:10 PM

    Hi reamon,

    where can I modify the locale settings for the run-time environment?

    Thanks a lot,
    Alessio


    #Integration-Server-and-ESB
    #webMethods
    #unittest
    #TestFramework
    #JUNIT


  • 5.  RE: Unit test error - NumberFormatException on duration time

    Posted Wed September 01, 2021 01:33 PM

    It’s been a while since I worked with WmUnit but as I recall, when running the tests in Designer, the test runner is local to your machine which calls the services on the IS server. The locale of your Designer environment likely needs to match the locale of the IS instance.

    But that’s just a guess on my part. Perhaps others have additional info and may be able to confirm or dismiss that differing locale settings could be the issue.


    #unittest
    #TestFramework
    #JUNIT
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Unit test error - NumberFormatException on duration time

    Posted Thu September 02, 2021 09:05 AM

    This would be a defect. I don’t see any quick workaround by specifying or updating the locale in the Designer.

    Except, if you agree to temporarily set your Windows system locale to US and try it out.
    For reference: change system locale …

    Feel free to create a service incident. In any case, this has to be addressed through product fixes.


    #webMethods
    #unittest
    #Integration-Server-and-ESB
    #TestFramework
    #JUNIT


  • 7.  RE: Unit test error - NumberFormatException on duration time

    Posted Thu September 16, 2021 10:16 AM

    Hi,

    I have tryed changing the Locale to “ENG (United States) but I still have the error about the duration”

    Regards,
    Alessio


    #webMethods
    #Integration-Server-and-ESB
    #unittest
    #JUNIT
    #TestFramework


  • 8.  RE: Unit test error - NumberFormatException on duration time

    Posted Thu October 14, 2021 04:37 AM

    Hi - Fix for this issue was made public for most of the released versions. You might want to install and try.
    -Thanks, Sanjib


    #TestFramework
    #JUNIT
    #Integration-Server-and-ESB
    #unittest
    #webMethods