Package org.picocontainer.injectors

Examples of org.picocontainer.injectors.ConstructorInjection


        PicoContainer container = createPicoContainer();
        return new PicoStepsFactory(configuration(), container);
    }

    private PicoContainer createPicoContainer() {
        MutablePicoContainer container = new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
        container.addComponent(MySteps.class);
        return container;
    }
View Full Code Here


    public InjectableStepsFactory stepsFactory() {
        return new PicoStepsFactory(configuration(), createPicoContainer());
    }

    private PicoContainer createPicoContainer() {
        MutablePicoContainer container = new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
        container.addComponent(TradingService.class);
        container.addComponent(TraderSteps.class);
        container.addComponent(BeforeAfterSteps.class);
        container.addComponent(AndSteps.class);
        container.addComponent(CalendarSteps.class);
View Full Code Here

import static org.junit.Assert.assertTrue;

public class PicoStepsFactoryBehaviour {

    private MutablePicoContainer createPicoContainer() {
        return new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
    }
View Full Code Here

@SuppressWarnings("serial")
public class TransientPicoContainer extends DefaultPicoContainer {

    public TransientPicoContainer() {
        super(new Caching().wrap(new ConstructorInjection()), new NullLifecycleStrategy(), null, new NullComponentMonitor());
    }
View Full Code Here

    public TransientPicoContainer() {
        super(new Caching().wrap(new ConstructorInjection()), new NullLifecycleStrategy(), null, new NullComponentMonitor());
    }

    public TransientPicoContainer(PicoContainer parent) {
        super(new Caching().wrap(new ConstructorInjection()), new NullLifecycleStrategy(), parent, new NullComponentMonitor());
    }
View Full Code Here

    public static InjectionFactory SDI() {
        return new SetterInjection();
    }

    public static InjectionFactory CDI() {
        return new ConstructorInjection();
    }
View Full Code Here

         */
    }

    private void init(List<Class<?>> excludedComponentsForTestContext) {
        PicoBuilder picoBuilder = new PicoBuilder(new CompositeInjection(
            new ConstructorInjection(), new AnnotatedFieldInjection()))
            .withCaching().withLifecycle();

        /*
         * If given, the dotMonitor is used to capture an architecture diagram
         * of the application
View Full Code Here

        final ThreadCaching primordialCaching = new ThreadCaching();
        MutablePicoContainer primordial = new PicoBuilder().withBehaviors(primordialCaching).build();
        primordial.addComponent(WebDriverProvider.class, driverProvider);

        // Groovy Steps - can be stateful per story.
        final Storing store = (Storing) new Storing().wrap(new CompositeInjection(new ConstructorInjection(),
                new SetterInjection("set", "setMetaClass")));
        ClassLoader currentClassLoader = this.getClass().getClassLoader();
        final DefaultClassLoadingPicoContainer pageObjects = new DefaultClassLoadingPicoContainer(currentClassLoader,
                store, primordial);
        pageObjects.change(Characteristics.USE_NAMES);
View Full Code Here

import java.util.Properties;

@SuppressWarnings("serial")
public class WebDriverConstructorAndSetterInjection extends CompositeInjection {
    public WebDriverConstructorAndSetterInjection() {
        super(new ConstructorInjection(),
                new SetterInjection() {
                    @Override
                    public <T> ComponentAdapter<T> createComponentAdapter(ComponentMonitor monitor, LifecycleStrategy lifecycleStrategy, Properties componentProperties, Object componentKey, Class<T> componentImplementation, Parameter... parameters) throws PicoCompositionException {
                        return new SetterInjector<T>(componentKey, componentImplementation, parameters, monitor, "set", "", false, true) {
                            @Override
View Full Code Here

TOP

Related Classes of org.picocontainer.injectors.ConstructorInjection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.