Package org.apache.camel.spi

Examples of org.apache.camel.spi.Injector


*/
public class InjectorDefaultsToReflectionTest extends TestCase {
    private static final transient Log LOG = LogFactory.getLog(InjectorDefaultsToReflectionTest.class);
   
    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = new DefaultCamelContext().getInjector();
        assertTrue("Injector should be reflection based but was: " + injector,
                   injector instanceof ReflectionInjector);
        LOG.debug("Found injector: " + injector);
    }
View Full Code Here


*/
public class InjectorDefaultsToReflectionTest extends TestCase {
    private static final transient Log LOG = LogFactory.getLog(InjectorDefaultsToReflectionTest.class);
   
    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = new DefaultCamelContext().getInjector();
        assertTrue("Injector should be reflection based but was: " + injector,
                   injector instanceof ReflectionInjector);
        LOG.debug("Found injector: " + injector);
    }
View Full Code Here

*/
public class InjectorDefaultsToReflectionTest extends TestCase {
    private static final transient Log LOG = LogFactory.getLog(InjectorDefaultsToReflectionTest.class);
   
    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = new DefaultCamelContext().getInjector();
        assertTrue("Injector should be reflection based but was: " + injector,
                   injector instanceof ReflectionInjector);
        LOG.debug("Found injector: " + injector);
    }
View Full Code Here

* @version
*/
public class InjectorDefaultsTest extends ContextTestSupport {

    public void testInjectorIsDefaultByDefault() throws Exception {
        Injector injector = context.getInjector();
        assertIsInstanceOf(DefaultInjector.class, injector);
    }
View Full Code Here

        Injector injector = context.getInjector();
        assertIsInstanceOf(DefaultInjector.class, injector);
    }

    public void testNewInstance() throws Exception {
        Injector injector = context.getInjector();

        MyFoo foo = injector.newInstance(MyFoo.class);
        foo.setName("Claus");

        MyFoo foo2 = injector.newInstance(MyFoo.class);
        assertNotSame(foo, foo2);

        assertEquals("Claus", foo.getName());
        assertNull(foo2.getName());
    }
View Full Code Here

        assertEquals("Claus", foo.getName());
        assertNull(foo2.getName());
    }

    public void testSharedInstance() throws Exception {
        Injector injector = context.getInjector();

        MyBarSingleton bar = injector.newInstance(MyBarSingleton.class, new MyBarSingleton());
        bar.setName("Claus");

        MyBarSingleton bar2 = injector.newInstance(MyBarSingleton.class, bar);
        assertSame(bar, bar2);

        assertEquals("Claus", bar.getName());
        assertEquals("Claus", bar2.getName());
    }
View Full Code Here

* @version $Revision: 752893 $
*/
public class InjectorDefaultsToReflectionTest extends ContextTestSupport {

    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = context.getInjector();
        assertIsInstanceOf(ReflectionInjector.class, injector);
    }
View Full Code Here

        Injector injector = context.getInjector();
        assertIsInstanceOf(ReflectionInjector.class, injector);
    }

    public void testNewInstance() throws Exception {
        Injector injector = context.getInjector();

        MyFoo foo = injector.newInstance(MyFoo.class);
        foo.setName("Claus");

        MyFoo foo2 = injector.newInstance(MyFoo.class);
        assertNotSame(foo, foo2);

        assertEquals("Claus", foo.getName());
        assertNull(foo2.getName());
    }
View Full Code Here

        assertEquals("Claus", foo.getName());
        assertNull(foo2.getName());
    }

    public void testSharedInstance() throws Exception {
        Injector injector = context.getInjector();

        MyBarSingleton bar = injector.newInstance(MyBarSingleton.class, new MyBarSingleton());
        bar.setName("Claus");

        MyBarSingleton bar2 = injector.newInstance(MyBarSingleton.class, bar);
        assertSame(bar, bar2);

        assertEquals("Claus", bar.getName());
        assertEquals("Claus", bar2.getName());
    }
View Full Code Here

*/
public class InjectorDefaultsToReflectionTest extends TestCase {
    private static final transient Log log = LogFactory.getLog(InjectorDefaultsToReflectionTest.class);
   
    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = new DefaultCamelContext().getInjector();
        assertTrue("Injector should be reflection based but was: " + injector, injector instanceof ReflectionInjector);
        log.debug("Found injector: " + injector);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.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.