use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseH2JDBCURLWithMemoryMode.
@Test
public void testParseH2JDBCURLWithMemoryMode() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:h2:mem:test_mem");
assertThat(connectionInfo.getDBType(), is("H2"));
assertThat(connectionInfo.getDatabaseName(), is("test_mem"));
assertThat(connectionInfo.getDatabasePeer(), is("localhost:-1"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseOracleTNSName.
@Test
public void testParseOracleTNSName() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= localhost )(PORT= 1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))");
assertThat(connectionInfo.getDBType(), is("Oracle"));
assertThat(connectionInfo.getDatabaseName(), is("orcl"));
assertThat(connectionInfo.getDatabasePeer(), is("localhost:1521"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseMysqlJDBCURLWithHost.
@Test
public void testParseMysqlJDBCURLWithHost() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:mysql//primaryhost/test");
assertThat(connectionInfo.getDBType(), is("Mysql"));
assertThat(connectionInfo.getDatabaseName(), is("test"));
assertThat(connectionInfo.getDatabasePeer(), is("primaryhost:3306"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseH2JDBCURLWithEmbedded.
@Test
public void testParseH2JDBCURLWithEmbedded() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:h2:file:/data/sample");
assertThat(connectionInfo.getDBType(), is("H2"));
assertThat(connectionInfo.getDatabaseName(), is("/data/sample"));
assertThat(connectionInfo.getDatabasePeer(), is("localhost:-1"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseH2JDBCURLWithEmbeddedRunningInWindows.
@Test
public void testParseH2JDBCURLWithEmbeddedRunningInWindows() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:h2:file:C:/data/sample");
assertThat(connectionInfo.getDBType(), is("H2"));
assertThat(connectionInfo.getDatabaseName(), is("C:/data/sample"));
assertThat(connectionInfo.getDatabasePeer(), is("localhost:-1"));
}
Aggregations