TS 68 JavaFX Sanity

Sanity Tests Specification

Author: Alexandr Scherbatiy
Version: 1.1
Last update: 01 October 2009
Introduction:
Comments:


Contents


Test suite: Installation

Purpose:
Setup:

  1. Install JavaFX Script plugin via installer
    1. Download the NetBeans with JavaFX Script.
    1. Install it.
        
    • EXPECTED RESULT: NetBeans with JavaFX Script Plugin should be installed without errors.
        
    • EXPECTED RESULT: It is possible to crate a JavaFX Script project.
        
  1. Uninstall JavaFX Script plugin
    1. Run the NetBeans with JavaFX Script plugin.
        
    1. Invoke 'Tools|Plugins' from the main menu bar.
        
    1. Go to Installed tab.
        
    1. Type javafx in the Search text field.
        
    1. Select JavaFX Kit, JavaFX SDK for Linux/OpenSolaris/Mac/windows, JavaFX Weather Sample modules.
        
    1. Press Uninstall
        
    1. Uninstall the plugins.
        
    1. Restart the IDE.
        
    • EXPECTED RESULT: It is not possible to crate a JavaFX Script project.
        
    • EXPECTED RESULT: NetBeans installation dir does not contain javafx2 cluster.
        
  1. Install JavaFX Script plugin via Update Center
    1. Download NetBeans (JavaSE, Ruby, PHP or All).
    1. Install it.
        
    1. Run the NetBeans with JavaFX Script plugin.
        
    1. Invoke 'Tools|Plugins' from the main menu bar.
        
    1. Go to Available Plugins tab.
        
    1. Type javafx in the Search text field.
        
    1. Select JavaFX Source Debug, JavaFX 1.0, JavaFX SDK, JavaFX Weather Sample modules.
        
    1. Install the plugins.
        
    1. Restart the IDE.
        
    • EXPECTED RESULT: JavaFX Script Plugin should be installed without errors.
        
    • EXPECTED RESULT: It is possible to crate a JavaFX Script project.
        


Test suite: Project

Purpose:
Setup:

  1. Create New Application
    1. Invoke 'File | New Project...' from the main menu bar.
        
    1. Under Categories, select JavaFX.
        
    1. Under Projects, select JavaFX Application.
        
    1. Click Next.
        
    1. In the Project Name field, type JavaFXApp.
        
    1. Click Finish.
        
    • EXPECTED RESULT: JavaFXApp should be created in the Projects window.
        
  1. Check Main file
    • EXPECTED RESULT: Main JavaFX file should be opened.
        
    • EXPECTED RESULT: Check that the Main file contains code:
   
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;

/**
 * @author author
 */

Stage {
    title: "Application title"
    width: 250
    height: 80
    scene: Scene {
        content: [
            Text {
                font : Font {
                    size : 16
                }
                x: 10
                y: 30
                content: "Application content"
            }
        ]
    }
}  		 
  1. Create Empty JavaFX File
    1. Select javafxapp package under the project.
        
    1. Right-click and invoke New|Empty JavaFX File....
        
    1. Type MyFile for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: Empty MyFile JavaFX Script file should be created.
        
    • EXPECTED RESULT: The file should contain javafxapp package.
        
  1. Create Package
    1. Select Source Packages node under the project.
        
    1. Right-click and invoke New|Java Package....
        
    1. Type test for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: test package should be created.
        
  1. Create JavaFX Class
    1. Select test package under the project.
        
    1. Right-click and invoke New|JavaFX Class....
        
    1. Type MyClass for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: JavaFX Class MyClass should be created
   
package test;

public class MyClass {
}
 		 
  1. Create Nested Package
    1. Select test package under the project.
        
    1. Right-click and invoke New|Java Package....
        
    1. Type nested for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: test.nested package should be created.
        
  1. Create JavaFX Stage
    1. Select test.nested package under the project.
        
    1. Right-click and invoke New|JavaFX Stage....
        
    1. Type MyStage for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: MyStage JavaFX Script file should be created
   
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;

/**
 * @author author
 */

Stage {
    title: "Application title"
    width: 250
    height: 80
    scene: Scene {
        content: [
            Text {
                font : Font {
                    size : 16
                }
                x: 10
                y: 30
                content: "Application content"
            }
        ]
    }
} 		 
  1. Create Java Class
    1. Select test.nested package under the project.
        
    1. Right-click and invoke New|Java Class....
        
    1. Type MyClass for name.
        
    1. Press Finish.
        
    • EXPECTED RESULT: MyClass Java classshould be created
   
