TS 67 Profiler Sanity

Profiler Sanity Test Specification

Author: Emanuel Hucka(original testspec), Alexander Kouznetsov(original testspec), Matus Dekanek
Version: 1.0 Last update: 2009/08/03

Introduction: This document describes test specification of NetBeans Profiler on one platform. The most used platforms by users and for testing is Windows XP 32-bit and Linux FC5 32-bit with JDK 1.6.0. There can be used JDK 1.5.0_04 or higher for all test cases if there is not specified particular jdk version. Comment: This test specification does not describe validation of measured results.

Full version of this testspec is at http://wiki.netbeans.org/ProfilerTestSpecification

Test Specification

To Add

  • export to csv,html,xml(not yet implemented)

Test suite 1: Installation

Purpose: install and prepare profiler and test data.

1.1 Calibration SETUP: Stop all background processes which will not be running during future profiling.
1. Invoke Profiler -> Advanced Commands -> Run Profiler Calibration.
2. Select main Java platform.
Calibration will pass without any errors and exceptions. There should be opened Progress dialog with a message calibration is running during calibration. Calibration is finished by Information dialog about measured times. The values are usually about 1-100 ms (depends on test machine speed).


Test suite 2: J2SE Project and Unit Tests

2.1 Monitoring 1. Press Profile Main Project... in Profile toolbar. Confirm build script modification dialog.
2. Select Monitor Application in Profile WebApplication dialog, check Enable Threads Monitoring option and press Run button.
3. Check if Threads and VM Telemetry Overview windows are opened. Check if both windows are scrolling automatically their contents.
4. There should not be any thread in threads window with 'Profiler' or 'JFluid' in its name.
5. Select a thread in Threads view and invoke Thread details action in its popup menu.
6. Check if Threads (Details) tab in Threads window is selected and if it contains thread's name, 'pie chart' with statistics and line graph with colored thread's states.
7. Select one thread's state section in the line graph. Check if Details sub tab with textual states information is opened and appropriate state is selected.
8. Invoke VM Telemetry button in Profiler Control Panel.
9. Press Zoom Out button (-) until whole Memory (Heap) graph panel is visible. Its horizontal scrollbar should be disabled.
10. Check if the zoomed out graph is alive.
11. Switch to Memory (GC) graph panel and press Scale to Fit button. Whole graph should be scaled into graphs' boundaries. Wait a moment - graph should be alive and it should be shrinked to the panel boundaries - horizontal scrollbar should be disabled. The Scale to Fit button should be replaced by Fixed Scale button.
12. Switch to Threads (Statistics) graph panel, select a part of the graph - press left mouse button somewhere on left side of the part and drag it to the right side of the part. The selected part should be fit into the graph's boundaries.
13. Open Threads window. Go To Profiled Application and close it.
14. Go back to profiler; there should be shown Information dialog 'The profiled application is finished ...' Wait a few seconds - Threads window on backgroud should continue in showing new states of threads.
15. Confirm the dialog and check the Threads window. There should not be any thread with 'Profiler' or 'JFluid' in its name or any new thread created during finishing of application.
16. Profiled application should be stopped. All graphs should be stopped too.
17. Invoke Save Current View button in any graph panel. There should be opened a Select File or Directory with file system structure, preview of the view and PNG in Files of Type. Write a filename and confirm the dialog. Snapshot of selected view should be stored on disk as png file.
18. Close Profiling Control Panel. Invoke Window -> Profiling -> Profiling Control Panel. Profiling Control Panel should be opened again.
Monitoring is verified.
2.2 Analyze Performance 1. Invoke Profile -> Profile Main Project... action.
2. Select CPU, Analyze Performance task, set Entire application and Filter: Profile Only Project Classes. Press Run button.
3. Wait until the application is started. Open Live Results window.
4. There should be a table with measured methods in the Live Results window.
5. Click DrillDown button to open DrillDown window. It should be bound to the right side of live results panel.
6. Invoke Profile -> Advanced Commands -> View Command-line Arguments. JVM and Main class Command-line Arguments window should be opened and contain corresponding information. Close Command-line Arguments window.
7. Invoke Stop (Terminate) the Profilled Application action.
The Live Results window should stay opened with its latest content.
2.3 Analyze Performance - Snapshots 1. Invoke Profiler Control Panel -> Rerun Last Profiling Session.
2. Check Take Snapshot button - it should be enabled during starting of the application. Press the button immediatelly after it is enabled.
3. Wait until the application is fully started and invoke its Close Window action.
4. There should appear Application Finished dialog asking if you want to take a snapshot of the finished application. Confirm it by pushing the Yes button.
5. Check if both taken snapshots contain measured data. The second snapshot should contain more measured methods than the first.
6. Go to the first snapshot and invoke Close Window action on it. It should ask if you want to save the snapshot. Press No button.
7. In the remaining snapshot window invoke Save Snapshot to Project, close it and open it again from Saved Snapshots list in Profiler Control Panel.
8. Invoke Find action from IDE's toolbar, write e.g. "show" into opened dialog's textfield and confirm the Find in Results dialog by Find button. Try to jump through all occurences of the word by Find previous occurance and Find next occurance in the snapshot.
9. Try to change View to Classes and Packages - the results tree should be changed by appropriate way. Return back to Methods view.
10. Check sorting of the results tables by each column - press the column title bar.
11. Invoke Save Current View button in the snapshot's toolbar. There should be opened a Select File or Directory with file system structure, preview of the view and 'PNG' in Files of Type combo. Write a filename and confirm the dialog. Snapshot of selected view should be stored on disk as png file.
12. Go to e.g. java.awt.Component.show(boolean) method, invoke popup menu on it and press Show Back Traces action. It should switch to Back Traces for: show tab and show back traced methods of the selected method.
13. Select Combined tab of the snapshot window, try to select methods in both parts of splited panel and check if there is always selected equivalent method in the other panel.
14. Use Method Name Filter in the bottom panel to find com.toy.anagrams.ui.Anagrams.main (e.g. set Starts With filter type, write 'com.toy' to filter line and confirm) and double click on the method. It should jump into Java editor with Anagrams.java to the selected method's code.
15. Browse Info tab panel of the snapshot. It should contain information about profiling settings, e.g. Profiling Type: CPU Profiling (Entire Application) etc.
16. Select the snapshot in Saved Snapshots list of Profiler Control Panel, press Save As... button, choose a path and file name and save the snapshot there.
17. Delete the snapshot by Delete button. Invoke Load... action in Saved Snapshots, select the previous file and confirm file dialog.
The snapshot should be loaded.
2.4 Analyze Performance - Root Methods 1. Invoke Profile -> Profile Main Project... action. Select Analyze Performance task, set Entire application and Filter: Profile All Classes. Press Run button. Wait until the application is started. Open Live Results window.
2. Invoke Guess action in the application. Go to live results table, find the com.toy.anagrams.ui.Anagrams.guessedWordActionPerformed(java.awt.event.ActionEvent) method, invoke its popup menu and select Add to Instrumentation Roots.... In the opened Select Settings Configuration dialog select Analyze Application item and confirm the dialog by OK button.
3. Invoke Profile -> Stop action and wait until the profiler is not finished. Invoke Profile -> Profile Main Project... action.
4. In Select Profiling Task dialog choose Part of Application radio button. "edit..." link next the radio button should be enabled and there should be text '1 root method' next to Part of Application radio button.
5. Click "edit..." link. Check if there is com.toy.anagrams.ui.Anagrams.guessedWordActionPerformed(java.awt.event.ActionEvent) method in Selected Root Methods list in the Specify Root Methods dialog.
6. Invoke Add From Project button. In the opened Select Root Methods dialog open nodes of the Projects tree to AnagramGame -> Sources -> com -> toy -> anagrams -> ui -> Anagrams -> Methods. All these nodes should have shadowed checked checkboxes in front of their names. Check checkbox for nextTrialActionPerformed(java.awt.event.ActionEvent) method and confirm the dialog by OK button. Selected Root Methods list should contain two methods now.
7. Confirm Specify Root Methods dialog by OK button and Select Profiling Task dialog by Run button. Wait until the application is not started and open Live Results window.
8. Browse Live Results window and Basic Telemetry part of Profiler Control Panel (there is Instrumented: label with number of instrumented methods). Press Guess button in the profiled application and watch the Live Results and Basic Telemetry. The number of instrumented methods should increase to about 700, the same for Live Results window. Press New Word button in the application - another methods should be measured/instrumented.
9. Invoke Reset Collected Results action from Profiler Control Panel. Live Results Window should be emptied. Switch to the profiled application window - no methods should be shown in Live Results window.
10. Invoke File -> About action in the profiled application - live results should not be changed.
11.Invoke Profile -> Advanced Commands -> Display Internal Statistics. Internal Statistics of Instrumentation and Hotswapping Operation window should be opened and contain corresponding information. Push Close button.
12. Press Guess button in the profiled application. And finish profiling of the application.
13. Open Java file : Invoke context menu: Profiling -> Add As Profiling Root Method.
14. Open Java file : Invoke context menu: Select Profiling Root Method
There should be 'many' measured methods in Live Results window.
2.5 Analyze Memory Usage - Snapshots 1. Invoke Profile -> Profile Main Project... action. Select Analyze Memory Usage task. Leave default settings - Record object creation only, Track every 10 object allocations, enabled Record Stack Trace for Allocations. Confirm dialog by Run button.
2. Check Take Snapshot - button it should be enabled during starting of the application. Press the button immediatelly after it is enabled. Memory snapshot should be opened. Switch back to Live Results window.
3. Choose e.g. java.util.HashMap in the Live Results panel and invoke Take Snapshot and Show Allocation Stack Traces action from its popup menu. A new snapshot should be opened with selected Allocation Stack Traces tab panel.
4. Wait until the application is fully started and invoke Close Window action of the profiled application.
5. There should appear Application Finished dialog asking if you wan to take snapshot of finished application. Confirm it by Yes button.
6. Check if all taken snapshots contain measured data.
7. Go to the first and second snapshot and invoke Close Window action on them. It should ask if you want to save the snapshot. Press No button.
8. In the remaining snapshot window invoke Save Snapshot to Project, close it and open it again from Saved Snapshots list in Profiler Control Panel by Open button or double click into the snapshots list.
9. Press Ctrl+F, write e.g. "Long" into opened dialog's textfield and confirm the Find in Results dialog by Find button. Try to jump through all occurences of the word by Find previous occurance and Find next occurance in the snapshot.
10. Try to switch to Allocation Stack Traces tab of the snapshot window. It should be empty now. Switch back to Memory Results panel, select e.g. java.lang.String class, invoke its popup menu and choose Show Allocation Stack Traces action. It should be switched to Allocation Stack Traces tab with all stacktraces of the class.
11. Press Show or hide results column button in the right-top corner of Memory Results panel, uncheck Bytes Allocated, Objects Allocated, Filter items. There should remain only two columns in Live Results table. Press the button again and enable all items in the menu. All columns should be shown as before.
12. Invoke Save Current View button in the snapshot's toolbar. There should be opened a Select File or Directory with file system structure, preview of the view and 'PNG' in Files of Type combo. Write a filename and confirm the dialog. Snapshot of selected view should be stored on disk as png file.
13. Browse Info tab panel of the snapshot. It should contain information about profiling settings, e.g. Profiling Type: Memory (Allocations Only) etc.
14. Select the snapshot in Saved Snapshots list of Profiler Control Panel, press Save As... button, choose a path and file name and save the snapshot there.
15. Delete the snapshot by Delete button. Invoke Load... action in Saved Snapshots, select the previous file and confirm file dialog.
16. Invoke Profile -> Load Snapshot.
17. Profile -> Compare Memory Snapshots
The snapshot should be loaded.
2.6 Analyze Memory Usage - Class History 1. Invoke Profile -> Profile Main Project... action. Select Analyze Memory Usage task. Leave current settings - Record both object creation and garbage collection, Track every 10 object allocations, enabled Record Stack Trace for Allocations. Confirm dialog by Run button.
2. Open Live Results window, select class 'char[[ | ]]' and invoke Log Class History action from its popup menu.
3. There should be enabled History of char[[ | ]] tab panel in live results window. Go to the tab and press Scale to Fit button.
4. Invoke some actions in profiled application. Both history graphs should be increased. Try to invoke Run GC action from Profiler Control Panel several times. The Live Objects graph should be decreased.
5. Invoke Save Current View button in Live Results toolbar. There should be opened a Select File or Directory with file system structure, preview of the view and PNG in Files of Type. Write a filename and confirm the dialog. Snapshot of selected view should be stored on disk as png file.
6. Go back to Live Results tab, select 'int[[ | ]]' class and invoke Log Class History on it. The History tab name should be changed to History of int[[ | ]] , values in the graph should be changed too.


