Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1418

Max size of a string field causing test integration to fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M3
    • Fix Version/s: 1.1.0.RC1
    • Component/s: TESTING
    • Labels:
      None
    • Environment:
      Windows Vista, JDK (build 1.6.0_21-b07), Spring ROO 1.1.0.M3

      Description

      There seems to be an issue with the test data generated for the Integration Tests used with 'perform tests'.
      Steps to reproduce:
      1. Modify clinic.roo, change AbstractPersion firstName maxSize to 19
      2. run the script
      3. run perform tests
      Build Failure occurrs
      [Thread-8] Tests in error:
      [Thread-8] testPersist(com.springsource.petclinic.domain.OwnerIntegrationTest)

      [Thread-8] testPersist(com.springsource.petclinic.domain.VetIntegrationTest)

      From what I have been able to figure, it has something to do with how the test data is being created. The data it's using to put in the firstName field is causing the error.

      It also seems to be dependant on the size of the field name. So 19 causes the issue, 20 doesn't, but if you remove a character from the fieldName you can get 19 to work.
      i.e. max=19, field name =firstNam (removed one character to make the field name shorter)

      Now it starts failing at max=18 and works at max=19.

      Same the other way, if you add a charater to the field name, it starts failing at 20 (i.e. max=19, field name = firstName1)

      So I assume there is some test data function that is using the field name and is creating test data that is bigger than the max field size.

      Seems to be creating data field name size + 11 and the error occurs when field name is greater than max-11

      So end result name of a string field can't be more than max size of field - 11, and
      setting --sizeMax < 12 will never allow the integration tests to pass successfully.

      I included a couple modified clinic.roo scripts that show the error.
      clinic-test1-fail.roo - set the max size of the firstName field to 19
      clinic-test1-success.roo - reduce the size of the fieldName by one to firstNam
      clinic-test2-fail.roo - increase the size of the fieldName by one to firstName1
      clinic-test3-fail.roo - add new string field with long fieldName and short maxSize (personCode --sizeMax 3)
      clinic-test4-success.roo - add new string field with short fieldName 'a' and maxSize 12
      clinic-test4-fail.roo - add new string field with short fieldName 'a' and maxSize 11

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            btlife Scott Constantine
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: