Package org.mule.transport.jdbc

Examples of org.mule.transport.jdbc.JdbcConnector


    }

    @Test
    public void testWithDataSourceViaJndi() throws Exception
    {
        JdbcConnector c = (JdbcConnector) muleContext.getRegistry().lookupConnector("jdbcConnector2");
        assertNotNull(c);

        assertTrue(c.getDataSource() instanceof TestDataSource);
        assertNull(c.getQueries());
        assertTrue(c.isConnected());
        assertTrue(c.isStarted());
        assertEquals(3, c.getQueryTimeout());
    }
View Full Code Here


    }

    @Test
    public void testFullyConfigured() throws Exception
    {
        JdbcConnector c = (JdbcConnector) muleContext.getRegistry().lookupConnector("jdbcConnector3");
        assertNotNull(c);

        assertTrue(c.getDataSource() instanceof TestDataSource);

        assertNotNull(c.getQueries());
        assertEquals(3, c.getQueries().size());

        assertTrue(c.isConnected());
        assertTrue(c.isStarted());
        // Test a abstract connector property (MULE-5776)
        assertTrue(c.isValidateConnections());
    }
View Full Code Here

    }

    @Test
    public void testEndpointQueryOverride() throws Exception
    {
        JdbcConnector c = (JdbcConnector) muleContext.getRegistry().lookupConnector("jdbcConnector3");
        ImmutableEndpoint testJdbcEndpoint = muleContext.getEndpointFactory()
            .getInboundEndpoint("testJdbcEndpoint");

        //On connector, not overridden
        assertNotNull(c.getQuery(testJdbcEndpoint, "getTest"));

        //On connector, overridden on endpoint
        assertNotNull(c.getQuery(testJdbcEndpoint, "getTest2"));
        assertEquals("OVERRIDDEN VALUE", c.getQuery(testJdbcEndpoint, "getTest2"));

        //Only on endpoint
        assertNotNull(c.getQuery(testJdbcEndpoint, "getTest3"));

        //Does not exist on either
        assertNull(c.getQuery(testJdbcEndpoint, "getTest4"));
        assertEquals("3", testJdbcEndpoint.getProperty("queryTimeout"));

        QueryRunner queryRunner = c.getQueryRunnerFor(testJdbcEndpoint);
        assertEquals(ExtendedQueryRunner.class, queryRunner.getClass());
        assertEquals(3, ((ExtendedQueryRunner) queryRunner).getQueryTimeout());
    }
View Full Code Here

    @Test
    public void testSqlStatementStrategyFactoryOverride() throws Exception
    {
        // class config
        JdbcConnector c = (JdbcConnector) muleContext.getRegistry().lookupConnector("jdbcConnector4");
        assertNotNull(c.getSqlStatementStrategyFactory());
        assertTrue(c.getSqlStatementStrategyFactory() instanceof TestSqlStatementStrategyFactory);

        // ref config
        c = (JdbcConnector) muleContext.getRegistry().lookupConnector("jdbcConnector5");
        assertNotNull(c.getSqlStatementStrategyFactory());
        assertTrue(c.getSqlStatementStrategyFactory() instanceof TestSqlStatementStrategyFactory);
    }
View Full Code Here

TOP

Related Classes of org.mule.transport.jdbc.JdbcConnector

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.