component.getServiceUnitManager().stop("provider"); component.getServiceUnitManager().shutDown("provider"); component.getServiceUnitManager().undeploy("provider", path.getAbsolutePath());
    protected long testInOut(String msg, boolean streaming) throws Exception {        // HTTP Component        HttpComponent component = new HttpComponent();        ((HttpLifeCycle) component.getLifeCycle()).getConfiguration().setStreamingEnabled(streaming);        container.activateComponent(component, "HTTPComponent");                // Add a echo component        EchoComponent echo = new EchoComponent();        ActivationSpec asReceiver = new ActivationSpec("echo", echo);        asReceiver.setService(new QName("test", "echo"));        container.activateComponent(asReceiver);                // Add the http receiver        HttpConnector connector = new HttpConnector("localhost", 8192);        connector.setDefaultInOut(true);        ActivationSpec asConnector = new ActivationSpec("connector", connector);        asConnector.setDestinationService(new QName("test", "echo"));        container.activateComponent(asConnector);                // Start container        container.start();        // Deploy SU        URL url = getClass().getClassLoader().getResource("provider/http.wsdl");        File path = new File(new URI(url.toString()));        path = path.getParentFile();        component.getServiceUnitManager().deploy("provider", path.getAbsolutePath());        component.getServiceUnitManager().start("provider");                // Call it        DefaultServiceMixClient client = new DefaultServiceMixClient(container);        InOut inout = client.createInOutExchange();        inout.setInterfaceName(new QName("http://http.servicemix.org/Test", "ProviderInterface"));        inout.getInMessage().setContent(new StreamSource(new ByteArrayInputStream(msg.getBytes())));                long t0 = System.currentTimeMillis();        client.sendSync(inout);        long t1 = System.currentTimeMillis();        assertTrue(inout.getStatus() == ExchangeStatus.ACTIVE);                // Check we received the message        assertNotNull(inout.getOutMessage());        assertNotNull(inout.getOutMessage().getContent());        System.out.println(new SourceTransformer().toString(inout.getOutMessage().getContent()));                return t1 - t0;    }