Examples of TestConnector


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

    }

    @Test
    public void testUndeploy() throws Exception
    {
        final Connector connector = new TestConnector(muleContext);
        connector.setName("TEST_CONNECTOR");
        muleContext.getRegistry().registerConnector(connector);
        muleContext.start();

        domainName = jmxSupport.getDomainName(muleContext);
        final String query = domainName + ":*";
 
View Full Code Here

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

    }

    @Test
    public void testOverrideMessageReceiver() throws Exception
    {
        TestConnector connector = lookupDummyConnector();
       
        // create an xa-transacted endpoint (this triggers the cration of an
        // xaTransactedMessageReceiver in the service descriptor impl
        InboundEndpoint endpoint = getTestInboundEndpoint("foo");
        endpoint.getTransactionConfig().setAction(MuleTransactionConfig.ACTION_ALWAYS_BEGIN);
        endpoint.getTransactionConfig().setFactory(new XaTransactionFactory());
       
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();

        // see if we get the overridden message receiver
        MessageReceiver receiver = serviceDescriptor.createMessageReceiver(connector,
            getTestService(), endpoint);
        assertEquals(TestMessageReceiver.class, receiver.getClass());
View Full Code Here

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

        assertEquals(TestMessageReceiver.class, receiver.getClass());
    }

    private TestConnector lookupDummyConnector()
    {
        TestConnector connector = (TestConnector) muleContext.getRegistry().lookupConnector("dummyConnector");
        assertNotNull(connector);
        return connector;
    }
View Full Code Here

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

    }
   
    @Test
    public void testOverrideMuleMessageFactory() throws Exception
    {
        TestConnector connector = lookupDummyConnector();
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();

        // test if the service override for the message factory works
        MuleMessageFactory messageFactory = serviceDescriptor.createMuleMessageFactory();
        assertEquals(MockMuleMessageFactory.class, messageFactory.getClass());
    }
View Full Code Here

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

    }

    @Test
    public void testOverrideInbounExchangePatterns() throws Exception
    {
        TestConnector connector = lookupDummyConnector();
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();
       
        List<MessageExchangePattern> meps = serviceDescriptor.getInboundExchangePatterns();
       
        List<MessageExchangePattern> expected = Arrays.asList(MessageExchangePattern.REQUEST_RESPONSE);
        assertEquals(expected, meps);
View Full Code Here

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

    }
   
    @Test
    public void testOverrideOutboundExchangePatterns() throws Exception
    {
        TestConnector connector = lookupDummyConnector();
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();
       
        List<MessageExchangePattern> meps = serviceDescriptor.getOutboundExchangePatterns();
       
        List<MessageExchangePattern> expected = Arrays.asList(MessageExchangePattern.REQUEST_RESPONSE);
        assertEquals(expected, meps);
View Full Code Here

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

    }

    @Test
    public void testOverrideDefaultExchangePattern() throws Exception
    {
        TestConnector connector = lookupDummyConnector();
        TransportServiceDescriptor serviceDescriptor = connector.getServiceDescriptor();
       
        MessageExchangePattern defaultMep = serviceDescriptor.getDefaultExchangePattern();
       
        assertEquals(MessageExchangePattern.REQUEST_RESPONSE, defaultMep);
    }
View Full Code Here

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

    private TestConnector connector;

    @Override
    public void doSetUp() throws Exception
    {
        connector = new TestConnector(muleContext);
        connector.initialise();
    }
View Full Code Here

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

    }

    @Test
    public void testDefaultThreadingProfileConfiguration() throws MuleException
    {
        TestConnector connector = new TestConnector(muleContext);
        muleContext.getRegistry().registerConnector(connector);
        assertEquals(ThreadingProfile.DEFAULT_MAX_THREADS_ACTIVE, connector.getDispatcherThreadingProfile()
            .getMaxThreadsActive());
        assertEquals(ThreadingProfile.DEFAULT_MAX_THREADS_IDLE, connector.getDispatcherThreadingProfile()
            .getMaxThreadsIdle());
        assertEquals(ThreadingProfile.WHEN_EXHAUSTED_RUN, connector.getDispatcherThreadingProfile()
            .getPoolExhaustedAction());
        assertEquals(ThreadingProfile.DEFAULT_MAX_BUFFER_SIZE, connector.getDispatcherThreadingProfile()
            .getMaxBufferSize());
        assertEquals(ThreadingProfile.DEFAULT_MAX_THREAD_TTL, connector.getDispatcherThreadingProfile()
            .getThreadTTL());
        assertEquals(ThreadingProfile.DEFAULT_THREAD_WAIT_TIMEOUT, connector.getDispatcherThreadingProfile()
            .getThreadWaitTimeout());
    }
View Full Code Here

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

    protected void createTestConnectorWithSingleDispatcherThread(int threads,
                                                                 int exhaustedAction,
                                                                 long waitTimeout,
                                                                 int maxBufferSize) throws MuleException
    {
        TestConnector connector = new TestConnector(muleContext);
        ThreadingProfile threadingProfile = new ImmutableThreadingProfile(threads, threads, maxBufferSize,
            ThreadingProfile.DEFAULT_MAX_THREAD_TTL, waitTimeout, exhaustedAction, true, null, null);
        threadingProfile.setMuleContext(muleContext);
        connector.setDispatcherThreadingProfile(threadingProfile);
        muleContext.getRegistry().registerConnector(connector);
        connector.setDispatcherFactory(new DelayTestMessageDispatcherFactory());
    }
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.