TS 61 MobilityFragmentation

Mobility Pack Test Specification for Device Fragmentation Solution

Author: Lukas Hasik
Version: 2.0
Lastupdate: 06.06.2007
Introduction: Test specification for device fragmentation solution in Mobility Pack 6.0

Contents


Test suite: Abilities

Purpose: Test abilities and preprocessor functionality. Abilities can be added/removed/edited in Project Properties
Setup: Have an Mobility project with a java file opened in Editor

  1. Add new ability
    1. Add new ability with valid name in Properties dialog of the project
    • EXPECTED RESULT: Check that only ability with valid name can be add to list of abilities. If ability has invalid name message "Ability name must be valid Java identifies" appears.
  2. Add a value to a ability
    • Setup: Have ability ABILITY_VALUE in a configuration of project
    1. Select the ability ABILITY_VALUE in list of abilities
    2. press Edit... button
    3. add a value - text or number - to this ability
    4. press OK
    • EXPECTED RESULT: ability with the value is displayed in abilities list
  3. Cannot add ability that already exist in configuration
    • Setup: Have project with ability EXIST in DefaulConfiguration configuration
    1. Try to add new ability EXIST in DefaultConfiguration
    • EXPECTED RESULT: Message "Ability already exists" appears and OK button is disabled in the Add Ability dialog
  4. Availability of abilities among configuration
    • Setup: Have more configurations in a project, the ability ABILITY_1 exist in one (ONE) of these configurations
    1. Open combo box in Add Ability dialog in different configuration than the ONE
    2. Select ABILITY_1 from the list, press OK
    • EXPECTED RESULT: ABILITY_1 is added to abilities list
  5. Availability of abilities among projects
    • Setup: Have projects - Project1 and Project2. Ability ABILITY_1 exist in Project1
    1. Open combo box in Add Ability dialog in Project2
    2. Select ABILITY_1 from the list, press OK
    • EXPECTED RESULT: ABILITY_1 is added to abilities list of Project2


Test suite: Configurations

Purpose: Verify the functionality of the configurations in Mobility project
Setup: Have a Mobility project with opened java file

  1. Add configuration by popup menu
    • Setup: Project has only DefaultConfiguration
    1. Invoke context menu (right click) in editor
    2. Choose Preprocessor Blocks | Add Configurations to Project...
    3. Add Configuration dialog opens
    4. Type the name of new configuration into New Configuration Name textfield
    5. Press OK
    • EXPECTED RESULT: New configuration is create in the project where the java in editor file belongs to
  2. Add configuration in project Properties
    • Setup: Open Properties of Mobility project
    1. Select Add Configuration... from combo at the top of the dialog
    2. Type a valid configuration name into New Configuration Name textfield
    3. Press OK
    • EXPECTED RESULT: Configuration is added to project properties and you can see it in Project Properties and in the main project configuration combobox switcher in toolbar. If the configuration name isn't valid name message "Configuration name must be valid Java identifies" appears and OK button is disabled.
  3. Add more configurations from templates in project Properties
    • Setup: Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Press Add More... button in the dialog
    2. Expand the Project Configuration Templates tree
    3. Select at least two configuration templates
    4. Press OK
    • EXPECTED RESULT: Configurations are added to project properties and you can see it in Project Properties and in the main project configuration combobox switcher in toolbar.
  4. Add more configurations from templates with collision in names
    • Setup: Have available two emulator platforms with the same devices (e.g. WTK22 and WTK 2.5.1). Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Press Add More... button in the dialog
    2. Expand the Project Configuration Templates tree
    3. Select at two configuration templates with the same name. E.g. DefaultColorPhone from Sun Java Wireless Toolkit 2.5.1for CLDC and DefaultColorPhone from J2ME Wireless Toolkit 2.2
    • EXPECTED RESULT: Message "Collision of selected configuration names" appears. OK button is disabled. The same message appears if the selected configuration already exists in the project.
  5. Cannot add existing configuration
    • Setup: Have project with EXIST configuration.
    1. Try to add new configuration with name EXIST
    • EXPECTED RESULT: Message "Configuration with this name already exist" appears and OK button is disabled
  6. Remove configuration from project
    • Setup: Have a mobility project with configuration DELETE. Have a preprocessor block using this configuration in a directive. Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Select configuration DELETE and press Remove button
    • EXPECTED RESULT: Configuration is deleted from the list.
    • Comments: If there were preprocessor blocks using this configuration they should remain in code => the PP block isn't removed
  7. Rename configuration in project
    • Setup: Have a mobility project with configuration RenameMe. Have a preprocessor block using this configuration in a directive. Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Select configuration RenameMe and press Rename button
    • EXPECTED RESULT: Configuration is renamed in the list.
    • Comments: If there were preprocessor blocks using this configuration they should remain without any change in code => the configuration name isn't renamed in PP directive
  8. Create configuration template
    • Setup: Have Project_1 and Project_2. There is a CONFIG configuration in Project_1. There settings are different in the CONFIG than in the DefaultConfiguration. Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Select CONFIG in the list
    2. Press Save as Template... button
    3. Save Project Configuration CONFIG as Template dialog appears with new default name provided e.g. CONFIG_template
    4. Press Save button
    • EXPECTED RESULT: Configuration is saved as template and is available in templates list that appear when you want to add new configuration. The new template is available even in different projects.
  9. Create new configuration from template
    • Setup: Have a configuration template created (CONFIG_template). Remember the template settings. Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Open Add configuration
    2. Select the CONFIG template in Use Configuration Template tree. It is under User saved project configuration templates
    3. New Configuration Name textfield isn't filled with the prefix of the "_template"
    4. press OK
    • EXPECTED RESULT: New configuration is created. It has the same setting as the template configuration.
  10. Duplicate Configuration
    • Setup: Have a configuration (DuplicateMe) in the project. Remember the configuration settings. Open Properties of Mobility project. Click to ManageConfigurations... button to open Project Configuration Manager.
    1. Select the configuration.
    2. Press Duplicate... button
    3. Provide new name for the configuration - DUPLICATED
    4. Press OK
    • EXPECTED RESULT: New configuration DUPLICATED is created. It has the same settings as DuplicateMe configuration
  11. Duplicate Multiple Configuration
    • Setup: Have configurations (DuplicateMe and DuplicateHim) in the project. Remember the configuration settings. Open Properties of Mobility project. Click to Manage Configurations... button to open Project Configuration Manager.
    1. Select both DuplicateMe and DuplicateHim configurations (hold CTRL).
    2. Press Duplicate... button
    3. Provide prefix PRE and postfix POST for new name of configurations
    4. Press OK
    • EXPECTED RESULT: New configurations PREDuplicateMePOST and PREDuplicatehimPOST is created. It has the same settings as DuplicateMe and DuplicateHim configuration
  12. Set Active Configuration
    1. Choose a configuration node in combobox in toolbar
    • EXPECTED RESULT: Configuration is marked in bold under Project Configurations node. The configuration is set up in the configuration combobox (only when Mobility project is the main project)


Test suite: Project Configurations Node

Purpose: Verify the functionality of the configurations node in project view
Setup: Have a Mobility project with configurations CONFIGURATION_1, CONFIGURATION_COPY, CONFIGURATION_DELETE opened

  1. Add Configuration by Popup Menu
    1. Invoke context menu (right click) on the Project Configurations node under project node in Projects view
    2. Choose Add Project Configuration
    3. Add Project Configuration dialog opens
    4. Type the name 'CONFIGURATION_NEW' of new configuration into New Configuration Name textfield
    5. Press OK
    • EXPECTED RESULT: New configuration is created under the Project Configurations node. It inherits all setttings from DefaultConfiguration
  2. Remove Configuration
    1. Invoke context menu (right click) on CONFIGURATION_DELETE node under the Project Configurations node
    2. Choose Remove Configuration
    • EXPECTED RESULT: Configuration is removed from the Project Configurations node
  3. Copy&Paste Configuration
    1. Invoke context menu (right click) on CONFIGURATION_COPY node under the Project Configurations node
    2. Choose Copy. Remember all the settings of the configuration
    3. Choose Paste from context menu on Project Configurations node.
    4. Add Project Configuration dialog opens
    5. Type the name 'CONFIGURATION_NEW' of new configuration into New Configuration Name textfield
    6. Press OK
    • EXPECTED RESULT: Configuration is added to the Project Configurations node
  4. Set Active Configuration
    1. Invoke context menu (right click) on a configuration node under the Project Configurations node
    2. Choose Set Active Project Configuration
    • EXPECTED RESULT: Configuration is marked in bold. This configuration is set up in the configuration combobox (only when Mobility project is the main project)
  5. Popup Menu Actions on a Configuration
    1. Invoke context menu (right click) on a configuration node under the Project Configurations node
    2. Following menu items are available Run Configuration, Debug Configuration, Build Selected Project Configurations, Clean&Build Selected Project Configurations, Clean Selected Project Configurations, Deploy Selected Project Configurations
    3. Test functionality of every of them.
    • EXPECTED RESULT: The configuration is either built, cleaned, deployed, etc.
  6. Popup Menu Actions on More Configurations
    1. Invoke context menu (right click) on more configuration nodes under the Project Configurations node
    2. Following menu items are available Build Selected Project Configurations, Clean&Build Selected Project Configurations, Clean Selected Project Configurations, Deploy Selected Project Configurations
    3. Test functionality of every of them.
    • EXPECTED RESULT: The configurations is either built, cleaned, deployed, etc.



