|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { connectionCanEdit, resolveUrlInfo, splitUrl } from '../app.service'; |
|
|
|
|
import { connectionCanEdit, resolveUrlInfo, splitUrl, getJdbcDatabaseType } from '../app.service'; |
|
|
|
|
const connection = { |
|
|
|
|
connectionId: '', |
|
|
|
|
connectionType: '', |
|
|
|
@ -12,6 +12,14 @@ const connection = {
|
|
|
|
|
test('DEC-11030 拼接url', () => { |
|
|
|
|
expect(splitUrl('localhost', '22', 'dbname', 'jdbc:pivotal:greenplum://hostname:port;dbname')).toEqual('jdbc:pivotal:greenplum://localhost:22;dbname'); |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* test_author_alan |
|
|
|
|
*/ |
|
|
|
|
test('BI-56355 如果驱动和URL均为空,则为其他jdbc', () => { |
|
|
|
|
expect(getJdbcDatabaseType('', '').databaseType).toEqual('otherJDBC'); |
|
|
|
|
expect(getJdbcDatabaseType('mysql', '').databaseType).toEqual('mysql'); |
|
|
|
|
expect(getJdbcDatabaseType('', 'com.mysql.jdbc.Driver').databaseType).toEqual('mysql'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* test_author_alan |
|
|
|
|