CodeHackerTest: clarify an assertion

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
CodeHacker: organize imports

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Hack bytecode verification into the CodeHacker

This is extremely hacky at the moment: it assumes that you have
a Fiji.app/ in your home directory and loads the ASM embedded in
Fiji's jruby.jar. This is extremely fragile and needs to be cleaned
up. However, in the interest of YAGNI, this commit does not do
that yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: add legacy plugins from $HOME/.plugins/

This is the first step to replace Fiji's FijiClassLoader: it looks
also in ~/.plugins/.

However, to test, and to be able to override, we also look at the
property 'ij1.plugin.dirs' which is interpreted as a PATH-style list
of directories. If this property is set, ~/.plugins/ is not looked
at automatically.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fixup! Move NoSuchMethodError handling from fiji-compat into ij-legacy
Test ij-legacy's ~/.plugins/ support

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: stop the Java Agent whenever CodeHacker loads classes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy tests: refactor getClassLoader()

This method serves only one purpose: to get a fresh class loader that
does not have any ImageJ 1.x classes loaded yet. That is too useful
for the legacy tests to be hidden in the headless unit test class.

While at it (because it is needed now), make the code more robust: do
not load the ImageJ class at all yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fixup! ij-legacy: add legacy plugins from $HOME/.plugins/
ij-legacy tests: further refactor getFreshClassLoader()

We might need to make sure that other classes are found than the
Headless Example Plugin...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
fixup! ij-legacy tests: refactor getClassLoader()
Add javadocs for LegacyTestUtils#getFreshClassLoader

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyInjector: for testing, accept a fully-initialized CodeHacker

... instead of a ClassLoader.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyTestUtils#getFreshIJClassLoader: offer legacy patching

For testing, we will want to run ImageJ 1.x stuff with and without
LegacyInjector().injectHooks() run first.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
wip

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>