Test suite 3: NB Module

Setup: Create and open a sample NB project Paint Application - File -> New Project -> Samples -> NetBeans Plug-in Modules -> Paint Application. The project should be set as main project. Try to start project by Run action and check if all works.

# Test Case Description Expected Results
3.1 Integration 1. Select opened project and invoke popup menu (in Projects view).
2. Popup menu should contain enabled Profile Project menu item.
3. Set the project as main project (if it is not) and check if menu action Profile -> Profile Main Project is enabled.
4. Profile Main Project action in Profile toolbar should be enabled too.
5. Press Profile Main Project action in Profile toolbar. Press Cancel button in opened Select Profiling Task dialog.
3.2 Analyze Performance SETUP: Close all documents.
1. Invoke Profile -> Profile Main Project... action. Select CPU and click "Create Custom..." link.
2. In New Custom Configuration (CPU) dialog change its name to 'testconfig' and click OK.
3. Click Advanced Settings link.
4. Select Exact Call Tree, Sampled Timing.
5. Execute profiling by Run button and watch Take Snapshot button. Immediatelly after the button is enabled, press it. It should take non empty CPU snapshot - close it without saving. Wait until whole application is started.
6. In the started application open New Canvas and paint something there. Close the application and confirm Application finished dialog in profiler by Yes button.
7. In the taken snapshot go to Hot Spots, find method org.netbeans.paint.PaintCanvas.mouseMoved, invoke its popup menu and select Add to Instrumentation Roots. In Select Settings Configuration dialog select 'testconfig' configuration and confirm it by OK button.
8. Invoke Profile -> Profile Main Project... action. Leave 'testconfig' custom profiling selected, choose Part of Application. Click "Edit" link next to "1 root method" label.
9. In Specify Root Methods select the method (mouseMoved) and press Remove button. Press Add From Project button. In Select Root Methods dialog open nodes Paint Application -> Sources -> org -> netbeans -> paint -> PaintCanvas -> Methods and select mouseDragged(java.awt.event.MouseEvent) method. Confirm dialogs Select Root Methods and Specify Root Methods by OK button - Specify Root Methods should contain one selected method in Root Methods list.
10. Confirm Select Profiling Task by Run button. Wait until the application is started.
11. Open Live Results window - it should be empty. Go to the profiled application, create new canvas and try to draw something. The first movements of stroke could be slow - instrumentation is running on background. There should be measured methods in Live Results window.
12. Select method org.netbeans.paint.PaintCanvas.mouseDragged(java.awt.event.MouseEvent), invoke its popup menu and press Go To Source action. There should be opened editor with the selected class and its cursor should be moved to the selected method.
13. Invoke Take Snapshot action.
14. Invoke Profile -> Stop Profiling Session.
Profiled application should be finished.
3.3 Analyze Memory Usage 1. Invoke Profile -> Profile Main Project... action. Select Monitor Application task, enable Threads Monitoring and press Run button.
2. Wait until the application is started and open New Canvas there.
3. Check Threads window if it is working. Invoke Modify Profiling action, select Analyze Memory Usage, Record object creation only and enable Record Stack Trace for Allocations. Confirm the Modify Profiling Task dialog by OK button.
4. Play with application to produce some profiling results.
5. Open Live Results window and check memory results. Select java.awt.event.MouseEvent class, invoke its popup menu and press Log Class History.
6. Switch to the enabled tab of Live Results 'History of java.awt.event.MouseEvent'. Scale to Fit the view.
7. Go to the profiled application and draw something.
8. Return back to history graph - both graphs should be increased evidently.
9. Stop profiling.


Test suite 4: Web Project

Setup: Open WebApplication project from web.zip. Use default configured IDE with default Tomcat server. Check configuration by invoking action Run Project on the project - project should be executed without any problem.

# Test Case Description Expected Results
4.1 Monitoring 1. Press Profile Main Project... in Profile toolbar. Confirm build script modification dialog.
2. Select Monitor Application in Profile WebApplication dialog, check Enable Threads Monitoring option and press Run button.
3. Check if Threads and VM Telemetry Overview windows are opened. Check if both windows are scrolling automatically their contents.
4. There should not be any thread in threads window with 'Profiler' or 'JFluid' in its name.
5. Select a thread in Threads view and invoke Thread details action in its popup menu.
6. Check if Threads (Details) tab in Threads window is selected and if it contains thread's name, 'pie chart' with statistics and line graph with colored thread's states.
7. Select one thread's state section in line graph. Check if Details sub tab with textual states information is opened and appropriate state is selected.
8. Invoke VM Telemetry button in Profiler Control Panel.
9. Press Zoom Out button (-) until whole Memory (Heap) graph panel is visible. Its horizontal scrollbar should be disabled.
10. Check if the zoomed out graph is alive.
11. Switch to Memory (GC) graph panel and press Scale to Fit button. Whole graph should be scaled into graphs' boundaries. Wait a moment - graph should be alive and it should be shrinked to the panel boundaries - horizontal scrollbar should be disabled. The Scale to Fit button should be replaced by Fixed Scale button.
12. Switch to Threads (Statistics) graph panel, select a part of the graph - press left mouse button somewhere on left side of the part and drag it to the right side of the part. The selected part should be fit into the graph's boundaries.
13. Open Threads window. Go To Profiled Application and close it.
14. Go back to profiler there should be shown Information dialog 'The profiled application is finished ...' Wait a few seconds - Threads window on backgroud should continue in showing new states of threads.
15. Confirm the dialog and check the Threads window. There should not be any thread with 'Profiler' or 'JFluid' in its name or any new thread created during finishing of application.
16. Profiled application should be stopped. All graphs should be stopped too.
17. Invoke Save Current View button in any graph panel. There should be opened a Select File or Directory with file system structure, preview of the view and PNG in Files of Type. Write a filename and confirm the dialog. Snapshot of selected view should be stored on disk as png file.
Monitoring is verified.


