Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4051

JSONValidationInterceptorTest.testValidationFails in some environment fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.3.14
    • 2.5
    • Plugin - JSON, Unit Tests
    • None

    Description

      I'm pretty sure it's related to the way in which the elements of a collection are sorted in a different environments (jre?)

      Here is the outcome of the junit test.

      Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.484 sec <<< FAILURE!
      testValidationFails(org.apache.struts2.json.JSONValidationInterceptorTest)  Time elapsed: 0.231 sec  <<< FAILURE!
      junit.framework.ComparisonFailure: null expected:<...r"],"fieldErrors":{"[value":["Minvalueis-1"],"text":["Tooshort","Thisisnoemail]"]}}> but was:<...r"],"fieldErrors":{"[text"
      :["Tooshort","Thisisnoemail"],"value":["Minvalueis-1]"]}}>
      	at junit.framework.Assert.assertEquals(Assert.java:81)
      	at junit.framework.Assert.assertEquals(Assert.java:87)
      	at org.apache.struts2.json.JSONValidationInterceptorTest.testValidationFails(JSONValidationInterceptorTest.java:73)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at junit.framework.TestCase.runTest(TestCase.java:168)
      	at junit.framework.TestCase.runBare(TestCase.java:134)
      	at junit.framework.TestResult$1.protect(TestResult.java:110)
      	at junit.framework.TestResult.runProtected(TestResult.java:128)
      	at junit.framework.TestResult.run(TestResult.java:113)
      	at junit.framework.TestCase.run(TestCase.java:124)
      	at junit.framework.TestSuite.runTest(TestSuite.java:243)
      	at junit.framework.TestSuite.run(TestSuite.java:238)
      	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
      	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
      	at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
      	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
      
      

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            maurizio.cucchiara Maurizio Cucchiara
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: