Search in sources :

Example 1 with OracleConnectionStringException

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

the class OracleNetConnectionDescriptorParserTest method parseEofError.

@Test
public void parseEofError() {
    String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE = off )" + "(ADDRESS  =  ( PROTOCOL = TCP)(HOST = 1.2.3.4 ) (PORT = 1521 ))" + //                " ( CONNECT_DATA = ( SID = sid ) ) )";
    " ( CONNECT_DATA = ( SID = sid ) ) ";
    OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
    try {
        KeyValue keyValue = parser.parse();
        Assert.fail();
    } catch (OracleConnectionStringException e) {
        logger.info("Expected error", e);
    }
}
Also used : KeyValue(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue) OracleConnectionStringException(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleConnectionStringException) OracleNetConnectionDescriptorParser(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser) Test(org.junit.Test)

Example 2 with OracleConnectionStringException

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

the class OracleNetConnectionDescriptorParserTest method parseSyntaxError2.

@Test
public void parseSyntaxError2() {
    String rac = "jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE = off )" + "(ADDRESS  =  ( PROTOCOL = TCP) (HOST = 1.2.3.4 ) ( = 1521 ))" + " ( CONNECT_DATA = ( SID = sid ) ) )";
    // removed port
    OracleNetConnectionDescriptorParser parser = new OracleNetConnectionDescriptorParser(rac);
    try {
        KeyValue keyValue = parser.parse();
        Assert.fail();
    } catch (OracleConnectionStringException e) {
        logger.info("Expected error", e);
    }
}
Also used : KeyValue(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue) OracleConnectionStringException(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleConnectionStringException) OracleNetConnectionDescriptorParser(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser) Test(org.junit.Test)

Example 3 with OracleConnectionStringException

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

the class OracleNetConnectionDescriptorParserTest method parseSyntaxError.

@Test
public void parseSyntaxError() {
    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);
    try {
        KeyValue keyValue = parser.parse();
        Assert.fail();
    } catch (OracleConnectionStringException e) {
        logger.info("Expected error", e);
    }
}
Also used : KeyValue(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue) OracleConnectionStringException(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleConnectionStringException) OracleNetConnectionDescriptorParser(com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser) Test(org.junit.Test)

Aggregations

KeyValue (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.KeyValue)3 OracleConnectionStringException (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleConnectionStringException)3 OracleNetConnectionDescriptorParser (com.navercorp.pinpoint.plugin.jdbc.oracle.parser.OracleNetConnectionDescriptorParser)3 Test (org.junit.Test)3