### Question:
BaseDataSource { public String getJdbcUrl() { StringBuilder jdbcUrl = new StringBuilder(getAddress()); appendDatabase(jdbcUrl); appendPrincipal(jdbcUrl); appendOther(jdbcUrl); return jdbcUrl.toString(); }  String getPrincipal(); void setPrincipal(String principal); abstract String driverClassSelector(); abstract DbType dbTypeSelector(); String getJdbcUrl(); void isConnectable(); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); void setAddress(String address); String getAddress(); String getDatabase(); void setDatabase(String database); String getOther(); void setOther(String other);  }### Answer:
@Test public void testGetJdbcUrl() { BaseDataSource hiveDataSource = new HiveDataSource(); hiveDataSource.setAddress("jdbc:hive2: hiveDataSource.setDatabase("test"); hiveDataSource.setPassword("123456"); hiveDataSource.setUser("test"); Assert.assertEquals("jdbc:hive2: hiveDataSource.setPrincipal("hive/test.com@TEST.COM"); Assert.assertEquals("jdbc:hive2: hiveDataSource.getJdbcUrl()); hiveDataSource.setOther("charset=UTF-8"); Assert.assertEquals( "jdbc:hive2: hiveDataSource.getJdbcUrl()); BaseDataSource clickHouseDataSource = new ClickHouseDataSource(); clickHouseDataSource.setAddress("jdbc:clickhouse: clickHouseDataSource.setDatabase("test"); clickHouseDataSource.setPassword("123456"); clickHouseDataSource.setUser("test"); Assert.assertEquals("jdbc:clickhouse: clickHouseDataSource.setPrincipal("fake principal"); Assert.assertEquals("jdbc:clickhouse: clickHouseDataSource.setOther("charset=UTF-8"); Assert.assertEquals("jdbc:clickhouse: clickHouseDataSource.getJdbcUrl()); BaseDataSource sqlServerDataSource = new SQLServerDataSource(); sqlServerDataSource.setAddress("jdbc:sqlserver: sqlServerDataSource.setDatabase("test"); sqlServerDataSource.setPassword("123456"); sqlServerDataSource.setUser("test"); Assert.assertEquals("jdbc:sqlserver: sqlServerDataSource.getJdbcUrl()); sqlServerDataSource.setPrincipal("fake principal"); Assert.assertEquals("jdbc:sqlserver: sqlServerDataSource.getJdbcUrl()); sqlServerDataSource.setOther("charset=UTF-8"); Assert.assertEquals("jdbc:sqlserver: sqlServerDataSource.getJdbcUrl()); BaseDataSource db2DataSource = new DB2ServerDataSource(); db2DataSource.setAddress("jdbc:db2: db2DataSource.setDatabase("test"); db2DataSource.setPassword("123456"); db2DataSource.setUser("test"); Assert.assertEquals("jdbc:db2: db2DataSource.setPrincipal("fake principal"); Assert.assertEquals("jdbc:db2: db2DataSource.setOther("charset=UTF-8"); Assert.assertEquals("jdbc:db2: }