Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

SOATest using old data that works. I must be using machine learning:)

rickstag
rickstag Posts: 16

This is a bit long scenario but would appreciate any info. I am new to soaTest. I am using a data source .txt file to validate postgres datatypes. I wanted to test min max and max+1 of an integer type. I have one record in the dataset. I am using a rest post. I then ran my test using the data source file with 2147483647 and the record was added to the db and a status code of 200 was returned. I then changed the value in my dataset to 2147483648 and ran the test which soaTest in Quality Tasks showed an error. Behind the scenes soaTest changed the integer value to the last know good value of 2147483647 so the test succeeded with a status code of 200 and the database record had this good value as well. I tested this situation serveral times with the same results. I then shutdown soaTest and relaunched it and ran the test with 2147483648 in the dataset and soaTest changed the value to 2147483647 again. soaTest again gave error DataSource: postgres_input_tests (row 1): Value "2147483648" from the "integerNumber" column is not
a valid int. in the Quality Tasks tab but and returned a status code of 200 because it used the last known good value. Any insights would be appreciated.

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited March 2019

    Since I can't see your tst I'm just making some guesses as to what you are doing and why you are seeing what you are seeing.

    Behind the scenes soaTest changed the integer value to the last know good value of 2147483647 so the test succeeded

    Are you using a data bank? If so, then the XPath used for the extraction doesn't match anything then the value will be unchanged (the previous value). If you want to clear or empty the value when the extracttion doesn't match then you can use the "Extract missing elements as" option.

    I then shutdown soaTest and relaunched it and ran the test with 2147483648 in the dataset and soaTest changed the value to 2147483647 again.

    Again, taking guesses here. When a tst file is open in the UI then data bank column values are cache from the previous run. This makes it easier to run tests in a scenario individually without having to re-run the entire scenario to re-populate data bank columns from scratch each time. To clear any cached data bank values, simply close then reopen the tst file. You don't need to restart SOAtest.

  • rickstag
    rickstag Posts: 16

    @benken_parasoft I can't attached my tst file. I am using a CSV Data Sources file as input. In the payload of the post I have an element named integerNumber that is parameterized to an input value of the test. I don't think this is considered as a data bank. When I change the field to fixed and put in the invalid integer I get "Not an integer: 2147483648

  • jakubiak
    jakubiak Posts: 795 admin

    Well 2147483647 is the largest valid int. So when you pass 2147483648 you are passing something that is larger than a 32-bit integer can hold. The value is getting passed to something that expects a valid int value, but we don't yet have enough information to understand what that could be. Can you provide more information on the following:

    • What tool are you using (REST Client, Messaging Client, etc.)
    • What format is your payload?
    • What kind of field are you passing the parameterized value into?
    • Anything else about the configuration of your test that would help us to understand how it is set up
  • rickstag
    rickstag Posts: 16

    The tool we are using is soaTest to test backend database datatypes. There are consumers of the message as clients but that is not relevant here. We are hitting db2, postgrsSQL, Oracle backends and have a generic rest interface. For instance we can get varying length character strings from all these databases but will only support a certain length. The testing is to ensure the datatypes are working from each database into our rest interfaces for post, get, put and delete. The payload is of different types. For instance we have integer, decimal, json, json binary strings that are in the rest interface. I am passing a semicolon delimited file into the rest fields and this has been parameterized. Here is an example of parts of the elements.

    "fixedLengthString": "na ",
    "jsonString": {},
    "jsonBinaryString": {},
    "integerNumber": 2147,
    "decimalNumber": 0,
    "dateTimeTZ": "2019-03-27T10:45:57.955-04:00",
    "dateTimeUtc": "2019-03-27T14:45:57.955",
    "dateTimeNoTZ": "2019-03-27T14:45:57.956",

    This is part of the payload. I paramterize this in soaTest as a rest post and point to the values to load the rest elements from my csv file. When I load a max integer + 1 ,
    of an ill formed json format into the jsonString soaTest will not accept this. I have selected the input format as "Form JSON" versus literal or scripted. The payload format is set to JSON and the Content-type is text/json. I really want soaTest to put in the elements what ever I desire and ahave the backend database choke on the values. For instance putting in a max+1 integer with give me back the appropriate messages from any of the databases (db2, postgreSQL, Oracle). I hope this explains what I am trying to do. Thanks for you input.

  • rickstag
    rickstag Posts: 16

    https://forums.parasoft.com/profile/jakubiak
    Can you comment on my recent updates

  • jakubiak
    jakubiak Posts: 795 admin

    I am able to configure a number field within a JSON payload with that number and bigger numbers, using both Fixed or Parameterized against a CSV file. So there is something else going on in your case that is not clear from your description. Can you submit a screenshot that shows how your test is configured? If not, I would recommend contacting Parasoft support since it's not clear what is going on in your case.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited April 2019

    Are you using a REST Client or Messaging Client? If you are using a REST Client then is that REST Client referencing a service definition? If referencing a service definition then how is that service defining the integer? A service definition can define constraints on the size of the integer which the REST Client will honor.

  • rickstag
    rickstag Posts: 16

    I think the rest service is using a definition that soaTest is using. Thanks for you input. I will get back later but had to make a uturn on this effort. Their is no reason to respond. I do appreciate the guidance.