Search in sources :

Example 1 with DummyStatement

use of sql.DummyStatement in project newrelic-java-agent by newrelic.

the class DatabaseTest method show.

@Test
public void show() throws Exception {
    Statement stmt = new DummyStatement(new DummyConnection());
    stmt.executeQuery("show tables");
    Set<String> metrics = AgentHelper.getMetrics(AgentHelper.getDefaultStatsEngine());
    for (String metric : metrics) {
        if (metric.startsWith("Database") && metric.endsWith("show")) {
            Assert.fail();
        }
    }
}
Also used : DummyStatement(sql.DummyStatement) PreparedStatement(java.sql.PreparedStatement) Statement(java.sql.Statement) DummyConnection(sql.DummyConnection) DummyStatement(sql.DummyStatement) Test(org.junit.Test)

Aggregations

PreparedStatement (java.sql.PreparedStatement)1 Statement (java.sql.Statement)1 Test (org.junit.Test)1 DummyConnection (sql.DummyConnection)1 DummyStatement (sql.DummyStatement)1