Package org.mule.api.service

Examples of org.mule.api.service.Service


    }

    @Override
    public void testSend() throws Exception
    {
        Service testSedaService = muleContext.getRegistry().lookupService("testComponent");
        FunctionalTestComponent testComponent = (FunctionalTestComponent) getComponent(testSedaService);
        assertNotNull(testComponent);

        final AtomicBoolean callbackMade = new AtomicBoolean(false);
        EventCallback callback = new EventCallback()
View Full Code Here


        assertNull(lifecycleAdapter.componentObject);
    }
   
    public void testServicePropogatedLifecycle() throws InitialisationException
    {
        Service service = new SedaService(muleContext);
        service.setName("service");
        service.setModel(muleContext.getRegistry().lookupSystemModel());
        LifecycleTrackerComponent component = new LifecycleTrackerComponent();
        service.setComponent(component);
       
        service.initialise();
       
        assertTrue(component.getTracker().contains("initialise"));
    }
View Full Code Here

    }

    public void testMessageProcessor() throws Exception
    {
        MuleSession session = getTestSession(getTestService(), muleContext);
        Service testService = getTestService("test", Apple.class);
        assertNotNull(testService);

        SimpleCollectionAggregator router = new SimpleCollectionAggregator();
        router.setMuleContext(muleContext);
        router.setFlowConstruct(testService);
View Full Code Here

                                              muleContext, flowConstruct.getName());

        // Inherit failOnTimeout from async-reply if this aggregator is being used for async-reply
        if (flowConstruct instanceof Service)
        {
            Service service = (Service) flowConstruct;
            if (service.getAsyncReplyMessageSource().getMessageProcessors().contains(this))
            {
                failOnTimeout = service.getAsyncReplyMessageSource().isFailOnTimeout();
            }
        }

        eventCorrelator.setTimeout(timeout);
        eventCorrelator.setFailOnTimeout(isFailOnTimeout());
View Full Code Here

    }

    public void testMessageResequencer() throws Exception
    {
        MuleSession session = getTestSession(getTestService(), muleContext);
        Service testService = getTestService("test", Apple.class);
        assertNotNull(testService);

        TestEventResequencer router = new TestEventResequencer(3);
        router.setMuleContext(muleContext);
        router.setFlowConstruct(testService);
View Full Code Here

        asyncMP.setListener(target);
        asyncReplyMP.setListener(asyncMP);
        asyncReplyMP.setReplySource(target.getMessageSource());

        final InboundEndpoint inboundEndpoint = getTestInboundEndpoint(MessageExchangePattern.ONE_WAY);
        final Service service = getTestService();

        for (int i = 0; i < 500; i++)
        {
            muleContext.getWorkManager().scheduleWork(new Work()
            {
View Full Code Here

    public void testIdempotentReceiver() throws Exception
    {
        InboundEndpoint endpoint1 = getTestInboundEndpoint("Test1Provider",
            "test://Test1Provider?exchangePattern=one-way");
        Mock session = MuleTestUtils.getMockSession();
        Service service = getTestService();
        session.matchAndReturn("getFlowConstruct", service);

        IdempotentSecureHashMessageFilter ir = new IdempotentSecureHashMessageFilter();
        ir.setFlowConstruct(service);
        ir.setThrowOnUnaccepted(false);
View Full Code Here

        return "Hello".getBytes();
    }

    public void testValidListener() throws Exception
    {
        Service service = getTestService("orange", Orange.class);
        InboundEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
            getTestEndpointURI());

        getConnector().registerListener(endpoint, getSensingNullMessageProcessor(), service);
    }
View Full Code Here

        // Assert that deserialized event has service and that the service is the
        // same instance
        assertNotNull(deserialized.getSession().getFlowConstruct());

        Service service = (Service) event.getSession().getFlowConstruct();
        Service deserializedService = (Service) deserialized.getSession().getFlowConstruct();
       
        // Unable to test services for equality because of need for equals() everywhere.  See MULE-3720
        // assertEquals(event.getSession().getService(), deserialized.getSession().getService());
        assertEquals(service.getName(), deserializedService.getName());
        assertEquals(service.getInitialState(), deserializedService.getInitialState());
        assertEquals(service.getExceptionListener().getClass(), deserializedService.getExceptionListener().getClass());
        assertEquals(service.getComponent().getClass(), deserializedService.getComponent().getClass());
       
        // Assert that deserialized event has endpoint and that the endpoint is the
        // same instance
        assertNotNull(deserialized.getEndpoint());
        // Unable to test endpoint for equality because of need for equals() everywhere.  See MULE-3720
View Full Code Here

    private MuleEvent createEventToSerialize() throws Exception
    {
        createAndRegisterTransformersEndpointBuilderService();
        InboundEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
            muleContext.getRegistry().lookupEndpointBuilder("epBuilderTest"));
        Service service = muleContext.getRegistry().lookupService("appleService");
        return RequestContext.setEvent(getTestEvent("payload", service, endpoint));
    }
View Full Code Here

TOP

Related Classes of org.mule.api.service.Service

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.