Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4315

StringResourceModel skip first parameter in va args parameters, in case if first parameter has string type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.5.1, 1.5.3
    • Fix Version/s: None
    • Component/s: wicket
    • Environment:
      not related to env

      Description

      StringResourceModel skip first parameter in va args parameters, in case if first parameter has string type. Works on in case if first parameter non string type.
      Way to reproduce.
      1. locate StringResourceModelTest$TestPage.properties in apache-wicket-1.5.3\src\wicket-core\src\test\java\org\apache\wicket\model
      2. add following line: simple.bug=Hi i am new bug.

      {0}

      {1}
      3. change StringResourceModelTest#getSimpleResource()
      public void getSimpleResource()
      { StringResourceModel model = new StringResourceModel("simple.text", page, null); Assert.assertEquals("Text should be as expected", "Simple text", model.getString()); Assert.assertEquals("Text should be as expected", "Simple text", model.getObject()); StringResourceModel thisWorksModel = new StringResourceModel("simple.bug", page, null, new java.math.BigDecimal("100"), "500"); Assert.assertEquals("Text should be as expected", "Hi i am new bug. 100 500", thisWorksModel.getObject()); //will be failed StringResourceModel bugModel = new StringResourceModel("simple.bug", page, null, "Already", "fixed"); Assert.assertEquals("Text should be as expected", "Hi i am new bug. Already fixed", bugModel.getObject()); }
      4. expected result - all tests passed
      5. actual result assertion failed - Assert.assertEquals("Text should be as expected", "Hi i am new bug. Already fixed", bugModel.getObject());

      -------------------------------------------------------------------------------
      Test set: org.apache.wicket.model.StringResourceModelTest
      -------------------------------------------------------------------------------
      Tests run: 11, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.974 sec <<< FAILURE!
      getSimpleResource(org.apache.wicket.model.StringResourceModelTest) Time elapsed: 0.745 sec <<< FAILURE!
      junit.framework.ComparisonFailure: Text should be as expected expected:<Hi i am new bug. [Already fixed]> but was:<Hi i am new bug. [fixed {1}

      ]>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                svenmeier Sven Meier
                Reporter:
                azarny Igor Azarny
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified