Search in sources :

Example 6 with Description

use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.

the class OracleNetConnectionDescriptorParserTest method simple.

@Test
public void simple() {
    String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)" + "(CONNECT_DATA=(SERVICE_NAME=service)))";
    OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
    KeyValue keyValue = parser.parse();
    logger.info(keyValue.toString());
    Description des = new Description(keyValue);
    Assert.assertEquals(des.getServiceName(), "service");
}
Also used : KeyValue(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue) Description(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description) OracleNetConnectionDescriptorParser(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser) Test(org.junit.Test)

Example 7 with Description

use of com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description in project pinpoint by naver.

the class OracleNetConnectionDescriptorParserTest method parse.

@Test
public void parse() {
    String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)" + "(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);
}
Also used : KeyValue(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue) Description(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description) OracleNetConnectionDescriptorParser(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser) Test(org.junit.Test)

Aggregations

Description (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.Description)7 KeyValue (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue)6 OracleNetConnectionDescriptorParser (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser)6 Test (org.junit.Test)6 DefaultDatabaseInfo (com.navercorp.pinpoint.bootstrap.plugin.jdbc.DefaultDatabaseInfo)1