This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 240393 - [80cat] Run Tests failed for basic JavaFX Application
Summary: [80cat] Run Tests failed for basic JavaFX Application
Status: STARTED
Alias: None
Product: qa
Classification: Unclassified
Component: Test Specifications (show other bugs)
Version: 8.0
Hardware: PC All
: P4 normal (vote)
Assignee: Lou Dasaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-13 08:12 UTC by Lou Dasaro
Modified: 2014-03-11 03:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Output when test runs initially (Hello World) (1.64 KB, text/plain)
2014-01-15 16:52 UTC, Lou Dasaro
Details
Output when test runs subsequently (NO "Hello World") - test does NOT actually run. (3.02 KB, text/plain)
2014-01-15 16:53 UTC, Lou Dasaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lou Dasaro 2014-01-13 08:12:34 UTC
Run Tests failed for basic JavaFX Application using NetBeans 8.0 Beta on Ubuntu 12.04 with JDK 1.8.0ea-build 121

Steps
In "Projects" view, select the application class of the previously created JavaFX project.
Invoke Tools | Create Tests action from main menu. "Create Tests" window shows up.
"JUnit" framework should be preselected there. Keep all other default settings and push OK.
"Select JUnit Version" window shows up with "Junit 4.x" option selected. Push Select button to continue.
Test file is generated. Select the project's root node in "Projects" view and invoke Run | Test Project ({projectname}) action from main menu
Comment 1 Lou Dasaro 2014-01-14 07:43:59 UTC
When I wrote this report, I was unable to test a JavaFX App with Junit AT ALL. Today when I retried in order to provide additional information regarding the errors, it works and only emits the two errors I would expect it to, namely, test case is a prototype, and caused an exception running in main thread instead of FX thread. I'll try again tomorrow with a fresh userdir/cachedir, but I expect this will resolve as worksforme.
Comment 2 Lou Dasaro 2014-01-14 21:25:06 UTC
I cannot find the errors that originally caused me to write this report. However, the two errors that DO appear should not arise in a QA setting where we expect the Test Case to succeed. This has resulted in several emails from testers asking the Tribe leader "is this is a bug or to be expected?"

Therefore re-assigning to QA for Test Specification Revision.
Comment 3 Jiri Kovalsky 2014-01-15 08:45:22 UTC
I do not understand this bug report. Can you create JUnit tests and run them via "Test" action on the JavaFX project node or not?
Comment 4 Lou Dasaro 2014-01-15 16:52:06 UTC
Created attachment 143996 [details]
Output when test runs initially (Hello World)
Comment 5 Lou Dasaro 2014-01-15 16:53:43 UTC
Created attachment 143997 [details]
Output when test runs subsequently (NO "Hello World") - test does NOT actually run.
Comment 6 Lou Dasaro 2014-01-15 16:59:56 UTC
(In reply to Jiri Kovalsky from comment #3)
> I do not understand this bug report. Can you create JUnit tests and run them
> via "Test" action on the JavaFX project node or not?

There are inconsistencies/anomalies in "Run Tests":
On the first run, The UI appears, exception is thrown in the output file. See "Output when test runs initially"
After the first run of the tests, cannot consistently run a second time.
The UI does NOT appear. See "Output when test runs subsequently"

Sometimes, choosing a different entry point allows you to run the tests again:
o  From the top menu: Run->Test Project
o  From the popup menu over the project node: Test
Further investigation required...

If you Clean or Clean Build the project, sometimes you can Test again.
All of the above seems to be a Bug.

In any event, when testers run the test, they see the results with the exception, and don't know whether to pass or fail based on the language in the Specification. Thus the Specification should take into account at least part of the above, with improved pass/fail criteria.
Comment 7 swpalmer 2014-02-25 04:09:28 UTC
I can reproduce the issue with inconsistent test runs on Windows - intermittently.

I attribute this to threading issues, since the JUnit tests are not smart enough to know what methods need to run on the FX Platform thread.

Simple JavaFX Application has two methods to test:  main() and start().  "main" will work, i.e. bring up the UI.  "start" will fail because it is called on the wrong thread.  Since "main" starts a new thread, there is a race condition between it returning and the "start" method being tested and the platform thread actually bringing up the UI.

I don't think this is something NB should worry about.
Comment 8 Lou Dasaro 2014-02-25 05:11:24 UTC
Which is why I changed the component of this bug to "Test Specifications". We need a better test case for our test case :-)
Comment 9 Lou Dasaro 2014-03-11 03:26:29 UTC
Occurs on all OSs and JDK versions.

Therefore, for NetCAT testing purposes, I will have to create a helper class to keep us on the correct thread. This will be a download added to the test case for the NEXT release. This is really a P4 bug, just a confusing annoyance.