Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 379971

Summary: Unit testing for selection model.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 0.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2012-05-18 09:27:19 EDT
We've got selection model working but I am not satisfied by the readiness of exposing APIs.
I will use something below as a start point for unit test and see what kind of best APIs we can standardize.
Test data:

8 rows of dummy model item in a flat model and selection model built based on
that.

Test 1:
Simulate restoring previous selection + cursor position : row 3,4,5 were
selected and cursor was on row 2 before.

Test 2 (from the result of test 1): 
Variation 1:
Simulate up key.
Expected result:
Row 3,4,5 are de-seleted and row 1 is selected.

Variation 2:
Simulate ctrl + up key.
Expected result:
Row 3,4,5 are still selected and row 1 is cursored.

Test 3(from the result of test 2 variation 2):
Simulate space key.
Expected result:
Row 3,4,5 are still selected and row 1 is selected as well.

Test 4(from the result of test 3):
Simulate down key.
Expected result:
Row 1,3,4,5 are deselected and row 2 is selected.

Test 5(from the result of test 4):
Simulate shift+down key 3 times.
Expected result:
Row 2,3,4,5 are selected and cursor is on row 5.

Test 6(from the result of test 5):
Simulate down key.
Expected result:
Row 2,3,4,5 are deselected and row 6 is selected.
Comment 1 John Arthorne CLA 2015-05-05 14:39:30 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html