use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class ObjectReaderIT method testWriteValue.
@Test
public void testWriteValue() throws Exception {
__POJO pojo = new __POJO();
pojo.setName("Jackson");
ObjectWriter writer = mapper.writer();
String jsonStr = writer.writeValueAsString(pojo);
byte[] jsonByte = writer.writeValueAsBytes(pojo);
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
Method writeval1 = ObjectWriter.class.getMethod("writeValueAsString", Object.class);
Method writeval2 = ObjectWriter.class.getMethod("writeValueAsBytes", Object.class);
verifier.verifyTrace(event("JACKSON", writeval1, annotation("jackson.json.length", jsonStr.length())));
verifier.verifyTrace(event("JACKSON", writeval2, annotation("jackson.json.length", jsonByte.length)));
verifier.verifyTraceCount(0);
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class MariaDB_1_4_x_IT method testPreparedStatement.
@Test
public void testPreparedStatement() throws Exception {
super.executePreparedStatement();
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
verifier.verifyTraceCount(3);
// 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#prepareStatement(String)
Class<?> mariaDbConnectionClass = Class.forName("org.mariadb.jdbc.MariaDbConnection");
Method prepareStatement = mariaDbConnectionClass.getDeclaredMethod("prepareStatement", String.class);
verifier.verifyTrace(event("MARIADB", prepareStatement, null, URL, DATABASE_NAME, sql(PREPARED_STATEMENT_QUERY, null)));
// 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(PREPARED_STATEMENT_QUERY, null, "3")));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class MariaDB_1_4_x_IT method testStatement.
@Test
public void testStatement() throws Exception {
super.executeStatement();
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
// 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)));
// MariaDbStatement#executeQuery(String)
Class<?> mariaDbStatementClass = Class.forName("org.mariadb.jdbc.MariaDbStatement");
Method executeQuery = mariaDbStatementClass.getDeclaredMethod("executeQuery", String.class);
verifier.verifyTrace(event("MARIADB_EXECUTE_QUERY", executeQuery, null, URL, DATABASE_NAME, sql(STATEMENT_NORMALIZED_QUERY, "1")));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class OkHttpClientBackwardCompatibilityIT method execute.
@Test
public void execute() throws Exception {
Request request = new Request.Builder().url("http://google.com").build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
Method callMethod = Call.class.getDeclaredMethod("execute");
verifier.verifyTrace(Expectations.event("OK_HTTP_CLIENT_INTERNAL", callMethod));
}
use of com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier in project pinpoint by naver.
the class OkHttpClientIT method execute.
@Test
public void execute() throws Exception {
Request request = new Request.Builder().url("http://google.com").build();
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance();
verifier.printCache();
Method callMethod = Call.class.getDeclaredMethod("execute");
verifier.verifyTrace(Expectations.event("OK_HTTP_CLIENT_INTERNAL", callMethod));
}
Aggregations