### Question:
OracleDataSource extends BaseDataSource { public void setConnectType(DbConnectType connectType) { this.connectType = connectType; }  DbConnectType getConnectType(); void setConnectType(DbConnectType connectType); @Override String driverClassSelector(); @Override DbType dbTypeSelector();  }### Answer:
@Test public void testGetOracleJdbcUrl() { OracleDataSource oracleDataSource = new OracleDataSource(); oracleDataSource.setConnectType(DbConnectType.ORACLE_SERVICE_NAME); oracleDataSource.setAddress("jdbc:oracle:thin:@ oracleDataSource.setDatabase("test"); oracleDataSource.setPassword("123456"); oracleDataSource.setUser("test"); Assert.assertEquals("jdbc:oracle:thin:@ oracleDataSource.setPrincipal("fake principal"); Assert.assertEquals("jdbc:oracle:thin:@ oracleDataSource.setOther("charset=UTF-8"); Assert.assertEquals("jdbc:oracle:thin:@ OracleDataSource oracleDataSource2 = new OracleDataSource(); oracleDataSource2.setAddress("jdbc:oracle:thin:@127.0.0.1:1521"); oracleDataSource2.setDatabase("orcl"); oracleDataSource2.setPassword("123456"); oracleDataSource2.setUser("test"); oracleDataSource2.setConnectType(DbConnectType.ORACLE_SID); Assert.assertEquals("jdbc:oracle:thin:@127.0.0.1:1521:orcl", oracleDataSource2.getJdbcUrl()); oracleDataSource2.setPrincipal("fake principal"); Assert.assertEquals("jdbc:oracle:thin:@127.0.0.1:1521:orcl", oracleDataSource2.getJdbcUrl()); oracleDataSource2.setOther("charset=UTF-8"); Assert.assertEquals("jdbc:oracle:thin:@127.0.0.1:1521:orcl?charset=UTF-8", oracleDataSource2.getJdbcUrl()); }