use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class MariaDB_1_4_x_IT method testCallableStatement.
@Test
public void testCallableStatement() throws Exception {
super.executeCallableStatement();
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTraceCount(6);
// Driver#connect(String, Properties)
Class<?> driverClass = Class.forName("org.mariadb.jdbc.Driver");
Method connect = driverClass.getDeclaredMethod("connect", String.class, Properties.class);
verifier.verifyTrace(event("MARIADB", connect, null, URL, DATABASE_NAME, cachedArgs(JDBC_URL)));
// MariaDbConnection#prepareCall(String)
Class<?> mariaDbConnectionClass = Class.forName("org.mariadb.jdbc.MariaDbConnection");
Method prepareCall = mariaDbConnectionClass.getDeclaredMethod("prepareCall", String.class);
verifier.verifyTrace(event("MARIADB", prepareCall, null, URL, DATABASE_NAME, sql(CALLABLE_STATEMENT_QUERY, null)));
// AbstractCallableProcedureStatement#registerOutParameter
Class<?> abstractCallableProcedureStatementClass = Class.forName("org.mariadb.jdbc.AbstractCallableProcedureStatement");
Method registerOutParameter = abstractCallableProcedureStatementClass.getMethod("registerOutParameter", int.class, int.class);
verifier.verifyTrace(event("MARIADB", registerOutParameter, null, URL, DATABASE_NAME, args(2, CALLABLE_STATMENT_OUTPUT_PARAM_TYPE)));
// MariaDbServerPreparedStatement#executeQuery
Class<?> mariaDbServerPreparedStatementClass = Class.forName("org.mariadb.jdbc.MariaDbServerPreparedStatement");
Method executeQuery = mariaDbServerPreparedStatementClass.getDeclaredMethod("executeQuery");
verifier.verifyTrace(event("MARIADB_EXECUTE_QUERY", executeQuery, null, URL, DATABASE_NAME, sql(CALLABLE_STATEMENT_QUERY, null, CALLABLE_STATEMENT_INPUT_PARAM)));
// MariaDbConnection#prepareStatement(String)
Method prepareStatement = mariaDbConnectionClass.getDeclaredMethod("prepareStatement", String.class);
verifier.verifyTrace(event("MARIADB", prepareStatement, null, URL, DATABASE_NAME, sql(CALLABLE_QUERY_META_INFOS_QUERY, null)));
// MariaDbServerPreparedStatement#executeQuery
verifier.verifyTrace(event("MARIADB_EXECUTE_QUERY", executeQuery, null, URL, DATABASE_NAME, sql(CALLABLE_QUERY_META_INFOS_QUERY, null, PROCEDURE_NAME)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapExecutorTestBase method testAndVerifyInsert.
protected final void testAndVerifyInsert(SqlMapExecutor executor) throws Exception {
final String insertId = "insertId";
executor.insert(insertId);
executor.insert(insertId, new Object());
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method insert = executor.getClass().getDeclaredMethod("insert", String.class);
Method insertWithParameter = executor.getClass().getDeclaredMethod("insert", String.class, Object.class);
verifier.verifyTrace(event("IBATIS", insert, Expectations.cachedArgs(insertId)));
verifier.verifyTrace(event("IBATIS", insertWithParameter, Expectations.cachedArgs(insertId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapExecutorTestBase method testAndVerifyQueryForList.
protected final void testAndVerifyQueryForList(SqlMapExecutor executor) throws Exception {
final String queryForListId = "queryForListId";
executor.queryForList(queryForListId);
executor.queryForList(queryForListId, new Object());
executor.queryForList(queryForListId, 0, 1);
executor.queryForList(queryForListId, new Object(), 0, 1);
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method queryForList1 = executor.getClass().getDeclaredMethod("queryForList", String.class);
Method queryForList2 = executor.getClass().getDeclaredMethod("queryForList", String.class, Object.class);
Method queryForList3 = executor.getClass().getDeclaredMethod("queryForList", String.class, int.class, int.class);
Method queryForList4 = executor.getClass().getDeclaredMethod("queryForList", String.class, Object.class, int.class, int.class);
verifier.verifyTrace(event("IBATIS", queryForList1, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS", queryForList2, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS", queryForList3, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS", queryForList4, Expectations.cachedArgs(queryForListId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapExecutorTestBase method testAndVerifyUpdate.
protected final void testAndVerifyUpdate(SqlMapExecutor executor) throws Exception {
final String updateId = "updateId";
executor.update(updateId);
executor.update(updateId, new Object());
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method update = executor.getClass().getDeclaredMethod("update", String.class);
Method updateWithParameter = executor.getClass().getDeclaredMethod("update", String.class, Object.class);
verifier.verifyTrace(event("IBATIS", update, Expectations.cachedArgs(updateId)));
verifier.verifyTrace(event("IBATIS", updateWithParameter, Expectations.cachedArgs(updateId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapExecutorTestBase method testAndVerifyDelete.
protected final void testAndVerifyDelete(SqlMapExecutor executor) throws Exception {
final String deleteId = "deleteId";
executor.delete(deleteId);
executor.delete(deleteId, new Object());
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
Method delete = executor.getClass().getDeclaredMethod("delete", String.class);
Method deleteWithParameter = executor.getClass().getDeclaredMethod("delete", String.class, Object.class);
verifier.verifyTrace(event("IBATIS", delete, Expectations.cachedArgs(deleteId)));
verifier.verifyTrace(event("IBATIS", deleteWithParameter, Expectations.cachedArgs(deleteId)));
}
Aggregations