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 233436 - NB 7.3.1 tests fail on JDK8 with NoSuchFieldException: declaredMethods
Summary: NB 7.3.1 tests fail on JDK8 with NoSuchFieldException: declaredMethods
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: NB JUnit (show other bugs)
Version: 7.3.1
Hardware: PC All
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2013-07-25 14:36 UTC by AlexanderIoffe
Modified: 2013-08-19 17:03 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed fix (1.01 KB, patch)
2013-07-29 14:51 UTC, Theofanis Oikonomou
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description AlexanderIoffe 2013-07-25 14:36:31 UTC
When running tests of NB 7.3.1 on JDK 8 a lot of tests fail with  the same error:
 NoSuchFieldException: declaredMethods

The problem is in NB code which tries to get field "declaredMethods" of the Class object.
This field was removed in JDK 8: 
https://jbs.oracle.com/bugs/browse/JDK-8005232

Full stack trace:
java.lang.NoSuchFieldException: declaredMethods
	at java.lang.Class.getDeclaredField(Class.java:1973)
	at org.netbeans.junit.MethodOrder.orderMethods(MethodOrder.java:86)
	at org.netbeans.junit.MethodOrder.initialize(MethodOrder.java:71)
	at org.netbeans.junit.NbTestCase.<clinit>(NbTestCase.java:99)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:258)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:374)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)

List of failing tests:

org.netbeans.core.ProxyAutoConfigTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.multiview.NoMVCLookupTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.netigso.EnabledAutoloadTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.netigso.IntegrationTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.startup.InstalledFileLocatorAndCLITest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.startup.layers.DynamicSFSFallbackTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.windows.awt.ValidateLayerMenuTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.core.windows.awt.ValidateLayerToolbarTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.junit.NbModuleSuiteContextClassLoaderTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.junit.internal.NbModuleLogHandlerTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.autoupdate.services.FeatureIncompleteTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.DynamicVerifyTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.DynamicVerifyTest:org.netbeans.junit.NbModuleSuite$S::unknown_1
org.netbeans.modules.ide.ergonomics.ErgonomicInfastructureTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.VerifyErgonomicsIDETest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.VerifyFullIDETest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.WizardDeadTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.DisableJ2EEKeepsMobilityEnabledTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.EnableJ2EEEnablesJavaTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.FeaturesOffDemandTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.FoDURLStreamHandlerFactoryTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.FoDUpdateUnitProviderTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ParseXMLContentTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectDuplicatedTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectEnableFailureTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectFalsePositiveTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectOnDemandTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectOpenTriggersAddOnsTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectRejectedTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.ide.ergonomics.fod.ProjectWithDependenciesTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.java.platform.ConvertAsJavaBeanPlatformTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.java.platform.PlatformInstallTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.ContextClassLoaderTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.EnabledAutoloadTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.HookConfiguratorTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.IntegrationTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.LogReaderServiceTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.netbinox.NetigsoHasSAXParserTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.properties.PropertiesEncodingInMimeLookupTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.settings.RecognizeInstanceObjectsOnModuleEnablementTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.settings.convertors.MimeTypeTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.modules.xml.InstanceDataObjectInXMLTest:org.netbeans.junit.NbModuleSuite$S::unknown
org.netbeans.spi.debugger.ui.EngineComponentsProviderTest:org.netbeans.junit.NbModuleSuite$S::unknown
test.pkg.not.in.junit.BrandingAssignedTest:org.netbeans.junit.NbModuleSuite$S::unknown
test.pkg.not.in.junit.NbModuleSuiteMockServiceTest:org.netbeans.junit.NbModuleSuite$S::unknown
Comment 1 Antonin Nebuzelsky 2013-07-26 13:23:54 UTC
Fanis, can we stop calling the removed method via reflection and try another approach?
Comment 2 Theofanis Oikonomou 2013-07-29 14:51:29 UTC
Created attachment 137948 [details]
proposed fix

The patch fixes failing nbjunit tests. Jardo, as I am not the owner of this area, I could go ahead and integrate if you do not have any objections. Thank you
Comment 3 Jaroslav Tulach 2013-07-30 12:43:36 UTC
The patch makes OrderZATest and OrderAZTest in nbjunit fail.
Comment 4 Jaroslav Tulach 2013-07-31 08:54:32 UTC
I assume this will need to be backported to 7.3 version. Don't transplant - merge:

