Search in sources :

Example 1 with FallbackConfig

use of org.jenkinsci.test.acceptance.FallbackConfig in project acceptance-test-harness by jenkinsci.

the class World method configure.

@Override
protected void configure() {
    // lowest priority is our default binding
    Module m = new FallbackConfig();
    // let extensions override the fallback config
    m = Modules.override(m).with(new ExtensionFinder(cl));
    // user config trumps everything
    m = Modules.override(m).with(new Config());
    install(m);
}
Also used : FallbackConfig(org.jenkinsci.test.acceptance.FallbackConfig) ExtensionFinder(com.cloudbees.sdk.extensibility.ExtensionFinder) FallbackConfig(org.jenkinsci.test.acceptance.FallbackConfig) Config(org.jenkinsci.test.acceptance.Config) Module(com.google.inject.Module) AbstractModule(com.google.inject.AbstractModule)

Example 2 with FallbackConfig

use of org.jenkinsci.test.acceptance.FallbackConfig in project acceptance-test-harness by jenkinsci.

the class JenkinsControllerPoolProcess method run.

public void run() throws Exception {
    // so the actual length of the queue has to be n-1.
    if (n == 1)
        queue = new SynchronousQueue<>();
    else
        queue = new LinkedBlockingDeque<>(n - 1);
    World w = World.get();
    w.getInjector().injectMembers(this);
    new Thread() {

        /**
         * Just keeps on creating new controllers and put it into the queue.
         * Because queue is blocking, this will only prelaunch up to 3.
         */
        @Override
        public void run() {
            try {
                FallbackConfig f = new FallbackConfig();
                while (true) {
                    lifecycle.startTestScope();
                    JenkinsController c = f.createController(injector, factories);
                    c.start();
                    queue.put(new QueueItem(c, lifecycle.export()));
                }
            } catch (Throwable e) {
                // fail fatally
                e.printStackTrace();
                System.exit(1);
            }
        }
    }.start();
    processServerSocket();
}
Also used : FallbackConfig(org.jenkinsci.test.acceptance.FallbackConfig) JenkinsController(org.jenkinsci.test.acceptance.controller.JenkinsController) IJenkinsController(org.jenkinsci.test.acceptance.controller.IJenkinsController) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) SynchronousQueue(java.util.concurrent.SynchronousQueue) World(org.jenkinsci.test.acceptance.guice.World)

Aggregations

FallbackConfig (org.jenkinsci.test.acceptance.FallbackConfig)2 ExtensionFinder (com.cloudbees.sdk.extensibility.ExtensionFinder)1 AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 LinkedBlockingDeque (java.util.concurrent.LinkedBlockingDeque)1 SynchronousQueue (java.util.concurrent.SynchronousQueue)1 Config (org.jenkinsci.test.acceptance.Config)1 IJenkinsController (org.jenkinsci.test.acceptance.controller.IJenkinsController)1 JenkinsController (org.jenkinsci.test.acceptance.controller.JenkinsController)1 World (org.jenkinsci.test.acceptance.guice.World)1