Package org.ops4j.pax.exam.util

Examples of org.ops4j.pax.exam.util.Injector


        }
    }

    private void callWithMethod(String method) throws ClassNotFoundException {
        BundleContext bundleContext = mock(BundleContext.class);
        Injector injector = mock(Injector.class);
        Bundle bundle = mock(Bundle.class);
        when(bundleContext.getBundle()).thenReturn(bundle);
        doReturn(ExceptionSource.class).when(bundle).loadClass(ExceptionSource.class.getName());
        JUnitProbeInvoker invoker = new JUnitProbeInvoker(ExceptionSource.class.getName() + ";"
            + method, bundleContext, injector);
View Full Code Here


     *            test class instance
     */
    private void inject(Object testClassInstance) {
        InjectorFactory injectorFactory = ServiceProviderFinder
            .loadUniqueServiceProvider(InjectorFactory.class);
        Injector injector = injectorFactory.createInjector();
        injector.injectFields(testClassInstance);
    }
View Full Code Here

     *
     * @param test
     *            test class instance
     */
    public void inject(Object test) {
        Injector injector = findInjector();
        injector.injectFields(test);
    }
View Full Code Here

    private void runSuite(OutputStream os, Class<?> clazz, String methodName, String indexName) throws IOException {

        InjectorFactory injectorFactory = ServiceProviderFinder
            .loadUniqueServiceProvider(InjectorFactory.class);
        injectorFactory.setContext(getServletContext());
        Injector injector = injectorFactory.createInjector();
        Integer index = null;
        if (indexName != null) {
            index = Integer.parseInt(indexName);
        }
       
View Full Code Here

*/
public class JUnitProbeInvokerFactory implements ProbeInvokerFactory {

    public ProbeInvoker createProbeInvoker(Object context, String expr) {
        BundleContext ctx = (BundleContext) context;
        Injector injector = ServiceLookup.getService(ctx, Injector.class);
        return new JUnitProbeInvoker(expr, ctx, injector);
    }
View Full Code Here

import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {

    public void start(BundleContext context) throws Exception {
        Injector injector = new ServiceInjector();
        Dictionary<String, String> props = new Hashtable<String, String>();
        props.put("type", "default");
        context.registerService(Injector.class.getName(), injector, props);
    }
View Full Code Here

TOP

Related Classes of org.ops4j.pax.exam.util.Injector

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.