Example usage for org.apache.commons.dbutils QueryRunner getClass

List of usage examples for org.apache.commons.dbutils QueryRunner getClass

Introduction

In this page you can find the example usage for org.apache.commons.dbutils QueryRunner getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.mule.transport.jdbc.config.JdbcNamespaceHandlerTestCase.java

@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());
}