use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseMysqlJDBCURLWithMultiHost.
@Test
public void testParseMysqlJDBCURLWithMultiHost() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:mysql//primaryhost:3307,secondaryhost1,secondaryhost2/test?profileSQL=true");
assertThat(connectionInfo.getDBType(), is("Mysql"));
assertThat(connectionInfo.getDatabaseName(), is("test"));
assertThat(connectionInfo.getDatabasePeer(), is("primaryhost:3307,secondaryhost1:3306,secondaryhost2:3306,"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseOracleJDBCURLWithUserNameAndPassword.
@Test
public void testParseOracleJDBCURLWithUserNameAndPassword() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:oracle:thin:scott/tiger@myhost:1521:orcl");
assertThat(connectionInfo.getDBType(), is("Oracle"));
assertThat(connectionInfo.getDatabaseName(), is("orcl"));
assertThat(connectionInfo.getDatabasePeer(), is("myhost:1521"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseMysqlJDBCURLWithConnectorJs.
@Test
public void testParseMysqlJDBCURLWithConnectorJs() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:mysql:replication://master,slave1,slave2,slave3/test");
assertThat(connectionInfo.getDBType(), is("Mysql"));
assertThat(connectionInfo.getDatabaseName(), is("test"));
assertThat(connectionInfo.getDatabasePeer(), is("master:3306,slave1:3306,slave2:3306,slave3:3306,"));
}
use of org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo in project incubator-skywalking by apache.
the class URLParserTest method testParseOracleJDBCURLWithHost.
@Test
public void testParseOracleJDBCURLWithHost() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:oracle:thin:@localhost: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 testParseOracleJDBCURLWithHostAndPort.
@Test
public void testParseOracleJDBCURLWithHostAndPort() {
ConnectionInfo connectionInfo = new URLParser().parser("jdbc:oracle:thin:@localhost:1522:orcl");
assertThat(connectionInfo.getDBType(), is("Oracle"));
assertThat(connectionInfo.getDatabaseName(), is("orcl"));
assertThat(connectionInfo.getDatabasePeer(), is("localhost:1522"));
}
Aggregations