package test.nested;

public class MyClass {
}
 		 
  1. Rename JavaFX Class
    1. Select test.MyClass JavaFX class under the project.
        
    1. Right-click and invoke Rename....
        
    1. Type RenamedClass for new name.
        
    1. Press OK.
        
    • EXPECTED RESULT: The class should be renamed to RenamedClass.
        
  1. Delete JavaFX Class
    1. Select test.RenamedClass JavaFX class under the project.
        
    1. Right-click and invoke Delete....
        
    1. Press Yes on Confirm Object Deletion dialog.
        
    • EXPECTED RESULT: The class should be deleted from the project.
        


Test suite: Editor

Purpose:
Setup:

  1. Type Code in Editor
    1. Type the following code in the JavaFX editor:
   
var radius = 10;

function sqr(a:Number):Number{
    return a * a;
}   		 
    • EXPECTED RESULT: The code should be typed without any exception.
        
  1. Highlighting
    • EXPECTED RESULT: The import statement should be highlighted
        
    • 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
        
  1. Templates
    1. Type sout in the editor.
    1. Type Press Tab key.
    • EXPECTED RESULT: java.lang.System.out.println(""); line should appear in the editor.
        
    • EXPECTED RESULT: There should not be any error in the editor.
        
  1. Build Project
    1. Invoke 'Build Project' on the project node.
        
    • EXPECTED RESULT: The JavaFX application should build without errors.
        
  1. Run Project
    1. Invoke 'Run Project' on the project node.
        
    • EXPECTED RESULT: The JavaFX application should build without errors.
        
  1. Preview
    1. Save the JavaFX file (Ctrl+S).
        
    1. Enable the Preview.
        
    1. Wait a few seconds.
        
    • EXPECTED RESULT: The image of JavaFX application should be shown in the preview panel.
        
  1. Javadoc
    1. Create Contact JavaFX class:
   
class Contact{
    var firstName: String;
    var lastName: String;
    var eMailAddress: String[];

    public override function toString():String { "{firstName} {lastName}" }
}   		 
    1. Invoke 'Generate Javadoc for Project' on the project node.
        
    • EXPECTED RESULT: The Javadoc should appear in a browser.
        
    • EXPECTED RESULT: The Javadoc should contain Contact class.
        
    • EXPECTED RESULT: The Contact class should contain firstName,lastName and eMailAddress attributes.
        
    • EXPECTED RESULT: The Contact class should contain toString function.
        
  1. Palette
    1. Drag and drop Applications|Stage component from the Palette to the editor.
        
    1. Drag and drop Basic Shapes|Circle component from the Palette to the Scene content.
        
    1. Run the project
        
    • EXPECTED RESULT: Frame with circle should appear.
        
  1. Navigator
    1. Create a new Empty JavaFX file.
        
    1. 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
        
    • 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
        
  1. Go to Declaration
    1. Create a new Empty JavaFX file.
        
    1. Type code:
   
var a = 10;
var b = a + 20;

class C{
    var attr: Number;
    function func(){};
}

var c  = C{}
c.attr = 10;
c.func(); 		 
    1. Hold Ctrl and click mouse a in var b = a + 20; line.
        
    • {{{1}}}
        
  1. Go to Source
    1. Type code:
   
import javafx.animation.Timeline;
var timeline = Timeline{};  		 
    1. Hold Ctrl and click mouse Timeline.
        
    • EXPECTED RESULT: Timeline.fx class should be open.
        
  1. Fix Imports
    1. Create a new Empty JavaFX file.
        
    1. 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)
        
    • EXPECTED RESULT: Imports should be fixed.
        
    • EXPECTED RESULT: Code should be compilable.
        
  1. Code Formatting
    1. 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.
        
    • EXPECTED RESULT: Code should be compilable.
        
  1. Code Completion
    1. Type code:
   
import javafx.animation.Timeline;

var timeline = Timeline{};
 		 
    1. Press Ctrl+Space
        
    1. Select timeline variable from the list.
        
    1. Type . after the timeline variable.
        
    1. Press Ctrl+Space
        
    1. Select play() function from the list.
        
    • EXPECTED RESULT: Code Completion should work.
        
    • EXPECTED RESULT: Code should be compilable.
        


Test suite: Debug