$ hg up -C release73
$ hg merge e1a2a1bb5bc7
$ hg ci -m "Backport to 7.3 version"
Comment 5 Quality Engineering 2013-08-08 02:30:16 UTC
Integrated into 'main-silver', will be available in build *201308072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e1a2a1bb5bc7
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #233436: Use different reflection calls on JDK8
Comment 6 AlexanderIoffe 2013-08-16 17:00:24 UTC
Just adding more tests failing due to this reason:
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testIssue209755
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_01
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_02
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_03
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_04
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_05
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_06
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_07
org.netbeans.modules.php.editor.actions.UsedNamesComputerTest::testUseCase_08

org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedMultipleSections1
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedSimple1
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedSimple2
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedSimple3
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedSimple4
org.netbeans.modules.php.editor.js.JsFormatterEmbeddedTest::testEmbeddedSimple5
Comment 7 AlexanderIoffe 2013-08-16 17:45:16 UTC
More tests with the same failure
org.netbeans.modules.php.editor.parser.astnodes.CommentExtractorTest::testExistingDescription
org.netbeans.modules.php.editor.parser.astnodes.CommentExtractorTest::testExistingDescriptionWithMoreDeclarations
org.netbeans.modules.php.editor.parser.astnodes.CommentExtractorTest::testNoDescription

org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testConnection
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testFilters
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testFiltersLifecoycle
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testJpa
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testJstl
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testListeners
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testServlets
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testServletsLifecycle
org.netbeans.modules.profiler.categories.j2ee.CategoryMarkTest::testStatements

org.netbeans.modules.profiler.categories.j2ee.EjbCategoryMarkTest::testEjbContainer
org.netbeans.modules.profiler.categories.j2ee.EjbCategoryMarkTest::testLifeCycle
org.netbeans.modules.profiler.categories.j2ee.EjbCategoryMarkTest::testPersistence

org.netbeans.modules.profiler.categories.j2ee.EjbFlatProfileTest::testEjbContainer
org.netbeans.modules.profiler.categories.j2ee.EjbFlatProfileTest::testLifeCycle
org.netbeans.modules.profiler.categories.j2ee.EjbFlatProfileTest::testPersistence

org.netbeans.modules.profiler.categories.j2ee.EjbMarkTest::testEJBContainerCategory
org.netbeans.modules.profiler.categories.j2ee.EjbMarkTest::testLifecycleCategory
org.netbeans.modules.profiler.categories.j2ee.EjbMarkTest::testPersistenceCategory

org.netbeans.modules.profiler.categories.j2ee.FlatProfileTest::testConnection
org.netbeans.modules.profiler.categories.j2ee.FlatProfileTest::testStatements
org.netbeans.modules.profiler.categories.j2ee.WebCategoryMarkTest::testJsps
org.netbeans.modules.profiler.categories.j2ee.WebFlatProfileTest::testJsps
Comment 8 AlexanderIoffe 2013-08-16 18:22:12 UTC
org.netbeans.modules.templates.ScriptingCreateFromTemplateTest::testCreateFromTemplateEncodingProperty 
org.netbeans.modules.templates.IndentEngineIntTest::testCreateFromTemplateUsingFreemarker 
org.netbeans.modules.web.core.jsploader.SetModifiedTest::testModifySave 

org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupportTest::testClassBaseLibraryFromLibraryProject
org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupportTest::testClassBaseLibraryWithinCurrentProject
org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupportTest::testCompositeComponentLibraryWithDescriptor
org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupportTest::testCompositeComponentLibraryWithDescriptorFromLibraryProject

org.netbeans.modules.web.jspparser.IdeEnvironmentTest::testAddedJarFile
org.netbeans.modules.web.jspparser.IdeEnvironmentTest::testGetTagLibMap70426
org.netbeans.modules.web.jspparser.IdeEnvironmentTest::testRemovedJarFile

org.netbeans.spi.project.ui.support.ProjectCustomizerListenersTest::testAllListeners 

org.openide.awt.MenuBarCNFETest::testALotOfClassNotFoundExceptions 
org.openide.awt.ToolbarPoolDeadlockTest::testWaitsForToolbars
Comment 9 AlexanderIoffe 2013-08-16 18:26:40 UTC
org.netbeans.junit.OrderTest::shuffleTest 
org.netbeans.junit.OrderZATest::shuffleTest
Comment 10 AlexanderIoffe 2013-08-19 17:03:50 UTC
org.netbeans.junit.NbModuleSuiteOrderTest::testTestCaseOrder