Skip to content

Commit 49d9115

Browse files
committed
AJ-833:fix broken case for login
1 parent fed98cc commit 49d9115

14 files changed

+135
-149
lines changed

test/com/xxdb/DBConnectionTest.java

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.xxdb.io.LittleEndianDataOutputStream;
99
import com.xxdb.io.Long2;
1010
import com.xxdb.io.ProgressListener;
11+
import com.xxdb.route.AutoFitTableUpsert;
1112
import com.xxdb.streaming.client.Site;
1213
import org.junit.*;
1314
import org.slf4j.Logger;
@@ -2811,7 +2812,7 @@ public void test_DBConnection_not_login() throws IOException, InterruptedExcepti
28112812
}catch(Exception ex){
28122813
re = ex.getMessage();
28132814
}
2814-
assertEquals(true,re.contains("getGroupList() => Only administrators execute function getGroupList"));
2815+
assertEquals(true,re.contains("Login is required for script execution with client authentication enabled. "));
28152816
}
28162817
@Test
28172818
public void TestPartitionTable() throws IOException, InterruptedException {
@@ -3809,7 +3810,7 @@ public void test_tryRun_script() throws IOException{
38093810
@Test
38103811
public void test_tryRun_priority_parallelism() throws IOException {
38113812
DBConnection conn = new DBConnection();
3812-
assertTrue(conn.connect(HOST,PORT,false));
3813+
assertTrue(conn.connect(HOST,PORT,"admin","123456",false));
38133814
String scripts = "m=1..10$5:2;";
38143815
conn.tryRun(scripts,1,1);
38153816
BasicIntMatrix res = (BasicIntMatrix) conn.run("m;");
@@ -3861,7 +3862,7 @@ public void test_TryRun_fetchSize() throws IOException, InterruptedException {
38613862
@Test
38623863
public void test_run_priority() throws IOException{
38633864
DBConnection conn = new DBConnection(false,false);
3864-
conn.connect(HOST,PORT);
3865+
conn.connect(HOST,PORT,"admin","123456");
38653866
conn.run("t = table(1..5 as id, rand(100, 5) as price);",1);
38663867
BasicTable res = (BasicTable) conn.run("select * from t;",2);
38673868
assertEquals(5,res.rows());
@@ -3870,7 +3871,7 @@ public void test_run_priority() throws IOException{
38703871
@Test
38713872
public void test_run_clearSessionMemeory() throws IOException{
38723873
DBConnection conn = new DBConnection(false,false);
3873-
conn.connect(HOST,PORT);
3874+
conn.connect(HOST,PORT,"admin","123456");
38743875
Boolean noError = true;
38753876
conn.run("testVar=1",false);
38763877
assertEquals("1",conn.run("testVar;",false).getString());
@@ -3887,7 +3888,7 @@ public void test_run_clearSessionMemeory() throws IOException{
38873888
@Test
38883889
public void test_run_progressListener() throws IOException{
38893890
DBConnection conn = new DBConnection(false,false);
3890-
conn.connect(HOST,PORT);
3891+
conn.connect(HOST,PORT,"admin","123456");
38913892
ProgressListener listener = new ProgressListener() {
38923893
@Override
38933894
public void progress(String message) {
@@ -3926,7 +3927,7 @@ public void test_tryUpload() throws IOException{
39263927
@Test
39273928
public void test_SSL() throws Exception {
39283929
DBConnection conn = new DBConnection(false,true);
3929-
assertTrue(conn.connect(HOST,PORT));
3930+
assertTrue(conn.connect(HOST,PORT,"admin","123456"));
39303931
HashMap<String,Entity> map = new HashMap<>();
39313932
map.put("x",conn.run("x=[1 3 6 10];"));
39323933
map.put("y",conn.run("y=[2 1 5 3];"));
@@ -4789,8 +4790,7 @@ public void test_BasicDBTask1223()throws Exception{
47894790
@Test
47904791
public void Test_Connect_SqlStdEnum_DolphinDB() throws IOException, InterruptedException {
47914792
DBConnection conn = new DBConnection(DolphinDB);
4792-
conn.connect(HOST,PORT);
4793-
sleep(500);
4793+
conn.connect(HOST,PORT,"admin","123456");
47944794
assertEquals(true, conn.isConnected());
47954795
BasicDoubleVector ba = (BasicDoubleVector)conn.run("cumavg(1 2 3);");
47964796
System.out.println(ba.getString());
@@ -4807,8 +4807,7 @@ public void Test_Connect_SqlStdEnum_DolphinDB() throws IOException, InterruptedE
48074807
@Test
48084808
public void Test_Connect_SqlStdEnum_DolphinDB_1() throws IOException, InterruptedException {
48094809
DBConnection conn = new DBConnection();
4810-
conn.connect(HOST,PORT);
4811-
sleep(500);
4810+
conn.connect(HOST,PORT,"admin","123456");
48124811
assertEquals(true, conn.isConnected());
48134812
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'ddb')");
48144813
System.out.println(ba.getString());
@@ -4825,8 +4824,7 @@ public void Test_Connect_SqlStdEnum_DolphinDB_1() throws IOException, Interrupte
48254824
@Test
48264825
public void Test_Connect_SqlStdEnum_DolphinDB_2() throws IOException, InterruptedException {
48274826
DBConnection conn = new DBConnection(DolphinDB);
4828-
conn.connect(HOST,PORT);
4829-
sleep(500);
4827+
conn.connect(HOST,PORT,"admin","123456");
48304828
assertEquals(true, conn.isConnected());
48314829
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'ddb')");
48324830
System.out.println(ba.getString());
@@ -4863,9 +4861,7 @@ public void Test_Connect_SqlStdEnum_DolphinDB_2() throws IOException, Interrupte
48634861
@Test
48644862
public void Test_Connect_SqlStdEnum_Oracle() throws IOException, InterruptedException {
48654863
DBConnection conn = new DBConnection(Oracle);
4866-
conn.connect(HOST,PORT);
4867-
conn.connect(HOST,PORT);
4868-
sleep(500);
4864+
conn.connect(HOST,PORT,"admin","123456");
48694865
assertEquals(true, conn.isConnected());
48704866
BasicDoubleVector ba = (BasicDoubleVector)conn.run("cumavg(1 2 3);");
48714867
System.out.println(ba.getString());
@@ -4885,9 +4881,7 @@ public void Test_Connect_SqlStdEnum_Oracle() throws IOException, InterruptedExce
48854881
@Test
48864882
public void Test_Connect_SqlStdEnum_Oracle_1() throws IOException, InterruptedException {
48874883
DBConnection conn = new DBConnection();
4888-
conn.connect(HOST,PORT);
4889-
conn.connect(HOST,PORT);
4890-
sleep(500);
4884+
conn.connect(HOST,PORT,"admin","123456");
48914885
assertEquals(true, conn.isConnected());
48924886
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'oracle');");
48934887
System.out.println(ba.getString());
@@ -4907,9 +4901,7 @@ public void Test_Connect_SqlStdEnum_Oracle_1() throws IOException, InterruptedEx
49074901
@Test
49084902
public void Test_Connect_SqlStdEnum_Oracle_2() throws IOException, InterruptedException {
49094903
DBConnection conn = new DBConnection(Oracle);
4910-
conn.connect(HOST,PORT);
4911-
conn.connect(HOST,PORT);
4912-
sleep(500);
4904+
conn.connect(HOST,PORT,"admin","123456");
49134905
assertEquals(true, conn.isConnected());
49144906
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'ddb');");
49154907
System.out.println(ba.getString());
@@ -4929,8 +4921,7 @@ public void Test_Connect_SqlStdEnum_Oracle_2() throws IOException, InterruptedEx
49294921
@Test
49304922
public void Test_Connect_SqlStdEnum_MySQL() throws IOException, InterruptedException {
49314923
DBConnection conn = new DBConnection(MySQL);
4932-
conn.connect(HOST,PORT);
4933-
sleep(500);
4924+
conn.connect(HOST,PORT,"admin","123456");
49344925
assertEquals(true, conn.isConnected());
49354926
BasicDoubleVector ba = (BasicDoubleVector)conn.run("cumavg(1 2 3);");
49364927
System.out.println(ba.getString());
@@ -4955,8 +4946,7 @@ public void Test_Connect_SqlStdEnum_MySQL() throws IOException, InterruptedExcep
49554946
@Test
49564947
public void Test_Connect_SqlStdEnum_MySQL_1() throws IOException, InterruptedException {
49574948
DBConnection conn = new DBConnection();
4958-
conn.connect(HOST,PORT);
4959-
sleep(500);
4949+
conn.connect(HOST,PORT,"admin","123456");
49604950
assertEquals(true, conn.isConnected());
49614951
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'mysql');");
49624952
System.out.println(ba.getString());
@@ -4981,9 +4971,7 @@ public void Test_Connect_SqlStdEnum_MySQL_1() throws IOException, InterruptedExc
49814971
@Test
49824972
public void Test_Connect_SqlStdEnum_MySQL_2() throws IOException, InterruptedException {
49834973
DBConnection conn = new DBConnection(MySQL);
4984-
conn.connect(HOST,PORT);
4985-
conn.connect(HOST,PORT);
4986-
sleep(500);
4974+
conn.connect(HOST,PORT,"admin","123456");
49874975
assertEquals(true, conn.isConnected());
49884976
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'ddb');");
49894977
System.out.println(ba.getString());
@@ -5013,9 +5001,7 @@ public void Test_Connect_SqlStdEnum_not_match() throws IOException, InterruptedE
50135001
@Test
50145002
public void Test_Connect_SqlStdEnum_getByName() throws IOException, InterruptedException {
50155003
DBConnection conn = new DBConnection( getByName("MySQL"));
5016-
conn.connect(HOST,PORT);
5017-
conn.connect(HOST,PORT);
5018-
sleep(500);
5004+
conn.connect(HOST,PORT,"admin","123456");
50195005
assertEquals(true, conn.isConnected());
50205006
BasicDoubleVector ba = (BasicDoubleVector)conn.run("runSQL(\"cumavg(1 2 3)\", 'ddb');");
50215007
System.out.println(ba.getString());

test/com/xxdb/MultithreadedTableWriterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void prepare1 () throws IOException {
5151
DBConnection controller_conn = new DBConnection();
5252
controller_conn.connect(CONTROLLER_HOST, CONTROLLER_PORT, "admin", "123456");
5353
controller_conn.run("try{startDataNode('" + HOST + ":" + PORT + "')}catch(ex){}");
54-
controller_conn.run("sleep(5000)");
54+
controller_conn.run("sleep(8000)");
5555
}
5656
@Before
5757
public void prepare() throws IOException {

test/com/xxdb/SimpleDBConnectionPoolTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public void test_SimpleDBConnectionPool_config_userId_null() throws IOException,
214214
}catch(Exception ex){
215215
re = ex.getMessage();
216216
}
217-
assertEquals(true,re.contains("Only administrators execute function getGroupList"));
217+
assertEquals(true,re.contains("Login is required for script execution with client authentication enabled"));
218218
}
219219
@Test
220220
public void test_SimpleDBConnectionPool_config_userId_not_admin() throws IOException, InterruptedException {
@@ -628,7 +628,7 @@ public void test_SimpleDBConnectionPool_config_default() throws IOException, Int
628628
pool = new SimpleDBConnectionPool(config1);
629629
DBConnection poolEntry = pool.getConnection();
630630
assertEquals(5,pool.getTotalConnectionsCount());
631-
poolEntry.run("table(1..10000 as id ,take(`qq`aa`ss,10000) as id1)");
631+
poolEntry.run("version",new ArrayList<>());
632632
pool.close();
633633
}
634634
@Test

test/com/xxdb/data/BasicAnyVectorTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void test_serialize2() throws IOException {
6767
@Test
6868
public void test_BasicAnyVector_Entity() throws IOException {
6969
DBConnection conn = new DBConnection();
70-
conn.connect(HOST,PORT);
70+
conn.connect(HOST,PORT,"admin","123456");
7171
Entity[] arr = new Entity[3];
7272
arr[0] = conn.run("x=[1 3 2];x;");
7373
arr[1] = conn.run("y=1..4;y;");
@@ -105,7 +105,7 @@ public void test_BasicAnyVector_Entity() throws IOException {
105105
@Test
106106
public void test_BasicAnyVector_scalar() throws Exception {
107107
DBConnection conn = new DBConnection();
108-
conn.connect(HOST,PORT);
108+
conn.connect(HOST,PORT,"admin","123456");
109109
Entity[] arr = new Entity[12];
110110
for (int i = 0; i < 10; i++) {
111111
arr[i] = conn.run(""+i);
@@ -240,7 +240,7 @@ public void write(int b) throws IOException {
240240
@Test(expected = RuntimeException.class)
241241
public void test_basicAnyVector_Append_scalar() throws Exception {
242242
DBConnection conn = new DBConnection();
243-
conn.connect(HOST,PORT);
243+
conn.connect(HOST,PORT,"admin","123456");
244244
Entity[] arr = new Entity[12];
245245
for (int i = 0; i < 10; i++) {
246246
arr[i] = conn.run(""+i);
@@ -258,7 +258,7 @@ public void test_basicAnyVector_Append_scalar() throws Exception {
258258
@Test(expected = RuntimeException.class)
259259
public void test_BasicAnyVector_Append_vector() throws Exception {
260260
DBConnection conn = new DBConnection();
261-
conn.connect(HOST,PORT);
261+
conn.connect(HOST,PORT,"admin","123456");
262262
Entity[] arr = new Entity[12];
263263
for (int i = 0; i < 10; i++) {
264264
arr[i] = conn.run(""+i);
@@ -276,7 +276,7 @@ public void test_BasicAnyVector_Append_vector() throws Exception {
276276
@Test(expected = RuntimeException.class)
277277
public void test_BasicAnyVector_AddRange() throws Exception {
278278
DBConnection conn = new DBConnection();
279-
conn.connect(HOST,PORT);
279+
conn.connect(HOST,PORT,"admin","123456");
280280
Entity[] arr = new Entity[12];
281281
for (int i = 0; i < 10; i++) {
282282
arr[i] = conn.run(""+i);
@@ -294,7 +294,7 @@ public void test_BasicAnyVector_AddRange() throws Exception {
294294
@Test(expected = RuntimeException.class)
295295
public void test_BasicAnyVector_Add() throws Exception {
296296
DBConnection conn = new DBConnection();
297-
conn.connect(HOST,PORT);
297+
conn.connect(HOST,PORT,"admin","123456");
298298
Entity[] arr = new Entity[12];
299299
for (int i = 0; i < 10; i++) {
300300
arr[i] = conn.run(""+i);
@@ -311,7 +311,7 @@ public void test_BasicAnyVector_Add() throws Exception {
311311
@Test
312312
public void test_BasicAnyVector_toJsonString() throws Exception {
313313
DBConnection conn = new DBConnection();
314-
conn.connect(HOST,PORT);
314+
conn.connect(HOST,PORT,"admin","123456");
315315
Entity[] arr = new Entity[12];
316316
for (int i = 0; i < 10; i++) {
317317
arr[i] = conn.run(""+i);

0 commit comments

Comments
 (0)