Purpose:
Setup:

  1. Debug Project
    1. Create a JavaFX Script project.
        
    1. Press Debug Main Project button.
        
    1. Press Finish Debugger Session button.
        
    • EXPECTED RESULT: Debugger should start.
        
    • EXPECTED RESULT: Debugger should stop.
        
  1. Set Breakpoints
    1. Create a JavaFX Script project.
        
    1. 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
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Continue debug the project (press <F5>) for each variable.
        
    • EXPECTED RESULT: Debugger should stop on each breakpoint.
        
    • EXPECTED RESULT: Debugger should stop after end of the project.
        
  1. Watches Window
    1. Create a JavaFX Script project.
        
    1. Copy the code to the Main file:
   
var a = 10;
var b = 20.5;

var c = a + b;
print(c);
 		 
    1. Set breakpoints for print(c); line
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Go to Watches window.
        
    1. Right-click and select New Watch...
        
    1. Type a + 10 for the watch expression.
        
    1. Right-click and select New Watch...
        
    1. Type c * 2 for the watch expression.
        
    • EXPECTED RESULT: There should be 20 value for the a + 10 expression.
        
    • EXPECTED RESULT: There should be 61.0 value for the c * 2 expression.
        
  1. Local Variables Window
    1. Create a JavaFX Script project.
        
    1. Copy the code to the Main file:
   
var a = 10;
var b = 20.5;

var c = true;

class D{
    var attr: Number;
}

var d = D{ attr: 22 }
println(d);
 		 
    1. Set breakpoints for println(d); line
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Go to Locale Variables window.
        
    • EXPECTED RESULT: There should be a
        
    • EXPECTED RESULT: There should be b
        
    • EXPECTED RESULT: There should be c
        
    • EXPECTED RESULT: There should be d
        
    • EXPECTED RESULT: There should be attr
        
  1. Call Stack
    1. Create a JavaFX Script project.
        
    1. Copy the code to the Main file:
   
var a = 10;
var b = 20.5;

var c = a + b;
  		 
    1. Set breakpoints for a, b and c variables
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Go to Call Stack window.
        
    • EXPECTED RESULT: The current program call stack should be shown.
        
  1. Breakpoints Window
    1. Create a JavaFX Script project.
        
    1. Copy the code to the Main file:
   
var a = 10;
var b = 20.5;

var c = a + b;
  		 
    1. Set breakpoints for a, b and c variables
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Go to Breakpoints window.
        
    • EXPECTED RESULT: The Breakpoints window should show set berakpoints.
        
  1. Step Into
    1. Create a JavaFX Script project.
        
    1. Copy the code to the Main file:
   
function a (){
    println("a");
}

function b(){
    a();
}

b();    
    1. Set a breakpoint for the b() call on the last line
        
    1. Debug the project (press <Ctrl+F5>).
        
    1. Press Step Into button (press <F7>) on the toollbar.
        
    • EXPECTED RESULT: The green line should point to the b function body.
        


Test suite: Profile

Purpose:
Setup:

  1. CPU mode
    1. Create a JavaFX Script project that contains a Stage.
   
import javafx.stage.*;

import javafx.scene.*;
import javafx.scene.text.*;
import javafx.scene.paint.*;
import javafx.scene.effect.*;


Stage {
    title: "Hello World"
    width: 250
    height: 80
    scene: Scene {
        content: Text {
            x: 10  y: 30
            font: Font { size: 24 }
            fill: Color.BLUE
            effect: DropShadow{ offsetX: 3 offsetY: 3}
            content: "Hello World!"
        }
    }
}   
    1. Press Profile Main Project... toolbar button.
        
    1. Press OK on Enable Profiling dialog if it appears.
        
    1. Select CPU.
        
    1. Press Run.
        
    • EXPECTED RESULT: The application should start.
        
    1. Close the application.
        
    • EXPECTED RESULT: The application should stop.
        
  1. Live results
    1. Profile the Project from test case 5.1 (Do not close it).
        
    1. Press Live Results button on the Profiler Control Panel in NetBeans.
        
    1. Type run in the filter text field.
        
    1. Select javafxapplication.Main.javafx$run$(com.sun.javafx.runtime.sequence.Sequence) method and invoke Go to source.
        
    • EXPECTED RESULT: Main.fx file should open.
        
  1. Take Snapshot
    1. Profile the Project from test case 5.1 (Do not close it).
        
    1. Press Take Snapshot button on the Profiler Control Panel in NetBeans.
        
    1. Select Main.main(String[]) method and invoke Go to source.
        
    1. Check Call Tree, Hot Spots, Compined and Info tabs.
        
    • EXPECTED RESULT: Main.fx file should open.
        
  1. Memory mode
    1. Create a JavaFX Script project.
        
    1. Press Profile Main Project... toolbar button.
        
    1. Press OK on Enable Profiling dialog if it appears.
        
    1. Select Memory.
        
    1. Press Run.
        
    • EXPECTED RESULT: The application should start.
        
    1. Close the application.
        
    • EXPECTED RESULT: The application should stop.
        
  1. Monitor mode
    1. Create a JavaFX Script project.
        
    1. Press Profile Main Project... toolbar button.
        
    1. Press OK on Enable Profiling dialog if it appears.
        
    1. Select Monitor.
        
    1. Press Run.
        
    • EXPECTED RESULT: The application should start.
        
    1. Close the application.
        
    • EXPECTED RESULT: The application should stop.
        
  1. Threads
    1. Profile the Project in CPU mode.
        
    1. Press Threads button on the Profiler Control Panel in NetBeans.
        
    1. Press the icon to enable threads on the Threads window.
        
    • EXPECTED RESULT: Threads should be shown on the Threads window
        
  1. VM Telemetry
    1. Profile the Project in CPU mode.
        
    1. Press VM Telemetry button on the Profiler Control Panel in NetBeans.
        
    • EXPECTED RESULT: The VM Telemetry window should open.
        


