I am working on classloading changes - the
openide.jar and core.jar will not longer be on
classpath. The work is done as part of the issue
I have found out that the work causes major
problems to the xtest framework, which needs to be
I can try to help it happen, but I need some
In order to eliminate the xtest's org.netbeans.Main class a new
property has been defined, so one can execute the IDE with
-Dnetbeans.mainclass=org.netbeans.xtest.Main (where the class is in a
jar in lib package - lib/xtest-boot.jar) and its main method will be
executed instead of org.netbeans.core.Main.
In core in xtest_19433 branch.
The patched version of the Module can be replaced by placing
the test jars into the modules/patches/<name>
see issue 9273
I'm wondering how IDE finds out which classloader should be used for
loading the tests (e.g. java module classloder for java tests)?
Simply, when creating a classloader for java module, it will open
modules/java.jar, read the manifest, finds that it have to add
ext/javac.jar, ext/java-gj.jar, ext/javamake.jar,
takes the code base name with '.' replaced by '-':
org-netbeans-modules-java and adds also
Now it constructs the module CL from all these jars.
Look at the ant module, it uses this trick for loading ant extensions.
For XTest, it would be much better if there could be specified a
special system property, which would define a classpath for the
module's classloader. For example for java module:
The problem of the proposed solution is, that test developers usually
depends on the standard location of test classes (they often mount
subdirectories as filesystems to IDE, etc ...), so it is not a great
idea to copy jar file with the tests to a different place.
Do you really use folders as test class sources?
Or is the folder there only to allow usage of
File folder = getTheJavaIoFile(getResource("myfile.txt").getParent();
If you load the classes from .jars and only resources from
the folders, it should be no problem, you can copy only jars
and add the folders to the system CLASSPATH (as long as there are
no package overlaps between classes and data).
The problem is, that resources can be in the same package as classes
(though it is recommended to use data package for resources). I would
vote for the system property ...
I think this can simply be made a dupe of #19443, as the patch in that
issue is supposed to solve this problem? I don't understand why this
is filed separately.
Libor Martinek merged changes from this branch to the new
patchbytecode_26126_branch so I think this can be closed as fixed.
Resolved for 3.3.x or earlier, no new info since then -> verify.
Resolved for 3.3.x or earlier, no new info since then -> closing.