Test suite 5: EJB - Glassfish

Setup: Open OrderSystem project from order_system.zip with all its required projects. Use IDE with fresh userdir, register latest stable version of glassfish server to Services -> Servers. Check if Java DB is running - Tools -> Java DB Database -> Start Server is disabled. Resolve all confilcts after opening of the project and try to Run the project by Run -> Run Main Project action to check if all settings are correct.

# Test Case Description Expected Results
5.1 Integration 1. Select opened project and invoke popup menu (in Projects view).
2. Popup menu should contain enabled Profile Project menu item.
3. Set the project as main project (if it is not) and check if menu action Profile -> Profile Main Project is enabled.
4. Profile Main Project action in Profile toolbar should be enabled too.
5. Press Profile Main Project action in Profile toolbar. Select default Java platform in Select Java Platform for Profiling dialog, check Always use the selected platform for profiling and confirm the dialog.
6. Confirm opened Question dialog (This is the first time this project ...). Press Cancel button in opened Select Profiling Task dialog.
Project's build script should be updated - there should be added line:
<import file="nbproject/profiler-build-impl.xml"/>.
Origin build script should be backed up under name build-before-profiler.xml. Project's nbproject folder should contain profiler-build-impl.xml file.
5.2 Integration Server 1. Invoke Profile -> Profile Main Project menu action. Select Monitor Application and confirm the dialog by Run button.
TEARDOWN: Stop Application server by invoking of action Stop on Services -> Servers -> <Glassfish Server name>.
The application server should be started in profile mode. The application should be running, Threads view should show threads on the server.
5.3 Profile Mode 1. Invoke the popup menu on Services -> Servers -> <Glassfish Server name> and press Start in Profile Mode.
2. Confirm the Information dialog about used JDK and agent port number. There should be shown log from Application Server with Profiler Agent: Initialized succesfully at the end.
3. Invoke Attach profiler action from ide toolbar. Select Project OrderSystem. Click "change" link next to "Attach mode" label in the bottom to open Attach Wizard, select J2EE Web/App Server target type, server type glassfish, local attach method, direct attach invocation, press next and finish the wizard.
4. Select Monitor Application, enable Threads and confirm the Select Profiling Task dialog by Attach button.
TEARDOWN: Detach the server. Confirm Question dialog 'Do you want to terminate the profiled application upon detach?'
Profiler should attach to application server. Server should be started and threads view should show its threads states.
5.3 Glassfish v3 Setup: Open WebApplication project from web.zip. Open properties of the project and as a server set the Glassfish v3 server.
1. Perform the same testing as for Order system project.
The project should run without any problems.


