Procedure

This test examines the VE’s functionality to drop a non-visual JavaBean onto the graphical canvas and modify its properties by using the Property Sheet viewer.

Setup
Import the jar file called jbcfexamplebeans.zip into an Eclipse project.
Open a blank template class using the visual editor.
Enable the view for the property sheet.
Open the Choose Bean dialog by clicking the button on the top palette.
Select the BasicTypes bean from the list.
Drop the bean on the freeform canvas. The property sheet should display information about the bean and a java app should launch which displays a Frame containing information about the bean’s properties.
       
Tasks
Use the selection tool to select the BasicTypes bean.
For each task below, verify the source code properly reflect modifications made with the property sheet.
       
booleanPrim
Verify that editing this property in the property sheet requires the use of a drop-down menu to select "true" or "false".

Unset the property using the  button in the property sheet
Verify that the value reverts to false.
Verify that the "ivjBasicTypes.setbooleanPrim(...);" line in the source code no longer appears.
Verify the Set to Null button is disabled.
       
boolean
Repeat the tasks for booleanPrim, except that this property should be allowed to be set to null, and unsetting it should revert it to null.

doublePrim
Verify that the property does not accept character values and that it does accept integer or decimal values.
Verify that the property can’t be set to null.
Verify that setting the property to 0 gives it a value of 0.0, not null.

double
Repeat the tasks for doublePrim, except that this property should be allowed to be set to null, and unsetting it should revert it to null.

charPrim
Verify that characters can be entered
Verify that setting the value to ' and \ properly escape the characters.
Verify that typing more than one character gives a warning
Verify that typing 0 followed by a number creates a char by casting the typed int
Verify that the property can't be set to null.

character
Verify that characters can be entered
Verify that setting the value to ' and \ properly escape the characters.
Verify that typing more than one character gives a warning
Verify that typing 0 followed by a number creates a char by casting the typed int
Verify that the cell editor works after setting the property to null
       
string
Verify that strings can be entered.
Enter the value "Frog"A\B\C\
Verify that an escape character was added before the double quotes and back slashes in the source code.
Verify that the value can be set to null, and that entering something, and removing all of the text and then hit enter the property is set to the value to "".
       
Other types
Each type has a primitive property and a corresponding java.lang counterpart.
Verify that the primitives can’t be set to null, and that they are reset to zero.
Verify that the java.lang types can be set to null and are reset to null.
Verify that invalid input is not accepted, (ex. Try to set the intPrim property to "1P" and Verify that the value of intPrim is not altered).

Test the valid ranges of the primitive numeric attributes
Verify that shortPrim, intPrim, and longPrim do not accept decimal numbers as input.

Note: Float numbers are floating point which has an internal representation that may be different to the external one.  For example, a float of 3.4 should display as 3.4 but the editor should show it as 3.4000000953674316 when it is being edited. This is the correct behavior as designed.
Test the valid ranges of the java.lang types using the information below.

 

Type MIN_VALUE MAX_VALUE
java.lang.Short -32768 32767
java.lang.Integer -2147483648 2147483647
ava.lang.Long 9223372036854775808 9223372036854775807