Procedure
This test involves
testing the numerous properties on several Swing components. Each java
file within the test jar file is dedicated to one specfic JavaBean,
(JButton, JLabel, etc). Every one of the beans’ parameters has been
somehow altered from its default value.
Setup
Import
the marathon beans test
jar file into an Eclipse project.
To perform the test,
go through the following steps for each java file:
- Open the java source with
the Java Visual Editor and compare what the editor displays with the
images in this document. The images are screen captures of the
program’s graphical output, so whatever the JVE displays should be
exactly the same.
- Press the "Show Advanced
Properties" button on the toolbar of the property sheet to show all of
the bean's properties.
- Look at the accessor
method for the bean under inspection. There will be dozens of setXXX()
statements for various properties. Look at each statement and verify that there is a corresponding
row in the property sheet for the bean that has the correct value set.
For example, in the first test, for a JButton bean, the method
getJButton() contains the following
line:
jButton.setName("JButton");
You need to look
at the property sheet and verify
that there’s a row for the “name” property that has the value
“JButton”. Make sure that the PropertySheet is set to the show advanced
properties because some of the properties tested are advanced ones.
- For each file below,
there will be a checklist of additional things to verify.
- Monitor the logs for codegen
exceptions and add necessary defects.
Test Files
File name:
MBTJButton.java
Correct graphical
output:

Remember to compare
the property sheet values with the setXXX() statements in the source
code, as
is described in the
instructions above.
Things to
Verify:
- Property Sheet has
correct initial values
- Set the “enabled”
property to true and the text should turn red.
- Set the
“contentAreaFilled” property to true and the background color should
turn green.
- Set the “borderPainted”
property to true and an etched border should appear.
- Set the layout manager of
the JPanel to FlowLayout and the geometry of the JButton should become
a square with 100 pixel long sides.
File
name:
MBTJCheckBox.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled”
property to true and the text should turn blue.
- Set the
“contentAreaFilled” property to true and the background color should
turn red.
- Set the layout manager of
the JPanel to FlowLayout and the geometry of the JCheckBox should
become a square with 100 pixel long sides.
File
name:
MBTJToggleButton.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled”
property to true and the text should turn blue.
- Set the “selected”
property to false and the background color should turn green.
- Set the layout manager of
the JPanel to FlowLayout and the geometry of the JToggleButton should
become a square with 100 pixel long sides.
- Check to make sure the
Border Property Editor displays correctly.
File
name:
MBTJRadioButton.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled”
property to true and the text should turn red.
- Set the “opaque” property
to true and the background color should turn orange.
- Set the layout manager of
the JPanel to FlowLayout and the geometry of the JRadioButton should
become a square with 100 pixel long sides.
File name:
MBTJLabel.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled”
property to true and the text should turn red.
- Set the “opaque” property
to true and the background color should turn green.
- Set the layout manager of
the JPanel to FlowLayout and the geometry of the JToggleButton should
become a 100x20 pixel rectangle.
File name:
MBTJTextField.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled” and
“editable” properties to true and type into the free-form dialog to
check the colors for highlighted, disabled, etc. text.
File
name:
MBTJPasswordField.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled” and
“editable” properties to true and type into the free-form dialog to
check the colors for highlighted, disabled, etc. text.
paw
note on
5/19/03 - the 'enable' and
'editable' properties are already set to true for this bean and I
didn't notice a change colors, both in design time and runtime when
toggling these properties.
File name:
MBTJTextArea.java
Correct graphical
output:

Things to
Verify:
- Set the “enabled” and
“editable” properties to true and type into the free-form dialog to
check the colors for highlighted, disabled, etc. text.
File name:
MBTJSlider.java
Correct graphical
output:

Things to
Verify:
- Change the layout
manager of the JPanel bean to FlowLayout and Verify that the JSlider is resized
correctly, (per its preferred size).
File
name:
MBTJScrollBar.java
Correct graphical
output:

File name:
MBTJList.java
Correct graphical
output:
This is how it looks in the Visual Editor. Notice the blue circle "i"
which indicates an informational error. This is because the property
'selectedIndices' is set with an int array in the source code
and this type of expression is too complicated to be evaluated in the
VM. When the code is actually run, the list items will be visible.
Note: The selectedIndices property is not in the beaninfo and therefore
does not show in the property sheet viewer. It only shows in the source code
This is how it looks when its running in which the list items show up.

File name:
MBTJComboBox.java
Correct graphical
output:

File name:
MBTJProgressBar.java
Correct graphical
output:
