IconListTest

Introduction

This driver runs some automated tests on IconList, testing each method within. To ensure the tests all ran correctly, check the Java Console and make sure everything succeeded. The automated tests operate similarly to JUnit, but do not require the JUnit jar to run. Note: the tests do not test VerticalPanel, as this inner class may not be used in the future depending on the outcome of the FreezableScrollPane discussion.

This driver also opens up two TableIconList windows. One is a new frame that contains an IconList. This is needed to show the relayout of the icons when you resize the window. Another example is within this HTML page, this shows how it will look when embedded within another window, as it will in the final product. This is needed for the Mac to demonstrate that the scrollbar looks as expected when the IconList is not in a new frame. (Both scroll arrows appear.)

Information about each TableIcon:

A pseudo-random number of tables are created with a random number of players on each one. Each player is wearing a random jersey color. The upper & lower labels on the table are randomly selected to simulate a real Icon List environment in OKweb. The table names have an integer appended to the end to ensure uniqueness, and a letter to assist in sorting algorithms.

Testing procedure:
  1. You can select any icon on either IconList. The icon will highlight appropriately.
  2. Each click sends an action back to the listener, either a double-click or single-click event. Check the Java Console to ensure these are happening. Note: For each double-click a single-click is also sent. This will have no effect with our functionality, as single-clicking twice on an icon does nothing.
  3. Try resizing the frame. The icons should still be laid out nicely, even if there is a selection made. Only the vertical scrollbar is ever shown. If an icon is highlighted, that same icon will remain highlighted.