Test suite 6: Attach Profiler

# Test Case Description Expected Results
6.1 Local - Direct - Application SETUP: Build the sample J2SE project AnagramGame, go to its dist folder outside of ide and create an execution script there - containing simple: java -jar anagrams.jar. Try to execute the application by the script and close the application if the script is working.
1. Invoke Attach Profiler action from ide's toolbar. Select Project: AnagramGame and task Analyze Performance - Entire Application, Profile All Classes. Click "define..." link in the bottom.
2. Select Application Target Type, Local Attach method, Direct Attach invocation. Press Next button two times. Copy the extra argument from Step 1 and paste it to the prepared execution script before '-jar'. Press Finish button in Attach wizard.
3. Start the application by modified script. Go to the ide and perform Attach button in Select Profiling Task dialog.
4. Open Live Results window and check measured methods. Perform some actions in profiled application and check Live Results. Live Results should be non empty with appropriate measured methods.
5. Close the profiled application by its Close window button. Application Finished dialog should be opened in profiler - profiling should be finished.
6. Start the application again, attach to it and wait until the application is running.
7. Perform Detach from the Profiled Application, press No button in appeared dialog.
TEARDOWN: close the profiled application.
The application should run without problem.


Test suite 7: HeapWalker

Setup: Prepare a heapdump. Start <JDK16_HOME>/bin/jconsole, select a PID with org.netbeans.Main name and invoke Connect. Go to MBeans tab, select com.sun.management -> HotSpotDiagnostic -> Operations. In the panel write a file path (e.g. /tmp/nbheapdump) to the p0 textfield next to dumpHeap button and press the dumpHeap button. There should invoke Info dialog about successfully invoked method - close the jconsole.

