Package org.mule.api.service

Examples of org.mule.api.service.Service.start()


                assertTrue(e.getCause() instanceof NoReceiverForEndpointException);
            }
        }
       
        Service c = muleContext.getRegistry().lookupService(component);
        c.start();

        MuleMessage message = client.send(endpoint, "Test Client Send message", null);
        assertNotNull(message);
        assertEquals("Received: Test Client Send message", message.getPayloadAsString());
View Full Code Here


        assertTrue(connector.isStarted());
        MessageReceiver[] receivers = connector.getReceivers("*stopped*");
        assertEquals(0, receivers.length);

        // Start the service.
        c.start();
        assertTrue(c.isStarted());
        assertFalse(c.isStopped());
        assertFalse(c.isPaused());

        // The listeners should now be registered and started.
View Full Code Here

        }

        // We are done, startup the services again so that the test can begin...
        for (Service service : services)
        {
            service.start();
        }
    }

    /**
     * Ensures that the directory exists and is writable by deleting the directory
View Full Code Here

        List interceptors = new ArrayList();
        interceptors.add(new TestInterceptor(INTERCEPTOR_ONE));
        component.setInterceptors(interceptors);
        service.initialise();
        service.start();

        MuleEvent result = component.process(getTestEvent(""));

        assertEquals(SINGLE_INTERCEPTOR_RESULT, result.getMessageAsString());
    }
View Full Code Here

        interceptors.add(new TestInterceptor(INTERCEPTOR_ONE));
        interceptors.add(new TestInterceptor(INTERCEPTOR_TWO));
        interceptors.add(new TestInterceptor(INTERCEPTOR_THREE));
        component.setInterceptors(interceptors);
        service.initialise();
        service.start();

        MuleEvent result = component.process(getTestEvent(""));

        assertEquals(MULTIPLE_INTERCEPTOR_RESULT, result.getMessageAsString());
    }
View Full Code Here

        List stackInterceptors = new ArrayList();
        stackInterceptors.add(new TestInterceptor(INTERCEPTOR_ONE));
        interceptors.add(new InterceptorStack(stackInterceptors));
        component.setInterceptors(interceptors);
        service.initialise();
        service.start();

        MuleEvent result = component.process(getTestEvent(""));

        assertEquals(SINGLE_INTERCEPTOR_RESULT, result.getMessageAsString());
    }
View Full Code Here

        stackInterceptors.add(new TestInterceptor(INTERCEPTOR_TWO));
        stackInterceptors.add(new TestInterceptor(INTERCEPTOR_THREE));
        interceptors.add(new InterceptorStack(stackInterceptors));
        component.setInterceptors(interceptors);
        service.initialise();
        service.start();

        MuleEvent result = component.process(getTestEvent(""));

        assertEquals(MULTIPLE_INTERCEPTOR_RESULT, result.getMessageAsString());
    }
View Full Code Here

        stackInterceptors.add(new TestInterceptor(INTERCEPTOR_TWO));
        stackInterceptors.add(new TestInterceptor(INTERCEPTOR_THREE));
        interceptors.add(new InterceptorStack(stackInterceptors));
        component.setInterceptors(interceptors);
        service.initialise();
        service.start();

        MuleEvent result = component.process(getTestEvent(""));

        assertEquals(INTERCEPTOR_ONE + BEFORE + INTERCEPTOR_TWO + BEFORE + INTERCEPTOR_THREE + BEFORE
                     + INTERCEPTOR_ONE + BEFORE + INTERCEPTOR_TWO + BEFORE + INTERCEPTOR_THREE + BEFORE
View Full Code Here

    protected void startService(String serviceName) throws MuleException
    {
        Service service = muleContext.getRegistry().lookupService(serviceName);
        assertNotNull(service);
       
        service.start();
    }

    protected void startSendThread(JabberSender sender)
    {
        Thread sendThread = new Thread(sender);
View Full Code Here

    }

    public void testReceiversLifecycle() throws Exception
    {
        Service service=getTestService();
        service.start();
        connector.registerListener(getTestInboundEndpoint("in", "test://in"), getSensingNullMessageProcessor(), service);

        assertEquals(1, connector.receivers.size());
        assertFalse(( connector.receivers.get("in")).isConnected());
        assertFalse(((AbstractMessageReceiver) connector.receivers.get("in")).isStarted());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.