On Sun, Sep 13, 2015 at 11:50 AM, Kanstantsin Shautsou
<
kanstan...@gmail.com> wrote:
> Seems that existed ATH code can be extended for creating channel, that can
> support automatic classloading and tests execution on remote side.
> The idea is to programmatically prepare complex environment (my test code)
I guess you mean you want Java test code (`src/test/java/`) which
links against core/plugin types, but which ought to be loaded not by
the Java application class loader, but by a loader inside the remote
Jenkins JVM.
http://hg.netbeans.org/main-silver/file/a976d656a742/nbjunit/src/org/netbeans/junit/NbModuleSuite.java#l819
is an example (in the NetBeans functional test system), though it
would be more applicable to adding this feature to `JenkinsRule` (if
we wanted it to use a more realistic class loading scheme).
> run remote JenkinsController (existed ATH), get channel connection to it
> (add such feature in ATH), call Junit test execution on channel
I suspect you would need to add a custom support plugin to the Jenkins
server (see, e.g., `LocalController` and `RemoteJenkinsProvider` which
add `form-element-path`) which would add a `AgentProtocol` that would
use `ChannelBuilder` to set up a remoting channel (see
`JnlpSlaveAgentProtocol` for an example) that trusts the client to
send class files (your test code) to the master, loading them in a new
`ClassLoader` based on `uberClassLoader` (cf. `GroovyshCommand`).
All should be possible, but difficult code to write—you will need to
know Remoting pretty intimately.