@@ -2189,7 +2189,7 @@ public void testMatrixUpload() throws IOException {
2189
2189
assertTrue (((BasicDateTimeMatrix ) matrixDateTimeRes ).get (1 , 1 ).getString ().equals ("1925.10.18T23:32:09" ));
2190
2190
2191
2191
Entity matrixTimeCross = conn .run ("time(cross(add,13:31:10.008 12:30:10.008,1 2 3 -4))" );
2192
- Entity matrixTime = conn .run ("take(1900 .06.13T13:30:10,8)$4:2" );
2192
+ Entity matrixTime = conn .run ("take(2000 .06.13T13:30:10,8)$4:2" );
2193
2193
map .put ("matrixTimeCross" , matrixTimeCross );
2194
2194
map .put ("matrixTime" , matrixTime );
2195
2195
conn .upload (map );
@@ -5097,7 +5097,7 @@ public void test_exception_script() throws IOException {
5097
5097
}catch (Exception e ){
5098
5098
re = e .getMessage ();
5099
5099
}
5100
- assertEquals (true , re .contains ("Duplicated column name name. " ));
5100
+ assertEquals (true , re .contains ("Duplicated column name name " ));
5101
5101
}
5102
5102
5103
5103
@ Test
@@ -5112,7 +5112,7 @@ public void test_exception_Function() throws IOException {
5112
5112
}catch (Exception e ){
5113
5113
re = e .getMessage ();
5114
5114
}
5115
- assertEquals (true , re .contains ("Can't recognize function name C. function: C" ));
5115
+ assertEquals (true , re .contains ("Can't recognize function name C function: C" ));
5116
5116
}
5117
5117
@ Test
5118
5118
public void test_allDateType_combine () throws IOException {
@@ -5148,7 +5148,7 @@ public void test_allDateType_array_combine() throws IOException {
5148
5148
assertEquals (10000 , data .rows ());
5149
5149
}
5150
5150
5151
- @ Test //api设置的parallelism小于server的setMaxJobParallelism
5151
+ @ Test //api设置的parallelism小于server的setMaxJobParallelism server默认管理员MaxJobParallelism为64,普通用户2
5152
5152
public void test_DBConnection_run_parallelism_1 () throws IOException {
5153
5153
PrepareUser ("parallelism_test" ,"123456" );
5154
5154
conn = new DBConnection ();
@@ -5158,7 +5158,7 @@ public void test_DBConnection_run_parallelism_1() throws IOException {
5158
5158
DBConnection conn1 = new DBConnection ();
5159
5159
conn1 .connect (HOST ,PORT ,"parallelism_test" ,"123456" );
5160
5160
BasicTable re1 = (BasicTable )conn .run ("getConsoleJobs();" ,3 ,5 ,false );
5161
- Assert .assertEquals ("5 " ,re1 .getColumn (6 ).get (0 ).getString ());
5161
+ Assert .assertEquals ("2 " ,re1 .getColumn (6 ).get (0 ).getString ());
5162
5162
System .out .println (re1 .getColumn (5 ).get (0 ).getString ());
5163
5163
}
5164
5164
@ Test //api设置的parallelism大于server的setMaxJobParallelism
@@ -5189,10 +5189,10 @@ public void test_DBConnection_run_parallelism_3() throws IOException, Interrupte
5189
5189
System .out .println (re1 .getString ());
5190
5190
Assert .assertEquals ("22" ,re1 .getColumn (6 ).get (0 ).getString ());
5191
5191
}
5192
- @ Test //isClientAuth开启
5192
+ // @Test //isClientAuth开启
5193
5193
public void test_not_login_run_fuction () throws Exception {
5194
5194
DBConnection db = new DBConnection ();
5195
- db .connect ("192.168.0.69" , 8868 );
5195
+ db .connect (HOST , PORT );
5196
5196
Entity version = db .run ("version" ,new ArrayList <>());
5197
5197
System .out .println (version .getString ());
5198
5198
assertNotNull (version .getString ());
@@ -5263,7 +5263,7 @@ public void test_not_login_run_fuction_authenticateByTicket() throws Exception {
5263
5263
@ Test
5264
5264
public void test_not_login_run_fuction_login () throws Exception {
5265
5265
DBConnection db = new DBConnection ();
5266
- db .connect ("192.168.0.69" , 8868 );
5266
+ db .connect (HOST , PORT );
5267
5267
List <Entity > entity1 = new ArrayList <>();
5268
5268
entity1 .add (new BasicString ("admin" ));
5269
5269
entity1 .add (new BasicString ("123456" ));
@@ -5273,14 +5273,14 @@ public void test_not_login_run_fuction_login() throws Exception {
5273
5273
@ Test
5274
5274
public void test_not_login_run_fuction_not_support () throws Exception {
5275
5275
DBConnection db = new DBConnection ();
5276
- db .connect ("192.168.0.69" , 8868 );
5276
+ db .connect (HOST , PORT );
5277
5277
String re = null ;
5278
5278
try {
5279
5279
db .run ("getAllDBs" ,new ArrayList <>());
5280
5280
}catch (Exception e ){
5281
5281
re = e .getMessage ();
5282
5282
}
5283
- assertEquals (true , re .contains ("Login is required for script execution with client authentication enabled. RefId: S04009. function: getAllDBs" ));
5283
+ assertEquals (true , re .contains ("Login is required for script execution with client authentication enabled. RefId: S04009 function: getAllDBs" ));
5284
5284
}
5285
5285
//@Test //isClientAuth开启
5286
5286
public void test_Connect_enableHighAvailability_true () throws IOException {
@@ -5419,7 +5419,14 @@ public void Test_DBConnection_enableSCRAM_true_compress_true() throws Exception
5419
5419
System .out .println (re .getString ());
5420
5420
assertEquals ("2" , re .getString ());
5421
5421
}
5422
-
5422
+ //@Test
5423
+ public void Test_DBConnection_usePython_true () throws Exception {
5424
+ DBConnection conn = new DBConnection (false , false ,false ,true );
5425
+ conn .connect (HOST ,PORT ,"admin" ,"123456" );
5426
+ BasicInt re = (BasicInt ) conn .run ("1+1" );
5427
+ System .out .println (re .getString ());
5428
+ assertEquals ("2" , re .getString ());
5429
+ }
5423
5430
@ Test
5424
5431
public void Test_DBConnection_enableSCRAM_true_usePython_true () throws Exception {
5425
5432
PrepareUser_authMode ("test1" ,"123456" ,"scram" );
@@ -5465,6 +5472,57 @@ public void Test_DBConnection_enableSCRAM_true_login_function() throws Exception
5465
5472
System .out .println (re .getString ());
5466
5473
assertEquals ("2" , re .getString ());
5467
5474
}
5475
+
5476
+ @ Test
5477
+ public void Test_DBConnection_useKdb_false () throws Exception {
5478
+ DBConnection conn = new DBConnection (false , false ,false ,false ,false ,null ,false ,false );
5479
+ conn .connect (HOST ,PORT );
5480
+ BasicInt re = (BasicInt ) conn .run ("1+1" );
5481
+ System .out .println (re .getString ());
5482
+ assertEquals ("2" , re .getString ());
5483
+ }
5484
+ @ Test
5485
+ public void Test_DBConnection_useKdb_false_1 () throws Exception {
5486
+ DBConnection conn = new DBConnection (false , false ,false ,false ,false ,null ,false ,false );
5487
+ conn .connect (HOST ,PORT );
5488
+ String re = null ;
5489
+ try {
5490
+ BasicLong re1 = (BasicLong ) conn .run ("a:1\n ;a" );
5491
+ }catch (Exception e ){
5492
+ re = e .getMessage ();
5493
+ }
5494
+ assertEquals (true , re .contains ("Cannot recognize the token a script: a:1" ));
5495
+ }
5496
+
5497
+ //@Test
5498
+ public void Test_DBConnection_useKdb_true () throws Exception {
5499
+ DBConnection conn = new DBConnection (false , false ,false ,false ,false ,null ,false ,true );
5500
+ conn .connect (HOST ,8847 );
5501
+ BasicLong re = (BasicLong ) conn .run ("a:1\n ;a" );
5502
+ System .out .println (re .getString ());
5503
+ assertEquals ("1" , re .getString ());
5504
+ }
5505
+
5506
+ //@Test
5507
+ public void Test_DBConnection_useKdb_true_server_not_support () throws Exception {
5508
+ DBConnection conn = new DBConnection (false , false ,false ,false ,false ,null ,false ,true );
5509
+ conn .connect (HOST ,18921 );
5510
+ BasicInt re = (BasicInt ) conn .run ("1+1" );
5511
+ System .out .println (re .getString ());
5512
+ assertEquals ("2" , re .getString ());
5513
+ }
5514
+
5515
+ @ Test
5516
+ public void Test_DBConnection_useKdb_true_usePython_true () throws Exception {
5517
+ DBConnection conn = new DBConnection (false , false ,false ,true ,false ,null ,false ,true );
5518
+ String re = null ;
5519
+ try {
5520
+ conn .connect (HOST ,PORT );
5521
+ }catch (Exception e ){
5522
+ re = e .getMessage ();
5523
+ }
5524
+ assertEquals ("The param 'usePython' and 'useKdb' cannot be set simultaneously." , re );
5525
+ }
5468
5526
@ Test
5469
5527
public void Test_DBConnection_ConnectConfig () throws Exception {
5470
5528
DBConnection conn = new DBConnection ();
@@ -5694,7 +5752,7 @@ public void Test_DBConnection_ConnectConfig_initialScript() throws Exception {
5694
5752
}
5695
5753
5696
5754
@ Test
5697
- public void Test_DBConnection_ConnectConfig_reconnect_true_tryReconnectNums_10 () throws Exception {
5755
+ public void Test_DBConnection_ConnectConfig_reconnect_true_tryReconnectNums_5 () throws Exception {
5698
5756
DBConnection conn = new DBConnection ();
5699
5757
String re = null ;
5700
5758
try {
0 commit comments