# Test Case Description Expected Results
7.1 Summary 1. Profile -> Take Heap Dump (Destination - Profiled project, custom directory)
2. Open the heapdump by Profile -> Load Heap Dump menu action.
3. Check Summary information.
7.2 Classes SETUP: Switch to Classes page
1. Check sorting of heapdump table by each column - press the column title bar.
2. Press Show or hide columns small button in the right-top corner of the table, uncheck Instances, Size, Filter items. There should remain only two columns in heapdump table. Press the button again and enable all items in the menu. All columns should be shown as before.
3. Go to Class Name Filter (bottom line of heapdump panel) and select Ends with filter type. Write Buffer and press Enter. Classes table should contain only 'Buffers'. Press Clear current filter_ - button with red cross on the filter line. Table should contain all classes again. Try to select e.g. Regular expression filter type - write .*Map to filter textfield and press Apply new filter button - there should be shown all 'Maps'. Press Clear current filter button.
4. Select e.g. java.lang.String class and press Static Fields button (top-right corner of window). Static Fields panel should be inserted to the right side of heapdump window. There should be shown all static fields of String class (class, serialVersionUID etc.). There should be shown icons legend in the bottom line of the window (Array Type, Object Type etc.)
5. Press Instances button. An empty panel should be shown with No class selected message. Switch back to Classes view.
6. Select e.g. java.lang.String and invoke its popup action Go to Source. It should open source file of java.lang.String class in editor and move cursor to class definition. (It doesn't work on some JDKs on mac os x).
7. Select e.g. java.io.File class in Classes heapdump window, invoke its popup menu and press Show in Instances View action.
It should change view to Instances with three panels Instances, Fields and References of the class java.lang.String.
7.3 Instances 1. Try to close and open again all panels in Instances view. Use 'x' buttons in right-top corner of each panel and buttons with icons on heapdum window toolbar. Try to change size of panels - after closing and opening again the size of panel should be preserved.
2. Check the legend line bellow the toolbar - there should be name of class and some statistics about it.
3. Try to switch on and off all available columns in each panel by Show or hide columns button (top-right corner of each panel).
4. Try to sort instances list table by particular columns - press title of the column.
5. Find a table cell (mostly in Fields or References panels) which`s content is not fully displayed (ends by ...). Move mouse cursor over the cell and check if its full content is shown in appeared tooltip.
6. Select a node of non-primitive type in Fields or References panel. Invoke its popup menu and press Show Instance action. Instances of the class should be displayed in heapdump window and there should be selected the instance in Instances list panel.
7. Select a node of non-primitive type in Fields panel. Invoke its popup menu and press Show in Classes View action. Classes view should be displayed in heapdump wind with the selected class. Return back to Instances.
8. Select a node of non-primitive type in Fields or References panel. Invoke its popup menu and press Go to Source action. The editor with source of the class should be opened in ide.
7.5 OQL console SETUP: create/open standart Anagram game project.
1. Start profiling the project. Use Memory settings, Record both object creation and garbage collection, check Record stack traces for allocations.
2.Wait until the application starts. Invoke Profile/Take Heap dump(confirm all dialogs)).
3. In open heap dump go to OQL console tab. In Saved queries select one, click on Open button. In Query editor click on Execute.
4. Close the Heap dump and open it again (or create a new one). Repeat the query.
There should be some result in the Query result window, or message that query returned no results.
7.6 Retained size 1. Go to summary tab.
2. Enable the inspect panel, if not yet enabled. Push the find button in this panel. A confirmation dialog should appear, confirm it. After a few seconds a list of the 20 biggest objects should apper in the panel.
3. Click on one of the 20 biggest listed object. The instances panel should appear with the selected instance.
4. Enable the instances panel if not yet enabled. Press the show or hide columns button and check Retained category.
5. Sort the instances according to the retained size.
The object should be correctly sorted.


Test suite 8: Profiling Points

Comment: Profiling points should be tested in each project type - j2se, web, nb project, applet and ejb.

# Test Case Description Expected Results
8.1 Stopwatch and Reset Results 1. Open Anagrams.java source file in editor. Move cursor to the first line of method guessedWordActionPerformed (there is if command). Invoke popup menu there and press Profiling -> Insert Profiling Point menuitem.
2. Select Profiling Point Type Stopwatch. Click Next button. Confirm default settings by pressing Finish button.
3. The stopwatch annotation should be added to the line, line should have different background color.
4. Invoke popup menu on the annotation, there should be Profiling Point submenu containing Enabled, Customize, Delete and Go To End Point options. Select Go To End Point. Warning message is shown. Select Profiling Point > Customize menu item.
5. Choose Timestamp and duration radio button. Location (end) controls gets enabled. Move cursor to the last line of method guessedWordActionPerformed (there is command guessedWord.requestFocusInWindow();) in editor. Push Current Line button in the Location (End) section. Click OK button.
6. Invoke popup menu on the end stopwatch annotation, select Profiling Point -> Go To Start Point. Cursor should be moved to the start stopwatch line. Invoke popup menu on the start stopwatch annotation, select Profiling Point -> Go To End Point. Cursor should be moved to the end stopwatch line.
7. Move cursor to the first line of method nextTrialActionPerformed. Press Shift-F9. Reset Results profiling point is inserted and Customize Profiling Point dialog is shown. Confirm it by OK button.
8. Invoke Profile -> Profile Main Project... action. Select Analyze Performance task, set Entire application and Filter: Profile Only Project Classes. Ensure that Use defined Profiling Points option is enabled and Show active Profiling Points link opens list with two Profiling Points. Press Run button.
9. Wait until the application is started and press its Guess button five times. Profiling Points window should show 5 hits for Stopwatch profiling point and no results available for reset results profiling point.
10. Click report link for Stopwatch profiling point. Report window should be shown, for each hit timestamp and duration should be shown.
11. Open Live Results. There should be some measured methods. Click New Word button in profiled application. Live Results should show only two methods from now.
12. Click report link for Reset Results in Profiling Points window. Report window should be shown, for each hit timestamp should be shown.
13. Stop Profiling. Start Profing again having User defined Profiling Points option disabled. Play with application. No results for profiling points should be shown. Stop Profiling.
14. Right-click Reset Results in Profiling Points window and select Show in Source menu item. Cursor should be moved to first line of nextTrialActionPerformed method.
15. Rigth-click its annotation and select Profiling Points > Enabled. Reset Results Profiling point should be shown gray in editor and Profiling Points window.
16. Right-click Stopwatch in Profiling Points window and select Show Start in Source menu item. Cursor should be moved to first line of guessedWordActionPerformed method. Right-click Stopwatch in Profiling Points window and select Show End in Source menu item. Cursor should be moved to last line of guessedWordActionPerformed method.
17. Rigth-click its annotation and select Profiling Points > Delete. Stopwatch Profiling point should be removed from editor and Profiling Points window.


Test suite 9: Maven projects support

Purpose: test support for maven projects Setup: open File:Mavenproject31 ProfilerTestSpecificationSanity.zip mavenproject3 and test whether it runs. It is console program that is computing prime numbers and should run a few seconds.

# Test Case Description Expected Results
9.1 Thread monitoring 1. Press Profile Main Project... in Profile toolbar.
2. Select Monitor Application in Profile dialog, check Enable Threads Monitoring option and press Run button.
3. Wait until the application ends and confirm 'end profiling' dialog. 4. Check if Threads and VM Telemetry Overview windows are opened.
5. There should not be any thread in threads window with 'Profiler' or 'JFluid' in its name. There should be more than 100 threads. Most of them should have been running very shortly and sleeping most of the time.
6. Select a thread in Threads view and invoke Thread details action in its popup menu.
7. Check if Threads (Details) tab in Threads window is selected and if it contains thread's name, 'pie chart' with statistics and line graph with colored thread's states.
8. Select one thread's state section in the line graph. Check if Details sub tab with textual states information is opened and appropriate state is selected.
9. Invoke VM Telemetry button in Profiler Control Panel.
10. Press Zoom Out button (-) until whole Memory (Heap) graph panel is visible. Its horizontal scrollbar should be disabled.
10. Check if the zoomed out graph is alive.
12. Switch to Memory (GC) graph panel and press Scale to Fit button. Whole graph should be scaled into graphs' boundaries. Wait a moment - graph should be alive and it should be shrinked to the panel boundaries - horizontal scrollbar should be disabled. The Scale to Fit button should be replaced by Fixed Scale button. 13. Swith to Threads/loaded classes tab.
There should be a graph with about 100 threads on the beginning, with decreasing count.
9.2 Performance 1. Press Profile Main Project... in Profile toolbar.
2. Select Analyze performance in Profile dialog, create custom settings.
Select profile entire application and profile only project classes. Click on the Run button.
3. Wait until the application ends and confirm the Application finished dialog. A snapshot is taken.
4. Check the snapshot: there should be 32 threads (limit for profiled thread count). Most of them should have in the call tree only the method run().
5. Select one thread, expand its node and invoke find in hot spots action in the popup menu of some of the methods in the expanded tree. Method should be selected in the hot spots.
6. Invoke go to source on some method. A corresponding soure file should be open with the cursor on the method.
7. Go to hot spots. There should be only three methods (main, PrimeThread init and PrimeThread.run), the PrimeThread.run method should have longest time.
8. Go again to the call tree tab. Check the sorting of the table, according to time and name.
9. Save the snapshot to the project and close it. Open it again from the list of saved snapshots.
The snapshot should be open.


Test suite 10: Profile me!

Purpose: install and prepare profiler and test data.

10.1 Basic functionality 1. Enable the memory toolbar. There should be a profile me button (the tooltip should show the purpose of the button).
2. Push the profile me button. Do some actions (open some project). Press the button again. A profiling snapshot should be taken and open.
3. Check the threads: there should be more than 20 threads. There should be AWT-EventQueue thread, as the IDE is desktop application.
4.Check sorting of the columns. Expand some node, select some method in the expanded node and invoke find in hot spots on it (popup menu). The method should be selected in hot spots.
5.Go to info tab. It should contain information about the profiling session.
The snapshot is not saved. It can be saved as a file.


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