use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlSessionTestBase method testAndVerifyDelete.
protected final void testAndVerifyDelete() throws Exception {
// Given
final String deleteId = "deleteId";
SqlSession sqlSession = getSqlSession();
// When
sqlSession.delete(deleteId);
sqlSession.delete(deleteId, new Object());
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method delete1 = sqlSession.getClass().getDeclaredMethod("delete", String.class);
Method delete2 = sqlSession.getClass().getDeclaredMethod("delete", String.class, Object.class);
verifier.verifyTrace(event("MYBATIS", delete1, Expectations.cachedArgs(deleteId)));
verifier.verifyTrace(event("MYBATIS", delete2, Expectations.cachedArgs(deleteId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlSessionTestBase method testAndVerifyInsert.
protected final void testAndVerifyInsert() throws Exception {
// Given
final String insertId = "insertId";
SqlSession sqlSession = getSqlSession();
// When
sqlSession.insert(insertId);
sqlSession.insert(insertId, new Object());
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method insert1 = sqlSession.getClass().getDeclaredMethod("insert", String.class);
Method insert2 = sqlSession.getClass().getDeclaredMethod("insert", String.class, Object.class);
verifier.verifyTrace(event("MYBATIS", insert1, Expectations.cachedArgs(insertId)));
verifier.verifyTrace(event("MYBATIS", insert2, Expectations.cachedArgs(insertId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlSessionTestBase method testAndVerifySelect.
protected final void testAndVerifySelect() throws Exception {
// Given
final String selectId = "selectId";
SqlSession sqlSession = getSqlSession();
// When
sqlSession.select(selectId, new DefaultResultHandler());
sqlSession.select(selectId, new Object(), new DefaultResultHandler());
sqlSession.select(selectId, new Object(), RowBounds.DEFAULT, new DefaultResultHandler());
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method select1 = sqlSession.getClass().getDeclaredMethod("select", String.class, ResultHandler.class);
verifier.verifyTrace(event("MYBATIS", select1, Expectations.cachedArgs(selectId)));
Method select2 = sqlSession.getClass().getDeclaredMethod("select", String.class, Object.class, ResultHandler.class);
verifier.verifyTrace(event("MYBATIS", select2, Expectations.cachedArgs(selectId)));
Method select3 = sqlSession.getClass().getDeclaredMethod("select", String.class, Object.class, RowBounds.class, ResultHandler.class);
verifier.verifyTrace(event("MYBATIS", select3, Expectations.cachedArgs(selectId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlSessionTestBase method testAndVerifyInsertWithNullParameter.
protected final void testAndVerifyInsertWithNullParameter() throws Exception {
// Given
SqlSession sqlSession = getSqlSession();
// When
sqlSession.insert(null);
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method insert = sqlSession.getClass().getDeclaredMethod("insert", String.class);
verifier.verifyTrace(event("MYBATIS", insert));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlSessionTestBase method testAndVerifyUpdate.
protected final void testAndVerifyUpdate() throws Exception {
// Given
final String updateId = "updateId";
SqlSession sqlSession = getSqlSession();
// When
sqlSession.update(updateId);
sqlSession.update(updateId, new Object());
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method update1 = sqlSession.getClass().getDeclaredMethod("update", String.class);
Method update2 = sqlSession.getClass().getDeclaredMethod("update", String.class, Object.class);
verifier.verifyTrace(event("MYBATIS", update1, Expectations.cachedArgs(updateId)));
verifier.verifyTrace(event("MYBATIS", update2, Expectations.cachedArgs(updateId)));
}
Aggregations