Test suite: Web Deployment

Purpose:
Setup: Check that JRE plugin is installed in FireFox (Ubuntu and others OSes)

  1. Applet
    1. Invoke Properties on project node.
        
    1. Select Run under categories.
        
    1. Select Run in Browser check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    • EXPECTED RESULT: Applet should be started in Browser.
        
  1. Java Web Start
    1. Invoke Properties on project node.
        
    1. Select Run under categories.
        
    1. Select Web Start Execution check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    • EXPECTED RESULT: Application should be started under Java Web Start.
        
  1. Mobile Emulator (Windows only)
    1. Invoke Properties on project node.
        
    1. Select Run under categories.
        
    1. Select Run in Mobile Emulator check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    • EXPECTED RESULT: Application should be started in the Mobile Emulator.
        
  1. Applet parameters
    1. Invoke Properties on project node.
        
    1. Select Application under categories.
        
    1. Set width to 450.
        
    1. Set height to 450.
        
    1. Set Draggable Applet check box.
        
    1. Select Run under categories.
        
    1. Select Run in Browser check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    1. Click <Alt> and drag the applet from a browser (Works only with Firefox 3.0 and JDK 6u12 or later).
        
    • EXPECTED RESULT: Applet should be started in Browser.
        
    • EXPECTED RESULT: Applet should be dragged from Browser (Works only with Firefox 3.0 and JDK 6u12 or later).
        
  1. Self Signed Jar
    1. Invoke Properties on project node.
        
    1. Select Application under categories.
        
    1. Set Self Signed Jar check box.
        
    1. Select Run under categories.
        
    1. Select Run in Browser check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    • EXPECTED RESULT: Applet should be started in Browser.
        
  1. Pack200 Compression
    1. Invoke Properties on project node.
        
    1. Select Application under categories.
        
    1. Set Pack200 Compression check box.
        
    1. Select Run under categories.
        
    1. Select Run in Browser check box.
        
    1. Press OK .
        
    1. Invoke Run Project on the project node.
        
    • EXPECTED RESULT: Applet should be started in Browser.
        


Test suite: Samples

Purpose:
Setup:

  1. WeatherFX Application
    1. Invoke 'File | New Project...' from the main menu bar.
        
    1. Select Samples|JavaFX under Categories.
        
    1. Select JavaFX Weather Application sample.
        
    1. Run the sample.
        
    • EXPECTED RESULT: The sample should start.
        
  1. Best Practices
    1. Invoke 'File | New Project...' from the main menu bar.
        
    1. Select Samples|JavaFX|Building Blocks under Categories.
        
    1. Select a sample.
        
    1. Run the sample.
        
    • EXPECTED RESULT: The sample should start.
        
  1. SDK Samples
    1. Invoke 'File | New Project...' from the main menu bar.
        
    1. Select Samples|JavaFX under Categories.
        
    1. Select a sample.
        
    1. Run the sample.
        
    • EXPECTED RESULT: The sample should start.
        
  1. Meadi Box Samples
    1. Invoke 'File | New Project...' from the main menu bar.
        
    1. Select Samples|JavaFX under Categories.
        
    1. Select Media Box sample.
        
    1. Run the sample.
        
    • EXPECTED RESULT: The Media Box 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