Test suite: Abilities in Navigator

Purpose: Verify the functionality of the abilities navigator
Setup: Have a Mobility project with configurations CONFIGURATION_1, CONFIGURATION_COPY, CONFIGURATION_DELETE opened. Every configuration has some abilities. See issue 100427, issue 85830

  1. Add Ability
    • Setup: Select a configuration node of the project in project view. You should see table with abilities in Navigator view.
    1. Right click on the table in Navigator view
    2. Choose Add
    3. Add Ability dialog opens
    4. Type the name ABILITY_NEW into Ability Name textfield
    5. Press OK
    • EXPECTED RESULT: New ability is created in the configuration. NOTE: the same works when more configuration is selected under configuration node.


  1. Remove Ability
    • Setup: Select a configuration node of the project in project view. You should see table with abilities in Navigator view.
    1. Right click on the REMOVE_ABILITY cell in Navigator view
    2. Choose Remove
    • EXPECTED RESULT: REMOVE_ABILITY ability is removed from the configuration. NOTE: the same works when more configuration is selected under configuration node.


  1. Copy&Paste Ability
    • Setup: Select a configuration node of the project in project view. You should see table with abilities in Navigator view.
    1. Right click on the COPY_ABILITY cell in Navigator view
    2. Choose Copy
    3. Select a different configuration under "Projects Configuration" node
    4. Right click into abilities navigator and choose Paste
    • EXPECTED RESULT: Ability with value is copied to the configuration. NOTE: You can paste into more configuration.


  1. Remove Ability from non-default configuration
    • Setup: Select a non-default configuration node (SecondConfiguration) of the project in project view. You should see table with abilities in Navigator view. The SecondConfiguration inherits all its abilities from DefaultConfiguration. The Use Values From DefaultConfiguration checkbox is checked in project properties on Abilities pane.
    1. Right click on the REMOVE_DEFAULT_ABILITY cell in Navigator view
    2. Choose Remove
    • EXPECTED RESULT: REMOVE_DEFAULT_ABILITY ability is removed from the SecondConfiguration configuration. The Use Values From DefaultConfiguration checkbox is unchecked in project properties on Abilities pane therefore the configuration doesn't inherit abilities values from the DefaultConfiguration anymore. All other abilities than the REMOVE_DEFAULT_ABILITY has been copied into SecondConfiguration.


  1. Change Ability Value
    • Setup: Select a configuration node of the project in project view. You should see table with abilities in Navigator view.
    1. Select CHANGE_ABILITY cell in Navigator view
    2. Change the value of the ability
    • EXPECTED RESULT: Value of ability is changed. NOTE: the same works when more configuration is selected under configuration node.



Test suite: Preprocessor

Purpose: Verify the functionality of the preprocessor in Mobility project
Setup: Have a Mobility project with configurations CONFIGURATION_1, CONFIGURATION_2, CONFIGURATION_2 opened

  1. Create If/Else Preprocessor Block
    1. Right click a line/selection in source code
    2. Choose Preprocessor Blocks > Create If/Else Block
    • EXPECTED RESULT: Line/selection is duplicated. If/Else PP blocks are created.
  2. Use Re-comment Menu
    1. Add new If/Else preprocessor block. Use any ability/configuration in the PP block.
    2. Right click in source code
    3. Choose Preprocessor Blocks > Re-Comment
    • EXPECTED RESULT: The inactive PP block part is commented out.
  3. Add Elif Preprocessor Block
    1. Have an If/Else preprocessor block.
    2. Right click in PP block
    3. Choose Preprocessor Blocks > Add Elif Block Section
    • EXPECTED RESULT: New #else PP block section is added into the PP block
  4. Create Debug Preprocessor Block
    1. Right click a line/selection in source code
    2. Choose Preprocessor Blocks > Create Debug Block
    • EXPECTED RESULT: Line/selection is surrounded with //#mdebug, //#enddebug. New PP block is created.
  5. Change Active Configuration
    1. Change active configration in configuration combo box
    • EXPECTED RESULT: All PP blocks are re-commented if needed (if a different block section should be active).
  6. Preprocessor Block Code Completion
    1. Write //# to source code to start new PP block
    • {{result|EXPECTED RESULT: Code Completion with available directives appears.%
  7. Preprocessor Block Condition
    1. Write following code to source code
//#if test=0 
int a;
//#endif
    • EXPECTED RESULT: According to the condition code is either active or inactive
  1. Preprocessor Block Complicated Condition
    1. Write following code to startApp method of a midlet
//#define a
//#define b = 1
//#define c = "aaa"

//#ifdef a 
        //this block is active
        System.out.println("#ifdef a is active");
        //#if b != 1
//#       //this block is inactive
//#         System.out.println("#if b != 1 is active");
        //#else
        //this block is active
        System.out.println("#else is active");
           //#if c == "aaa"
           //this block is active
           System.out.println("#if c == \"aaa\" is active");
           //#else
//#           //inactive block
//#         System.out.println("#else is active");
            
          //#endif
       //#endif
//#elif b == 2
//#    //this block is inactive
//#         System.out.println("#elif b == 2 is active");
    //#if test
//#     //cannot be active
//#         System.out.println("#if test is active");
    //#endif
//#endif
    1. Run the midlet in emulator
    • EXPECTED RESULT: According to the condition code is either active or inactive. Result of the midlet run in output window is
#ifdef a is active
#else is active
#if c == "aaa" is active


  1. Preprocessor Block Directives
    1. invoke code completion for PP block in source code
    • EXPECTED RESULT: check what directives are available for PP blocks. Starting PP block - condition, debug, define, enddebug, if, ifdef, ifndef, mdebug, undefine. Ending PP block(after if etc.) - condition, debug, define, elif, elifdef, elifndef, else, enddebug, endif, if, ifdef, ifndef, mdebug, undefine.
  2. Turn off Preprocessor
    1. Turn off the PP in project Properties in General category
    • EXPECTED RESULT: The PP functionality is gone. Code isn't preprocessed.


  1. Old Preprocessor syntax hint
    1. Paste following code to a java file in mobility project
/*#DefaultConfiguration#*///<editor-fold>
        text = "in DefaultConfiguration";
/*$DefaultConfiguration$*///</editor-fold>
    1. Hint on the line with /*#DefaultConfiguration#*/ appears. Text of hint is "Replace with new preprocessor syntax".
    2. Use the hint
    • EXPECTED RESULT: Code changes to new PP syntax.
//#if DefaultConfiguration
        text = "in DefaultConfiguration";
//#endif


Test suite: Action on Project

Purpose: Verify the functionality of the batch preprocessor action in Mobility project
Setup: Have a Mobility project with configurations CONFIGURATION_1, CONFIGURATION_2 opened

  1. Batch build (only DefaultConfiguration)
    1. Right click on a mobility project with only DefaultConfiguration
    2. Choose Batch Build, Batch Clean&Build, Batch Clean, Batch Deploy actions
    • EXPECTED RESULT: When there is only DefaultConfiguration in project then all these actions behave in the same way as actions with "Batch".
  2. Batch build
    1. Right click on a mobility project with more configurations
    2. Choose Batch Build, Batch Clean&Build, Batch Clean, Batch Deploy actions
    • EXPECTED RESULT: The action is done for project configurations that you select in the dialog that appears when you choose the action.

Test suite: Source Filtering

Purpose: Verify the functionality of the source filtering in Mobility project
Setup: Have a Mobility project with configurations CONFIGURATION_1, CONFIGURATION_2 opened. Have classes Midlet_1 and Midlet_2 in this project. Have also package "tobefiltered" in the project with some classes. Project is at attachment - SourceFiltering.

  1. Filter out a package in all configurations
    1. Right click project and choose Properties
    2. Make sure that DefaultConfiguration is active project configuration
    3. Select Build | Source Filtering category
    4. Uncheck the check box next to the tobefiltered node in Sources Used in Build tree
    5. Build the project for all configurations
    • EXPECTED RESULT: The tobefiltered package isn't compiled, isn't in jar.
  2. Filter out a midlet
    1. Right click project and choose Properties
    2. Make sure that CONFIGURATION_1 is active project configuration
    3. Select Build | Source Filtering category
    4. Uncheck Use Values from DefaultConfiguration check box
    5. Uncheck the check box next to the Midlet_2 node in Sources Used in Build tree
    6. In Application Descriptor category, select MIDlets tab, remove Midlet_2 from the MIDlets in Suite list
    7. Repeat previous steps for CONFIGURATION_2 and Midlet_1
    8. Run DefaultConfiguration, CONFIGURATION_1, CONFIGURATION_2
    • EXPECTED RESULT: In DefaultConfiguration are Midlet_1, Midlet_2. In CONFIGURATION_1 is only Midlet_1. In CONFIGURATION_2 is only Midlet_2.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo