Issue Details (XML | Word | Printable)

Key: DISPL-243
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Reporter: Anonymous
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DisplayTag

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

Created: 16/Sep/05 07:28 PM   Updated: 17/Sep/05 11:56 PM   Resolved: 17/Sep/05 02:56 AM
Return to search
Component/s: Paging/Sorting
Affects Version/s: 1.1
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: 1. File TableTagPatch (0.9 kB)
2. Text File TEST-org.displaytag.test.TestAll.txt (0.7 kB)
3. XML File TEST-org.displaytag.test.TestAll.xml (59 kB)


Testcase included: yes


 Description  « Hide
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.

fabrizio giustina added a comment - 17/Sep/05 02:56 AM
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

fabrizio giustina made changes - 17/Sep/05 02:56 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Jorge L. Barroso added a comment - 17/Sep/05 11:56 PM
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