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