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.
See project files attached! Test class sun.jdbc.odbc.JdbcOdbcDriver__Test was created by NetBeans tool, but does not run because of error: Testcase: testGetAttributeProperties(sun.jdbc.odbc.JdbcOdbcDriver__Test): Caused an ERROR tried to access method sun.jdbc.odbc.JdbcOdbcDriver.getAttributeProperties(Ljava/lang/String;)Ljava/util/Hashtable; from class sun.jdbc.odbc.JdbcOdbcDriver__Test java.lang.IllegalAccessError: tried to access method sun.jdbc.odbc.JdbcOdbcDriver.getAttributeProperties(Ljava/lang/String;)Ljava/util/Hashtable; from class sun.jdbc.odbc.JdbcOdbcDriver__Test at sun.jdbc.odbc.JdbcOdbcDriver__Test.testGetAttributeProperties(JdbcOdbcDriver__Test.java:251)
Created attachment 40020 [details] Project tree
This issue also occurs on NB 6.0.
I've also submitted this issue to the JUnit project: https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1753683&group_id=15278 Please actuate them to find the fixing.
Calling protected methods from other classes within the same package works without problems in simple J2SE projects - I tried that. I looked at your project and noticed that you fiddle with classpaths and bootclasspaths quite a bit. I also found information that two classes stored in packages of the same name, but loaded by different classloaders are not considered as being from the same package (see http://access1.sun.com/techarticles/DR-article.html) which implies that protected methods from one class are not accessible from the other class. I suspect your problem is caused by exactly this. As a workaround, create a public method in the tested class (let's call it "xfinalize") which only calls the finalize() method. From the test, call xfinalize() instead of finalize(). If you find that I am wrong, feel free to reopen the issue.
Hi, Thanx very much for your hints! I've found out another tricky possibility (file project.properties): run.jvmargs=-Xbootclasspath/p:${build.classes.dir};${build.test.classes.dir};"${netbeans.home}/../java1/modules/ext/junit-3.8.2.jar" What you think about it?
But ... By this trick the ant script is not independent from the IDE. Do you have an idea to avoid this?
Perhaps define properties like: test.lib="${netbeans.home}/../java1/modules/ext/junit-3.8.2.jar" run.test.jvmargs=${run.jvmargs};${build.test.classes.dir};${test.lib}
I am sorry, your concerns of the correct setup of classpaths do not justify reopening this bug report. Marked as INVALID (again).
Verified with 6.0 RC2. Enhancements copied to issue 122677.