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 237546

Summary: Failing Tests on JDK8
Product: php Reporter: Jiri Skrivanek <jskrivanek>
Component: EditorAssignee: Tomas Mysik <tmysik>
Status: VERIFIED WORKSFORME    
Severity: normal CC: AlexanderIoffe, mmirilovic, phejl
Priority: P3 Keywords: JDK_8, JDK_SPECIFIC, TEST
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 240418    
Bug Blocks:    
Attachments: Patch

Description Jiri Skrivanek 2013-10-23 11:42:56 UTC
Please, fix tests failing on JDK8:

org.netbeans.modules.php.editor.PHPBracesMatcherTest
org.netbeans.modules.php.editor.actions.FixUsesPerformerTest
org.netbeans.modules.php.editor.actions.ImportDataCreatorTest
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest
org.netbeans.modules.php.editor.parser.astnodes.CommentExtractorTest

To reproduce:

ant -f php.editor test-unit

http://test4u.cz.oracle.com/job/StableBTD-trunk/lastCompletedBuild/testReport
Comment 1 Ondrej Brejla 2013-10-23 12:44:27 UTC
CCing Petr, he maintains JsFormatterEmbeddedTest.
Comment 2 Ondrej Brejla 2013-12-09 13:41:56 UTC
It seems to be Nashorn connected. If I run some PHP test which is failing, then this exception occurs in the output:

java.lang.NoSuchMethodError: jdk.nashorn.internal.codegen.Compiler.compiler(Ljdk/nashorn/internal/runtime/Source;Ljdk/nashorn/internal/runtime/Context;)Ljdk/nashorn/internal/codegen/Compiler;
	at org.netbeans.modules.javascript2.editor.parser.JsParser.parseSource(JsParser.java:96)
	at org.netbeans.modules.javascript2.editor.parser.SanitizingParser.parseContext(SanitizingParser.java:154)
	at org.netbeans.modules.javascript2.editor.parser.SanitizingParser.parseContext(SanitizingParser.java:134)
	at org.netbeans.modules.javascript2.editor.parser.SanitizingParser.parseSource(SanitizingParser.java:122)
	at org.netbeans.modules.javascript2.editor.parser.SanitizingParser.parse(SanitizingParser.java:84)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParse(TaskProcessor.java:605)

...and testing method ends up due to time out. Maybe JS2 support is not ready for JDK8 nashorn? I even can't build JS2 module, internal Nashorn seems to have another method signatures then JS2 editor support uses (e.g. in PathNodeVisitor: "enter(AccessNode accessNode)" vs "enterAccessNode(AccessNode accessNode)"). Not sure, can you evaluate it? Thanks!
Comment 3 Marian Mirilovic 2014-01-07 09:31:28 UTC
Petr, is there any update ? 

This is a part of the regression test suite run by JDK team , so we need to have evaluation ASAP. Thanks in advance.
Comment 4 Petr Hejl 2014-01-07 09:42:05 UTC
(In reply to Marian Mirilovic from comment #3)
> Petr, is there any update ? 
No.
> This is a part of the regression test suite run by JDK team , so we need to
> have evaluation ASAP. Thanks in advance.
NB test infrastructure obviously ignoring OpenIDE-Module-Hide-Classpath-Packages in manifest.mf. Unless this is being fixed I can only comment out the test.
Comment 5 Jiri Skrivanek 2014-01-07 10:07:00 UTC
Yes, please exclude failing tests in project.properties from stableBTD config and add blocking bug for this bug.
Comment 6 Petr Hejl 2014-01-13 15:04:42 UTC
Excluded - web-main 233bca3e7fd6.
Comment 7 Petr Hejl 2014-01-15 13:11:28 UTC
*** Bug 234612 has been marked as a duplicate of this bug. ***
Comment 8 Petr Hejl 2014-01-15 13:37:49 UTC
All failing tests excluded - web-main 34b1ad9b2e9a.
Comment 9 Petr Hejl 2014-01-15 13:40:03 UTC
From blocking bug:

Do you use NbModuleSuite? If not, it is obvious that package hiding cannot work (because there are no classloaders).

Try to wrap your tests with NbModuleSuite. If you still have problems, re-open.
Comment 10 Quality Engineering 2014-01-16 02:43:45 UTC
Integrated into 'main-silver', will be available in build *201401160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/34b1ad9b2e9a
User: Petr Hejl <phejl@netbeans.org>
Log: #237546 - Failing Tests on JDK8
Comment 11 Petr Hejl 2014-07-18 08:43:07 UTC
I have fixed PHPFormatterQATest, JsFormatterEmbeddedTest and PHPBracesMatcherTest in web-main cc65a0453ad0 and ece4e3c19d24.

Other tests ignored are:
CommentExtractorTest
FixUsesPerformerTest
ImportDataCreatorTest
UsedNamesComputerTest

I tried to run them on JDK8, but I get some timeout and failures which does not seem to be related to Nashorn. Ondro can you look at those? Feel free to reassign back to me if it is somehow JS related. Thanks.
Comment 12 Ondrej Brejla 2014-07-18 08:53:21 UTC
Thanks, I'll look at it probably on Monday.
Comment 13 Ondrej Brejla 2014-07-18 09:57:56 UTC
Hmm...e.g. CommentExtractorTest passes on my Mac with JDK8 properly, but e.g. ImportDataCreatorTest still fails on:

java.lang.NoSuchMethodError: jdk.nashorn.internal.codegen.Compiler.compiler(Ljdk/nashorn/internal/runtime/Source;Ljdk/nashorn/internal/runtime/Context;)Ljdk/nashorn/internal/codegen/Compiler;
	at org.netbeans.modules.javascript2.editor.parser.JsParser.parseSource(JsParser.java:96)
Comment 14 Ondrej Brejla 2014-07-18 10:04:09 UTC
UsedNamesComputerTest was renamed and passes as well.

So the problem is only in 3 tests of FixUsesPerformerTest which I have to fix (probably some wrong order of items in collection) and in ImportDataCreatorTest which fails on:

java.lang.NoSuchMethodError: jdk.nashorn.internal.codegen.Compiler.compiler(Ljdk/nashorn/internal/runtime/Source;Ljdk/nashorn/internal/runtime/Context;)Ljdk/nashorn/internal/codegen/Compiler;
	at org.netbeans.modules.javascript2.editor.parser.JsParser.parseSource(JsParser.java:96)

1st problem is mine
2nd should probably fix Petr...can you look at it? Thanks.

Please, don't forget to clean build php.editor before running tests. And to see proper exceptions comment out PHPTestBase.setUp -> suppressUselessLogging();

Thanks!
Comment 15 Quality Engineering 2014-07-19 10:18:50 UTC
Integrated into 'main-silver', will be available in build *201407190718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cc65a0453ad0
User: Petr Hejl <phejl@netbeans.org>
Log: #237546 - Failing Tests on JDK8
Comment 16 Ondrej Brejla 2014-08-11 09:26:45 UTC
Created attachment 148638 [details]
Patch

Patch for JS Nashorn issue - JDK8 vs. NetBeans
Comment 17 Tomas Mysik 2016-05-25 09:13:32 UTC
This already works.