All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spincast.defaults.tests.SpincastDefaultTestingModule Maven / Gradle / Ivy

The newest version!
package org.spincast.defaults.tests;

import org.spincast.core.config.ISpincastConfig;
import org.spincast.defaults.guice.SpincastDefaultGuiceModule;
import org.spincast.plugins.config.SpincastConfigPluginGuiceModule;
import org.spincast.plugins.httpclient.websocket.SpincastHttpClientWithWebsocketPluginGuiceModule;
import org.spincast.testing.core.SpincastTestConfig;

/**
 * Testing module using the default implementations
 * for the required components.
 */
public class SpincastDefaultTestingModule extends SpincastDefaultGuiceModule {

    public SpincastDefaultTestingModule() {
        this(null);
    }

    public SpincastDefaultTestingModule(String[] mainArgs) {
        super(mainArgs);
    }

    @Override
    protected void configure() {
        super.configure();

        //==========================================
        // Install the Spincast HTTP Client with Websocket 
        // support module.
        //==========================================
        install(new SpincastHttpClientWithWebsocketPluginGuiceModule(getRequestContextType(), getWebsocketContextType()));
    }

    @Override
    protected void bindConfigPlugin() {
        install(new SpincastConfigPluginGuiceModule(getRequestContextType(), getWebsocketContextType()) {

            @Override
            protected Class getSpincastConfigImplClass() {
                return getSpincastConfigClass();
            }
        });
    }

    protected Class getSpincastConfigClass() {
        return SpincastTestConfig.class;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy