DisplayTag

Default column sort breaks sorting after a few sorts of the column

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1
  • Component/s: Paging/Sorting
  • Labels:
    None
  • Testcase included:
    yes

Description

When sorting columns that have been configured with a default sort order, after a few sorts the column stops sorting and remains sorted in the opposite direction configured. So, for example, if the column is configured to first sort descending, after a few sorts it stops sorting and remains sorted in the ascending direction. This bug only occurs with columns that have been configured with a default sort order.

Attached you'll find a patch that fixes this issue, a couple of line changes in TableTag.java.

BTW, as I'm sure you know, the current org.displaytag.test.TestAll in cvs fails.
  1. TableTagPatch
    16/Sep/05 7:28 PM
    0.9 kB
    Jorge L. Barroso
  2. TEST-org.displaytag.test.TestAll.txt
    16/Sep/05 7:28 PM
    0.7 kB
    Jorge L. Barroso
  3. TEST-org.displaytag.test.TestAll.xml
    16/Sep/05 7:28 PM
    59 kB
    Jorge L. Barroso

Activity

Hide
fabrizio giustina added a comment -
Thanks, I added a unit test (yes, the problem can be reproduced, sort is wrong after the 2nd click) and fixed it in HEAD for 1.1.

Btw, tests in CVS for 1.1 should run without problems since a couple of weeks, see: http://displaytag.sourceforge.net/11/multiproject/displaytag/junit-report.html
Show
fabrizio giustina added a comment - Thanks, I added a unit test (yes, the problem can be reproduced, sort is wrong after the 2nd click) and fixed it in HEAD for 1.1. Btw, tests in CVS for 1.1 should run without problems since a couple of weeks, see: http://displaytag.sourceforge.net/11/multiproject/displaytag/junit-report.html
Hide
Jorge L. Barroso added a comment -
Fabrizio,

You're welcome; glad to help.

Regarding the unit tests, TestAll fails when running the test goal "fresh out of the box".
This is what I did to generate the unit test result below.
1. Download project with maven
2. run "maven jar" from displaytag dir.
Looks like something fundamental is missing in my sandbox or procedure, which wouldn't surprise me much
as I'm new to maven. Having done some research to no avail, I'd really appreciate it if you could shed some light on what's missing as I have some other changes I'd like to submit after running unit tests. The culprit seems to be String[] files in TestAll.findAndStoreTestClasses coming back null.

Testsuite: org.displaytag.test.TestAll
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Null Test: Caused an ERROR
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: java.lang.NullPointerException
at org.displaytag.test.ClassFinder.findAndStoreTestClasses(TestAll.java:180)
at org.displaytag.test.ClassFinder.<init>(TestAll.java:156)
at org.displaytag.test.TestAll.suite(TestAll.java:104)
... 7 more

Thanks,

-Jorge
Show
Jorge L. Barroso added a comment - Fabrizio, You're welcome; glad to help. Regarding the unit tests, TestAll fails when running the test goal "fresh out of the box". This is what I did to generate the unit test result below. 1. Download project with maven 2. run "maven jar" from displaytag dir. Looks like something fundamental is missing in my sandbox or procedure, which wouldn't surprise me much as I'm new to maven. Having done some research to no avail, I'd really appreciate it if you could shed some light on what's missing as I have some other changes I'd like to submit after running unit tests. The culprit seems to be String[] files in TestAll.findAndStoreTestClasses coming back null. Testsuite: org.displaytag.test.TestAll Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec Null Test: Caused an ERROR null java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) Caused by: java.lang.NullPointerException at org.displaytag.test.ClassFinder.findAndStoreTestClasses(TestAll.java:180) at org.displaytag.test.ClassFinder.<init>(TestAll.java:156) at org.displaytag.test.TestAll.suite(TestAll.java:104) ... 7 more Thanks, -Jorge

People

  • Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: