Uploaded image for project: 'Shale'
  1. Shale
  2. SHALE-294

TestCase: CommonsValidatorTestCase fails on different user locales.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.0.3
    • 1.0.4
    • Core
    • None
    • Operation System country configurations is set to german (de_DE)

    Description

      The CommonsValidatorTestCase fails if the user locale or country (I don't know exactly) is not set to "en".
      If it is not set to english you got localized error messages and then the equals assertions fail.

      -------------------------------------------------------------------------------
      Test set: org.apache.shale.validator.CommonsValidatorTestCase
      -------------------------------------------------------------------------------
      Tests run: 20, Failures: 17, Errors: 0, Skipped: 0, Time elapsed: 2.093 sec <<< FAILURE!
      testValidateRequired(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.156 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...is required...> but was:<...wird benötigt...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateRequired(CommonsValidatorTestCase.java:295)

      testValidateMaxlength(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.078 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...can not be greater than 5 characters...> but was:<...darf nicht kleiner als 5 Zeichen sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateMaxlength(CommonsValidatorTestCase.java:353)

      testValidateMinlength(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.094 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...can not be less than 5 characters...> but was:<...darf nicht kleiner als 5 Zeichen sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateMinlength(CommonsValidatorTestCase.java:412)

      testValidateMask(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.141 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<... invalid...> but was:<...t ungültig...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateMask(CommonsValidatorTestCase.java:471)

      testValidateByte(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.078 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be a byte...> but was:<...s byte sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateByte(CommonsValidatorTestCase.java:527)

      testValidateShort(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.094 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be a short...> but was:<...s short sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateShort(CommonsValidatorTestCase.java:583)

      testValidateInteger(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.062 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be an integer...> but was:<...s integer sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateInteger(CommonsValidatorTestCase.java:638)

      testValidateFloat(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.094 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be a float...> but was:<...s float sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateFloat(CommonsValidatorTestCase.java:694)

      testValidateDouble(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.062 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be a double...> but was:<...s double sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateDouble(CommonsValidatorTestCase.java:750)

      testValidateLong(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.11 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...t be a long...> but was:<...s long sein...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateLong(CommonsValidatorTestCase.java:789)

      testValidateDate(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.062 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<... not a date...> but was:<...t kein Datum...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateDate(CommonsValidatorTestCase.java:833)

      testValidateIntRange(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.094 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...is not in the range 1 through...> but was:<...liegt nicht zwischen 1 und...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateIntRange(CommonsValidatorTestCase.java:894)

      testValidateFloatRange(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.062 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...is not in the range 1.0 through...> but was:<...liegt nicht zwischen 1.0 und...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateFloatRange(CommonsValidatorTestCase.java:960)

      testValidateDoubleRange(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.094 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<...is not in the range 1.0 through...> but was:<...liegt nicht zwischen 1.0 und...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateDoubleRange(CommonsValidatorTestCase.java:1022)

      testValidateCreditCard(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.047 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<... an invalid credit card numb...> but was:<...t keine gültige Kreditkartenumm...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateCreditCard(CommonsValidatorTestCase.java:1062)

      testValidateEmail(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.156 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<... an invalid e-mail address...> but was:<...t keine gültige E-Mail-Adresse...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateEmail(CommonsValidatorTestCase.java:1123)

      testValidateUrl(org.apache.shale.validator.CommonsValidatorTestCase) Time elapsed: 0.063 sec <<< FAILURE!
      junit.framework.ComparisonFailure: expected:<... an invalid url address...> but was:<...t keine gültige URL-Adresse...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at junit.framework.Assert.assertEquals(Assert.java:87)
      at org.apache.shale.validator.CommonsValidatorTestCase.checkMessage(CommonsValidatorTestCase.java:1259)
      at org.apache.shale.validator.CommonsValidatorTestCase.testValidateUrl(CommonsValidatorTestCase.java:1177)

      Attachments

        Activity

          People

            gvanmatre@comcast.net Gary VanMatre
            idueppe Ingo Düppe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: