J2METestSpecificationSanity

J2ME Module Sanity Test Specification

Author: Andrei Chistiakov
Version: 1.0
Lastupdate: 05.08.2009

Contents


Test suite: CLDC project

Purpose: To make sure J2ME CLDC project support exists and works correctly
Setup: Have NetBeans from either All or Java distribution installed on Windows

  1. CLDC Project creation
    1. Press "New Project..." button on IDE main toolbar
    2. Select J2ME in Categories tree
    3. Select "Mobile Application" in Projects list, press Next
    4. Check Project Name is MobileApplication1 and Project Location is predefined and valid, "Set as Main Project" and "Create Hello MIDlet" checkboxes are checked, press Next
    5. Check "Java Platform Micro Edition SDK 3.0" emulator platform and ClamshellCldcPhone1 device are selected (on Linux there appears "Sun Java(TM) Wireless Toolkit 2.5.2 for CLDC" with Device "Default Color Phone"; CLDC-1.1 and MIDP-2.1 radio buttons are selected), press Next
    6. Press Finish
    • EXPECTED RESULT: new Mobile application is created in IDE, HelloMIDlet.java is opened in Visual Designer
  2. Running J2ME CLDC Application in emulator
    1. Select MobileApplication1 project node in Projects tree, right-click it and press "Run"
    2. Close the emulator window
    3. Select MobileApplication1, right-click it and close using popup menu
    • EXPECTED RESULT: The application is built without errors and executed in mobile device emulator. Then it is closed properly so that nothing related to the closed project resides in editor and the project node disappears also from Projects view.
  3. J2ME CLCD Project opening
    1. Press "Open Project..." button on IDE main toolbar
    2. Using "Open Project" dialog, find and select MobileApplication1, press "Open Project" button
    • EXPECTED RESULT: MobileApplication1 is opened in IDE


Test suite: Databinding

Purpose: To check if Databinding functionality present and usable
Setup: Have MobileApplication1 project open in IDE

  1. Add DataSet to mobile application
    1. In Projects tree, expand MobileApplication1 | Source Packages | hello node
    2. Double-click HelloMIDlet.java node
    • EXPECTED RESULT: HelloMIDlet.java is opened in Visual Designer
  2. Add DataSet to the MIDlet
    1. In Navigator, right-click Databinding node and invoke New/Add|DataSet popup menu command
    • EXPECTED RESULT: new dataSet subnode is displayed under Databinding node in Navigator
  3. Bind a Screen item to the DataSet
    1. In the Editor area switch HelloMIDlet in Visual Designer to Screen view
    2. Select stringItem (the text with "Hello" string) on Device Screen
    3. In Properties, push ellipsis button near Text property and open custom property editor dialog
    4. In "stringItem - Text" dialog select Databinding radio button, select dataSet in Datasets combo, type dataSet.text in "EL Read" entry field, press OK button to close the dialog
    • EXPECTED RESULT: <databinding> is displayed on StringItem on Device Screen and as value of Text property in Properties pane
  4. Customize DataSet and run the application in emulator
    1. Select datSet node in Navigator, right-click it and invoke "Go To Source" popup menu command
    2. Scroll down to getValue method and replace its body with "return "Greeting!";" statement
    3. Run the project in emulator
    4. Close the emulator
    • EXPECTED RESULT: Greeting is displayed on device screen in emulator


Test suite: SVG UI components support

