use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class DubboConsumerIT method testConsumerMonitor.
@Test
public void testConsumerMonitor() {
abstractClusterInvoker = new FailoverClusterInvoker(directory);
when(abstractClusterInvoker.getInterface()).thenReturn(MonitorService.class);
try {
abstractClusterInvoker.invoke(rpcInvocation);
} catch (RpcException ignore) {
// ignore
}
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapClientTemplateIT method methodCallWithNullSqlIdShouldOnlyTraceMethodName.
@Test
public void methodCallWithNullSqlIdShouldOnlyTraceMethodName() throws Exception {
// Given
SqlMapClientTemplate template = new SqlMapClientTemplate(this.mockDataSource, this.sqlMapClient);
// When
template.insert(null);
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method insert = SqlMapClientTemplate.class.getDeclaredMethod("insert", String.class);
verifier.verifyTrace(event("IBATIS_SPRING", insert));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapClientTemplateIT method queryForObjectShouldBeTraced.
@Test
public void queryForObjectShouldBeTraced() throws Exception {
// Given
final String queryForObjectId = "queryForObjectId";
SqlMapClientTemplate clientTemplate = new SqlMapClientTemplate(this.mockDataSource, this.sqlMapClient);
// When
clientTemplate.queryForObject(queryForObjectId);
clientTemplate.queryForObject(queryForObjectId, new Object());
clientTemplate.queryForObject(queryForObjectId, new Object(), new Object());
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method queryForObject1 = SqlMapClientTemplate.class.getDeclaredMethod("queryForObject", String.class);
Method queryForObject2 = SqlMapClientTemplate.class.getDeclaredMethod("queryForObject", String.class, Object.class);
Method queryForObject3 = SqlMapClientTemplate.class.getDeclaredMethod("queryForObject", String.class, Object.class, Object.class);
verifier.verifyTrace(event("IBATIS_SPRING", queryForObject1, Expectations.cachedArgs(queryForObjectId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForObject2, Expectations.cachedArgs(queryForObjectId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForObject3, Expectations.cachedArgs(queryForObjectId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapClientTemplateIT method queryForPaginagedListShouldBeTraced.
@Test
@SuppressWarnings("deprecation")
public void queryForPaginagedListShouldBeTraced() throws Exception {
// Given
final String queryForPaginatedListId = "queryForPaginatedListId";
// to emulate lazy-loading, otherwise exception is thrown
TransactionManager mockTxManager = mock(TransactionManager.class);
when(this.mockSqlMapExecutorDelegate.getTxManager()).thenReturn(mockTxManager);
SqlMapClientTemplate clientTemplate = new SqlMapClientTemplate(this.mockDataSource, this.sqlMapClient);
// When
clientTemplate.queryForPaginatedList(queryForPaginatedListId, 1);
clientTemplate.queryForPaginatedList(queryForPaginatedListId, new Object(), 1);
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method queryForPaginatedList1 = SqlMapClientTemplate.class.getDeclaredMethod("queryForPaginatedList", String.class, int.class);
Method queryForPaginatedList2 = SqlMapClientTemplate.class.getDeclaredMethod("queryForPaginatedList", String.class, Object.class, int.class);
verifier.verifyTrace(event("IBATIS_SPRING", queryForPaginatedList1, Expectations.cachedArgs(queryForPaginatedListId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForPaginatedList2, Expectations.cachedArgs(queryForPaginatedListId)));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class SqlMapClientTemplateIT method queryForListShouldBeTraced.
@Test
public void queryForListShouldBeTraced() throws Exception {
// Given
final String queryForListId = "queryForListId";
SqlMapClientTemplate clientTemplate = new SqlMapClientTemplate(this.mockDataSource, this.sqlMapClient);
// When
clientTemplate.queryForList(queryForListId);
clientTemplate.queryForList(queryForListId, new Object());
clientTemplate.queryForList(queryForListId, 0, 1);
clientTemplate.queryForList(queryForListId, new Object(), 0, 1);
// Then
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
Method queryForList1 = SqlMapClientTemplate.class.getDeclaredMethod("queryForList", String.class);
Method queryForList2 = SqlMapClientTemplate.class.getDeclaredMethod("queryForList", String.class, Object.class);
Method queryForList3 = SqlMapClientTemplate.class.getDeclaredMethod("queryForList", String.class, int.class, int.class);
Method queryForList4 = SqlMapClientTemplate.class.getDeclaredMethod("queryForList", String.class, Object.class, int.class, int.class);
verifier.verifyTrace(event("IBATIS_SPRING", queryForList1, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForList2, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForList3, Expectations.cachedArgs(queryForListId)));
verifier.verifyTrace(event("IBATIS_SPRING", queryForList4, Expectations.cachedArgs(queryForListId)));
}
Aggregations