Package org.mule.tck.testmodels.mule

Examples of org.mule.tck.testmodels.mule.TestConnector


    }

    @Test
    public void testObjectCreation() throws Exception
    {
        TestConnector c = (TestConnector) muleContext.getRegistry().lookupConnector("testConnector");
        assertNotNull(c);
        assertEquals("testConnector", c.getName());
        assertEquals("foo", c.getSomeProperty());

        c = (TestConnector) muleContext.getRegistry().lookupConnector("testConnector2");
        assertNotNull(c);
        assertEquals("testConnector2", c.getName());
        assertEquals("boundProperty", c.getSomeProperty());

        OrangetoAppleTransformer t = (OrangetoAppleTransformer)muleContext.getRegistry().lookupTransformer("testTransformer");
        assertNotNull(t);
        assertEquals(DataTypeFactory.create(RedApple.class), t.getReturnDataType());
View Full Code Here


    }

    @Test
    public void testObjectLifecycle() throws Exception
    {
        TestConnector c = (TestConnector) muleContext.getRegistry().lookupConnector("testConnector");
        assertNotNull(c);
        assertTrue(c.isInitialised());

        TestConnector c2 = (TestConnector) muleContext.getRegistry().lookupConnector("testConnector2");
        assertNotNull(c2);
        //AbstractMuleTestCase does not start the muleContext, just initialises it
        assertTrue(c2.isInitialised());

        assertFalse(c.isStarted());
        assertFalse(c2.isStarted());

        muleContext.start();

        assertTrue(c.isStarted());
        assertTrue(c2.isStarted());

        muleContext.stop();

        assertTrue(c.isStopped());
        assertTrue(c2.isStopped());

        muleContext.dispose();

        assertTrue(c.isDisposed());
        assertTrue(c2.isDisposed());
    }
View Full Code Here

        @Provides
        @Named("testConnector")
        @Singleton
        Connector createNamedConnector()
        {
            TestConnector connector = new TestConnector(muleContext);
            connector.setSomeProperty("foo");
            return connector;
        }
View Full Code Here

        @Provides
        @Named("testConnector2")
        @Singleton
        Connector createNamedConnector2(@Named("connectorProperty") String property)
        {
            TestConnector connector = new TestConnector(muleContext);
            connector.setSomeProperty(property);
            return connector;
        }
View Full Code Here

    @Test
    public void testConnectorStartup() throws Exception
    {
        try
        {
            TestConnector c = (TestConnector) muleContext.getRegistry().lookupConnector("testConnector");
            c.setInitialStateStopped(false);
            c.start();
            fail("Connector should have thrown an exception");
        }
        catch (LifecycleException e)
        {
            // expected
View Full Code Here

    }

    @Test
    public void testCustomConnectorConfig() throws Exception
    {
        TestConnector cnn = (TestConnector)muleContext.getRegistry().lookupConnector("customConnector");
        assertNotNull("customConnector should not be null", cnn);
        assertEquals(cnn.getSomeProperty(), "foo");

        //Test exception strategy
        MessagingExceptionHandler es = muleContext.getRegistry().lookupModel("main").getExceptionListener();
        assertNotNull(es);
        assertTrue(es instanceof TestExceptionStrategy);
View Full Code Here

    @Override
    protected void doSetUp() throws Exception
    {
        super.doSetUp();

        testConnector = new TestConnector(muleContext);
        testConnector.setName("customTestConnector");
        muleContext.getRegistry().registerConnector(testConnector);

        InboundEndpoint inboundEndpoint1 = muleContext.getEndpointFactory().getInboundEndpoint(
            "test://test1?connector=customTestConnector");
View Full Code Here

TOP

Related Classes of org.mule.tck.testmodels.mule.TestConnector

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.