Purpose: Verify the functionality allowing SVG UI components to be used in CLDC application
Setup: Have MobileApplication1 project open in IDE

  1. Create and edit SVG file
    1. Press "New File..." button on the IDE toolbar
    2. Choose Other category and then "SVG File" in "File Types" list, press Next
    3. Check the new file name is newImage and Folder value is preset and valid then press Finish
    • EXPECTED RESULT: New SVG file is added in the project and opened in SVG composer
  2. Add UI elements to the SVG file
    1. Drag and drop "Text Field" form component from Patette on canvas in SVG composer
    2. Drag and drop Button form component from Patette on canvas in SVG composer
    3. Press "Save All Files" button on the IDE main toolbar
    • EXPECTED RESULT: both SVG text field and SVG button are displayed on canvas in SVG composer
  3. Add SVG Form to the MobileApplication1 project and attach SVG image to the form
    1. Select HelloMIDlet.java tab
    2. Make sure Visual Designer is switched to Flow mode (press Flow button on editor's toolbar if needed)
    3. Drag and drop "SVG Form" component from Palette on canvas
    4. Drag newImage.svg from Projects tree and drop it on svgForm displayed on canvas
    • EXPECTED RESULT: svgButton item is displayed under SVG Buttons category in svgForm element on canvas
  4. Make the svgForm a part of Mobile Application workflow
    1. Right-click 'form' component on canvas and invoke "New/Add | OK Command" popup menu command
    2. Bind okCommand item added to the form to svgForm element on canvas
    3. Bind svgButton item of svgForm to "Mobile Device" element on canvas
    • EXPECTED RESULT: The application workflow definition is completed
  5. Run the application in Emulator
    1. Press "Run Project" button on the IDE main toolbar
    2. In Emulator, press OK
    3. In Emulator, select OK button using cursor keys and push it by pessing Enter key on keyboard
    4. Exit the Emulator
    • EXPECTED RESULT: The application is complied and executed without errors


Test suite: Project Configurations

Purpose: Verify the ability of using multiple configurations of CLDC project
Setup: Have MobileApplication1 project open in IDE

  1. Add a new configuration
    1. In Projects tree, expand MobileApplication1 node, select "Project Configuration" node, right-click it and invoke "Add Project Configuration" popup menu command
    2. In "Add Project Configuration" dialog, enter "MyConfiguration" in "New Configuration Name" entry field and press OK button
    • EXPECTED RESULT: MyConfiguration is created and selected in "Set Project Configuration" combobox on main IDE toolbar
  2. Modify the newly created comfiguration
    1. In Projects tree, right-click MobileApplication1 node and open the project properties
    2. In MobileApplication1 dialog, uncheck "Use Values from "DefaultConfiguration" ckeckbox
    3. Select DelaultCLDCPhone1 in Device combobox, press OK button
    • EXPECTED RESULT: Modifying of the configuration went smoothly
  3. Build many configurations of the CLDC project
    1. Right-click MobileApplication1 node in Projects tree and invoke "Batch Build" popup menu command
    2. In "Build Selected Project Configurations" dialog, check both DefaultConfiguration and MyConfiguration checkboxes and press OK
    3. Verify NetBeansProjects\MobileApplication1\dist folder contains the following files: MobileApplication1.jad, MobileApplication1.jar
    4. Verify NetBeansProjects\MobileApplication1\dist\MyConfiguration folder contains the following files: MobileApplication1.jad, MobileApplication1.jar
    • EXPECTED RESULT: Both configurations are built successfully
  4. Run different project configuratons in Emulator
    1. Make sure MyConfiguration is selected as current project configuration in combobox on main IDE toolbar
    2. Run the project
    3. Verify DefaultCldcPhone1 device emulator is executing the application
    4. Exit the emulator
    5. Select DefaultConfiguration as current project configuration in combobox on main IDE toolbar
    6. Run the project
    7. Verify ClamshellCldcPhone1 device emulator is executing the application
    8. Exit the emulator
    • EXPECTED RESULT: Both configurations are executed successfully


Test suite: Debugger

Purpose: Verify the functionality of the debugger in CLDC Project
Setup: Have MobileApplication1 project open in IDE

  1. Set a breakpoint in MIDlet source
    1. Switch to HelloMIDlet.java
    2. Switch editor to Source view
    3. In java source editor, expand "Generated Method: startMIDlet" code folder
    4. Set breakpoint at line "switchDisplayable(null, getForm());"
    • EXPECTED RESULT: Breakpoint is successfully set
  2. Debug the project
    1. Press "Debug Project" button on main IDE toolbar
    • EXPECTED RESULT: The execution is stopped at the breakpoint
  3. Continue execution
    1. Press Continue button on the main IDE toolbar (Try the same also by using F5 shortcut)
    2. Exit the Emulator
    • EXPECTED RESULT: Execution can be stopped at breakpoint and then continued


Test suite: CDC Project

Purpose: To make sure J2ME CDC project support exists and works correctly
Setup: Have NetBeans from either All or Java distribution installed on Windows

  1. Create CDC Project
    1. Press "New Project..." button on IDE main toolbar
    2. Select J2ME in Categories tree
    3. Select "CDC Application" in Projects list, press Next
    4. Check Project Name is CdcApplication1 and Project Location is predefined and valid, "Set as Main Project" and "Create Main Class" checkboxes are checked, press Next
    5. Check "CDC Java Platform Micro Edition SDK 3.0" emulator platform is selected, press Finish
    • EXPECTED RESULT: new CDC application is created in IDE, Main.java is opened in Java source editor
  2. Run CDC Project in Emulator
    1. Right click on CdcApplication1 in Projects tree and invoke Run popup menu command
    2. Check the emulator is running and displays "Hello, World!" on device screen
    3. Exit the emulator
    • EXPECTED RESULT: CDC Application is successfully executed in emulator


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