use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.
the class OracleNetConnectionDescriptorParserTest method parse4.
@Test
public void parse4() {
String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE = off )" + "(ADDRESS = ( PROTOCOL = TCP)(HOST = 1.2.3.4 ) (PORT = 1521 ))" + " ( CONNECT_DATA = ( SID = sid ) ) )";
OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
KeyValue keyValue = parser.parse();
Description description = new Description(keyValue);
Description value = new Description();
value.setSid("sid");
value.addAddress("tcp", "1.2.3.4", "1521");
Assert.assertEquals(description, value);
}
use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.
the class OracleNetConnectionDescriptorParserTest method emptyValue.
@Test
public void emptyValue() {
String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=)" + "(CONNECT_DATA=(SERVICE_NAME=)))";
OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
KeyValue keyValue = parser.parse();
logger.info(keyValue.toString());
Description des = new Description(keyValue);
Assert.assertEquals(des.getServiceName(), null);
}
use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.
the class OracleNetConnectionDescriptorParserTest method parse2.
@Test
public void parse2() {
String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE = off )" + "(ADDRESS = ( PROTOCOL = TCP)(HOST = 1.2.3.4 ) (PORT = 1521 ))" + "(ADDRESS = (PROTOCOL = TCP ) (HOST = 1.2.3.5) ( PORT = 1522 ))" + " ( CONNECT_DATA = ( SERVICE_NAME = service ) ) )";
OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
KeyValue keyValue = parser.parse();
Description description = new Description(keyValue);
Description value = new Description();
value.setServiceName("service");
value.addAddress("tcp", "1.2.3.4", "1521");
value.addAddress("tcp", "1.2.3.5", "1522");
Assert.assertEquals(description, value);
}
use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.
the class OracleJdbcUrlParser method createOracleDatabaseInfo.
private DatabaseInfo createOracleDatabaseInfo(KeyValue keyValue, String url) {
Description description = new Description(keyValue);
List<String> jdbcHost = description.getJdbcHost();
return new DefaultDatabaseInfo(OracleConstants.ORACLE, OracleConstants.ORACLE_EXECUTE_QUERY, url, url, jdbcHost, description.getDatabaseId());
}
use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.
the class OracleNetConnectionDescriptorParserTest method parse3.
@Test
public void parse3() {
String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE = off )" + "(ADDRESS = ( PROTOCOL = TCP)(HOST = 1.2.3.4 ) (PORT = 1521 ))" + "(ADDRESS = (PROTOCOL = TCP ) (HOST = 1.2.3.5) ( PORT = 1522 ))" + "(ADDRESS = (PROTOCOL = TCP ) (HOST = 1.2.3.6) ( PORT = 1523 ))" + " ( CONNECT_DATA = ( SERVICE_NAME = service ) ) )";
OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
KeyValue keyValue = parser.parse();
Description description = new Description(keyValue);
Description value = new Description();
value.setServiceName("service");
value.addAddress("tcp", "1.2.3.4", "1521");
value.addAddress("tcp", "1.2.3.5", "1522");
value.addAddress("tcp", "1.2.3.6", "1523");
Assert.assertEquals(description, value);
}
Aggregations