TS JavaFX SDK Sanity In NetBeansIDE

Sanity Tests Specification

Author: Lukas Hasik, Alexandr Scherbatiy
Version: 1.0
Last update: 04 March 2010
Introduction: Set of test cases designed for testing that JavaFX SDK works correctly with NetBeans IDE
Comments: Do not use for sanity test of JavaFX plugins of NetBeans IDE. There are other pages as [TS_69_JavaFX_Sanity] for it.


Contents


Test suite: Installation

Purpose: Prepare the environment for next tests Setup:


  1. Install JavaFX Script plugins (TC-install)
    1. Download the [big-mac.czech.../hudson/job/JavaFX_Composer_Promoted_Build_Candidate/ NetBeans with JavaFX and JavaFX Composer].
    2. Unzip it into your machine
    3. Go to UNZIPPED_DIR/bin directory
    4. run "./netbeans --userdir PATH_TO_USER_DIR" (where PATH_TO_USER_DIR is path to not existing directory
    5. Accept the "Agreement" and "No" on userdir import if necessary
    • EXPECTED RESULT: NetBeans IDE with JavaFX launches without errors.
    • Note: Ignore the ZipException: error in opening zip file, it doesn't influence the IDE and has been reported as Bug 181625

Test suite: Sanity Tests

  • Create New Application (TC-new-app)
    1. Invoke 'File | New Project...' from the main menu bar.
    2. Under Categories, select JavaFX.
    3. Under Projects, select JavaFX Script Application.
    4. Click Next.
    5. Click Finish.
    • EXPECTED RESULT: JavaFXApplicationNUMBER should be created in the Projects window.

  • Highlighting (TC-highlighting)
    1. Type the following code in the JavaFX editor into the file Main
   
var radius = 10;

function sqr(a:Number):Number{
    return a * a;
}   		 
    • EXPECTED RESULT: The code should be typed without any exception.
    • EXPECTED RESULT: The var statement should be highlighted
    • EXPECTED RESULT: The function statement should be highlighted
    • EXPECTED RESULT: The name of radius variable should be highlighted
    • EXPECTED RESULT: The name of sqr function should be highlighted
    • File:Highlighting.png

  • Run Project(TC-run)
    1. Invoke 'Run Project' on the project node.
    • EXPECTED RESULT: The JavaFX application should build without errors and run.
    • File:Tc-run.png‎

  • Navigator (TC-navigator)
    1. Create a new Empty JavaFX file.
    2. Type in the editor:
   
var a = 10;
var b = true;
var c = 20.0;
var d = 30s;

var seq = ["1","2","3"];

var f : function(a:Number,b:String):Boolean;

class A{}  		 
    • EXPECTED RESULT: There should be a:Integer node in the Navigator in left bottom corner of IDE File:Tc-navigator.png
    • EXPECTED RESULT: There should be b:Boolean node in the Navigator
    • EXPECTED RESULT: There should be c:Float node in the Navigator
    • EXPECTED RESULT: There should be d:javafx.lang.Duration node in the Navigator
    • EXPECTED RESULT: There should be f:function(:Float,:String):Boolean node in the Navigator
    • EXPECTED RESULT: There should be seq:java.lang.String[] node in the Navigator
    • EXPECTED RESULT: There should be A node in the Navigator

  • Go to Declaration (TC-go-to-declaration)
    1. Create a new Empty JavaFX file.
    2. Type code:
   
var a = 10;


var b = a + 20;

		 
    1. Hold Ctrl and click mouse a in var b = a + 20; line.
    • EXPECTED RESULT: The cursor should go to the line of a declaration.

  • Go to Source (TC-go-to-source)
    1. Type code in editor:
   
import javafx.animation.Timeline;
var timeline = Timeline{};  		 
    1. Hold Ctrl and click mouse Timeline.
    • EXPECTED RESULT: Timeline.fx class should be open.

  • Fix Imports (TC-fix-imports)
    1. Create a new Empty JavaFX file.
    2. Type code:
   
Stage {
    title: "Application title"
    width: 250
    height: 80
    scene: Scene {
        content: Circle {
            centerX: 100,
            centerY: 100
            radius: 40
            fill: Color.BLACK
        }
    }
}
 		 
    1. Fix imports (Invoke Fix Imports popup menu or press Ctrl+Shift+I)
    2. Choose the appropriate FQN of classes offered by Code Completion
    • EXPECTED RESULT: Imports should be fixed.
    • EXPECTED RESULT: Code should be compilable.
    • EXPECTED RESULT: Following imports are added:
      • import javafx.scene.Scene;
      • import javafx.scene.paint.Color;
      • import javafx.scene.shape.Circle;
      • import javafx.stage.Stage;

  • Code Formatting (TC-code-formatting)
    1. Create a new Empty JavaFX file.
    2. Type code:
   
import javafx.stage.*;
import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;

Stage {
title: "Application title"
width: 250
height: 80
scene: Scene {
content: Circle {
centerX: 100,
centerY: 100
radius: 40
fill: Color.BLACK
}
}
}
 		 
    1. Format code (Invoke Format popup menu or press Alt+Shift+F)
    • EXPECTED RESULT: Code should be formatted.
    • File:Tc-code-formatting.png
    • EXPECTED RESULT: Code should be compilable.

  • Code Completion (TC-code-completion)
    1. Type code:
   
import javafx.animation.Timeline;

var timeline = Timeline{};
 		 
    1. On new line, press Ctrl+Space (or "CTRL + \" on Mac)
    2. Select timeline variable from the list.
    3. Type . after the timeline variable.
    4. Press Ctrl+Space
    5. Select play() function from the list. Add ";" at the end of the timeline.play() line.
    • EXPECTED RESULT: Code Completion should work.
    • EXPECTED RESULT: Code should be compilable.

  • Set Breakpoints (TC-debug)
    1. Create new "JavaFX Script Application" project with a main file.
    2. Copy the code to the Main file:
   
var a = 10;
var b = 20.5;

var c = a + b;
  		 
    1. Set breakpoints (click on the Glyph Gutter in the editor) for a, b and c variables
    2. Debug the project (press Ctrl+F5).
    3. Continue debug the project (press F5) for each variable.
    • EXPECTED RESULT: Debugger should stop on each breakpoint.
      • Use "Continue" and "Step Over" to trace through the file.
    • EXPECTED RESULT: Debugger should stop after end of the project.
    • Note: The debugging is kind of strange in JavaFX, it jumps to the package declaration and back etc. however it is caused by the info that debugger receives from javafx compiler.

  • Refactoring (TC-refactoring)
    1. Create a new Empty JavaFX file.
    2. Right click the new javafx file
    3. Refactor > Move
    4. Write non-existing package name into "To package" textfield. Click Refactor.
    • EXPECTED RESULT: Class is moved into the new package. Source code "package" is changed correctly. Code is compilable.

  • Browser (TC-browser)
    1. Invoke Properties on a project node.
    2. Select Run under categories.
    3. Select Run in Browser check box.
    4. Press OK .
    5. Invoke Run Project on the project node.
    • EXPECTED RESULT: Applet should be started in Browser.

  • Java Web Start (TC-java-web-start)
    1. Invoke Properties on a project node.
    2. Select Run under categories.
    3. Select Web Start Execution check box.
    4. Press OK .
    5. Invoke Run Project on the project node.
    • EXPECTED RESULT: Application should be started under Java Web Start.

  • Mobile Emulator (Windows and Mac only) (TC-mobile)
    1. Invoke Properties on project node.
    2. Select Run under categories.
    3. Select Run in Mobile Emulator check box.
    4. Press OK .
    5. Invoke Run Project on the project node.
    • EXPECTED RESULT: Application should be started in the Mobile Emulator.

  • TV Emulator (Only supported Video cards) (TC-tv)
    1. Invoke Properties on project node.
    2. Select Run under categories.
    3. Select Run in TV Emulator check box.
    4. Press OK .
    5. Invoke Run Project on the project node.
    • EXPECTED RESULT: Application should be started by the TV Emulator.

  • WeatherFX Application (TC-weather)
    1. Invoke 'File | New Project...' from the main menu bar.
    2. Select Samples|JavaFX under Categories.
    3. Select JavaFX Weather Application sample.
    4. Run the sample.
    • EXPECTED RESULT: The sample should start.

  • JavaFX Composer Simple App (TC-composer-components)
    1. In a JavaFX project, create "New > JavaFX Design Desktop File
    • EXPECTED RESULT: Document opens in editor in design view
    1. Drag and drop following components from Palette to Design - TextBox, twice Label, Button
    2. Bind Text property of label to textbox.text
    3. Bind Text property of label2 to textbox.rawText
    4. Generate empty action for button
    5. add code textbox.text = "tester"; to the action method body
    6. Run the application
    • EXPECTED RESULT: when you write to text box only label2 is changed. After press of the button both labels change.

  • TBD - not yet - JavaFX Composer Sample (TC-composer-sample)
    1. Invoke 'File | New Project...' from the main menu bar.
    2. Select Samples|JavaFX under Categories.
    3. Select SSSSSSSSSSample sample.
    4. Run the sample.
    • EXPECTED RESULT: The SSSSSSSSSSSSample sample should show a movie.


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