Package org.apache.tuscany.core.component

Examples of org.apache.tuscany.core.component.WorkContextImpl


public class JDKOutboundInvocationHandlerTestCase extends TestCase {

    public void testToString() {
        OutboundWireImpl wire = new OutboundWireImpl();
        wire.setServiceContract(new JavaServiceContract(Foo.class));
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
        assertNotNull(foo.toString());
    }
View Full Code Here


    }

    public void testHashCode() {
        OutboundWireImpl wire = new OutboundWireImpl();
        wire.setServiceContract(new JavaServiceContract(Foo.class));
        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(wire, new WorkContextImpl());
        Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
        assertNotNull(foo.hashCode());
    }
View Full Code Here

     * Create primordial deployer that can be used to load the system definition.
     *
     * @return the primordial deployer
     */
    public Deployer createDeployer() {
        ScopeRegistry scopeRegistry = createScopeRegistry(new WorkContextImpl());
        Builder builder = createBuilder(scopeRegistry);
        JavaInterfaceProcessorRegistry interfaceIntrospector = new JavaInterfaceProcessorRegistryImpl();
        Introspector introspector = createIntrospector(interfaceIntrospector);
        LoaderRegistry loader = createLoader(new PropertyObjectFactoryImpl(), introspector);
        return new DeployerImpl(xmlFactory, loader, builder);
View Full Code Here

    /**
     * Tests instance identity is properly maintained
     */
    public void testInstanceManagement() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        StatelessScopeContainer scope = new StatelessScopeContainer(ctx);
        scope.start();
        SystemAtomicComponent context1 =
            MockFactory.createAtomicComponent("comp1", scope, StatelessComponentImpl.class);
        scope.register(context1);
View Full Code Here

        Assert.assertNotSame(comp1, comp2);
        scope.stop();
    }

    public void testRegisterContextAfterRequest() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        StatelessScopeContainer scope = new StatelessScopeContainer(ctx);

        scope.start();
        SystemAtomicComponent context1 =
            MockFactory.createAtomicComponent("comp1", scope, StatelessComponentImpl.class);
View Full Code Here

    /**
     * Tests setting no components in the scope
     */
    public void testSetNullComponents() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        StatelessScopeContainer scope = new StatelessScopeContainer(ctx);
        scope.start();
        scope.stop();
    }
View Full Code Here

* @version $Rev: 451895 $ $Date: 2006-10-01 23:58:18 -0700 (Sun, 01 Oct 2006) $
*/
public class RequestScopeInstanceLifecycleTestCase extends TestCase {

    public void testInitDestroy() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        RequestScopeContainer scope = new RequestScopeContainer(ctx);
        scope.start();

        SystemAtomicComponent initDestroyContext = MockFactory
            .createAtomicComponent("InitDestroy", scope, RequestScopeInitDestroyComponent.class);
View Full Code Here

        scope.stop();
    }

    public void testDestroyOrder() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        RequestScopeContainer scope = new RequestScopeContainer(ctx);
        scope.start();

        SystemAtomicComponent oneCtx =
            MockFactory.createAtomicComponent("one", scope, OrderedInitPojoImpl.class);
View Full Code Here

        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }

    public void testEagerInitDestroyOrder() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        RequestScopeContainer scope = new RequestScopeContainer(ctx);
        scope.start();

        SystemAtomicComponent oneCtx =
            MockFactory.createAtomicComponent("one", scope, OrderedEagerInitPojo.class);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.component.WorkContextImpl

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.