Skip to content

Commit 22bc0d5

Browse files
committed
fix tests
1 parent 59c357f commit 22bc0d5

2 files changed

Lines changed: 44 additions & 40 deletions

File tree

integration-test/src/test/java/org/apache/iotdb/relational/it/insertquery/IoTDBInsertQueryIT.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,15 @@ public void testPrivileges() throws SQLException {
271271
Statement adminStmt = adminCon.createStatement();
272272
try {
273273
// create user
274-
adminStmt.execute("CREATE USER tmpuser 'tmppw'");
274+
adminStmt.execute("CREATE USER tmpuser 'tmppw123456789'");
275275
// create table vehicle1
276276
adminStmt.execute("USE test");
277277
adminStmt.execute(String.format(createTableTemplate, 1));
278278
adminStmt.execute("GRANT INSERT ON test.vehicle1 TO USER tmpuser");
279279

280280
try (Connection connection =
281-
EnvFactory.getEnv().getConnection("tmpuser", "tmppw", BaseEnv.TABLE_SQL_DIALECT);
281+
EnvFactory.getEnv()
282+
.getConnection("tmpuser", "tmppw123456789", BaseEnv.TABLE_SQL_DIALECT);
282283
Statement statement = connection.createStatement()) {
283284
statement.execute("USE test");
284285
// insert into vehicle1 select * from vehicle0
@@ -297,7 +298,8 @@ public void testPrivileges() throws SQLException {
297298
adminStmt.execute("GRANT SELECT ON test.vehicle0 TO USER tmpuser");
298299

299300
try (Connection connection =
300-
EnvFactory.getEnv().getConnection("tmpuser", "tmppw", BaseEnv.TABLE_SQL_DIALECT);
301+
EnvFactory.getEnv()
302+
.getConnection("tmpuser", "tmppw123456789", BaseEnv.TABLE_SQL_DIALECT);
301303
Statement statement = connection.createStatement()) {
302304
statement.execute("USE test");
303305
// insert into vehicle1 select * from vehicle0
@@ -315,7 +317,8 @@ public void testPrivileges() throws SQLException {
315317
adminStmt.execute("GRANT INSERT ON test.vehicle1 TO USER tmpuser");
316318
// adminStmt.execute("GRANT WRITE_DATA ON test.vehicle1 TO USER tmpuser");
317319
try (Connection connection =
318-
EnvFactory.getEnv().getConnection("tmpuser", "tmppw", BaseEnv.TABLE_SQL_DIALECT);
320+
EnvFactory.getEnv()
321+
.getConnection("tmpuser", "tmppw123456789", BaseEnv.TABLE_SQL_DIALECT);
319322
Statement statement = connection.createStatement()) {
320323
statement.execute("USE test");
321324
// insert into vehicle1 select * from vehicle0

integration-test/src/test/java/org/apache/iotdb/relational/it/query/old/builtinfunction/scalar/IoTDBBitwiseFunctionTableIT.java

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.apache.iotdb.relational.it.query.old.builtinfunction.scalar;
2121

22+
import org.apache.iotdb.commons.conf.CommonDescriptor;
2223
import org.apache.iotdb.it.env.EnvFactory;
2324
import org.apache.iotdb.it.framework.IoTDBTestRunner;
2425
import org.apache.iotdb.itbase.category.TableClusterIT;
@@ -147,8 +148,8 @@ public void bitCountTestError1() {
147148
EnvFactory.getEnv(),
148149
"select time,s2,s3,bit_count(9,64),bit_count(s2,64),bit_count(s2,s3) from bit_count_error_table",
149150
"Argument exception, the scalar function num must be representable with the bits specified. 9 cannot be represented with 2 bits.",
150-
"root",
151-
"root",
151+
CommonDescriptor.getInstance().getConfig().getAdminName(),
152+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
152153
DATABASE_NAME);
153154
}
154155

@@ -158,8 +159,8 @@ public void bitCountTestError2() {
158159
EnvFactory.getEnv(),
159160
"select time,s2,s3,bit_count(9,1),bit_count(s2,1),bit_count(s2,s3) from bit_count_error_table",
160161
"Argument exception, the scalar function bit_count bits must be between 2 and 64.",
161-
"root",
162-
"root",
162+
CommonDescriptor.getInstance().getConfig().getAdminName(),
163+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
163164
DATABASE_NAME);
164165
}
165166

@@ -169,16 +170,16 @@ public void bitCountTestWithNonInteger() {
169170
EnvFactory.getEnv(),
170171
"select time, bit_count(s4) from bit_count_error_table",
171172
"701: Scalar function bit_count only accepts two arguments and they must be Int32 or Int64 data type.",
172-
"root",
173-
"root",
173+
CommonDescriptor.getInstance().getConfig().getAdminName(),
174+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
174175
DATABASE_NAME);
175176

176177
assertTableTestFail(
177178
EnvFactory.getEnv(),
178179
"select time, bit_count(s1,s4) from bit_count_error_table",
179180
"701: Scalar function bit_count only accepts two arguments and they must be Int32 or Int64 data type.",
180-
"root",
181-
"root",
181+
CommonDescriptor.getInstance().getConfig().getAdminName(),
182+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
182183
DATABASE_NAME);
183184
}
184185

@@ -203,16 +204,16 @@ public void bitwiseAndTestWithNonInteger() {
203204
EnvFactory.getEnv(),
204205
"select time, bitwise_and(s4) from bitwise_and_table",
205206
"701: Scalar function bitwise_and only accepts two arguments and they must be Int32 or Int64 data type.",
206-
"root",
207-
"root",
207+
CommonDescriptor.getInstance().getConfig().getAdminName(),
208+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
208209
DATABASE_NAME);
209210

210211
assertTableTestFail(
211212
EnvFactory.getEnv(),
212213
"select time, bitwise_and(s1,s4) from bitwise_and_table",
213214
"701: Scalar function bitwise_and only accepts two arguments and they must be Int32 or Int64 data type.",
214-
"root",
215-
"root",
215+
CommonDescriptor.getInstance().getConfig().getAdminName(),
216+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
216217
DATABASE_NAME);
217218
}
218219

@@ -239,16 +240,16 @@ public void bitwiseNotTestWithNonInteger() {
239240
EnvFactory.getEnv(),
240241
"select time, bitwise_not(s4) from bitwise_not_table",
241242
"701: Scalar function bitwise_not only accepts one argument and it must be Int32 or Int64 data type.",
242-
"root",
243-
"root",
243+
CommonDescriptor.getInstance().getConfig().getAdminName(),
244+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
244245
DATABASE_NAME);
245246

246247
assertTableTestFail(
247248
EnvFactory.getEnv(),
248249
"select time, bitwise_not(s1,s4) from bitwise_not_table",
249250
"701: Scalar function bitwise_not only accepts one argument and it must be Int32 or Int64 data type.",
250-
"root",
251-
"root",
251+
CommonDescriptor.getInstance().getConfig().getAdminName(),
252+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
252253
DATABASE_NAME);
253254
}
254255

@@ -273,16 +274,16 @@ public void bitwiseOrTestWithNonInteger() {
273274
EnvFactory.getEnv(),
274275
"select time, bitwise_or(s4) from bitwise_or_table",
275276
"701: Scalar function bitwise_or only accepts two arguments and they must be Int32 or Int64 data type.",
276-
"root",
277-
"root",
277+
CommonDescriptor.getInstance().getConfig().getAdminName(),
278+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
278279
DATABASE_NAME);
279280

280281
assertTableTestFail(
281282
EnvFactory.getEnv(),
282283
"select time, bitwise_or(s1,s4) from bitwise_or_table",
283284
"701: Scalar function bitwise_or only accepts two arguments and they must be Int32 or Int64 data type.",
284-
"root",
285-
"root",
285+
CommonDescriptor.getInstance().getConfig().getAdminName(),
286+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
286287
DATABASE_NAME);
287288
}
288289

@@ -307,16 +308,16 @@ public void bitwiseXorTestWithNonInteger() {
307308
EnvFactory.getEnv(),
308309
"select time, bitwise_xor(s4) from bitwise_xor_table",
309310
"701: Scalar function bitwise_xor only accepts two arguments and they must be Int32 or Int64 data type.",
310-
"root",
311-
"root",
311+
CommonDescriptor.getInstance().getConfig().getAdminName(),
312+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
312313
DATABASE_NAME);
313314

314315
assertTableTestFail(
315316
EnvFactory.getEnv(),
316317
"select time, bitwise_xor(s1,s4) from bitwise_xor_table",
317318
"701: Scalar function bitwise_xor only accepts two arguments and they must be Int32 or Int64 data type.",
318-
"root",
319-
"root",
319+
CommonDescriptor.getInstance().getConfig().getAdminName(),
320+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
320321
DATABASE_NAME);
321322
}
322323

@@ -346,16 +347,16 @@ public void bitwiseLeftShiftTestWithNonInteger() {
346347
EnvFactory.getEnv(),
347348
"select time, bitwise_left_shift(s4) from bitwise_left_shift_table",
348349
"701: Scalar function bitwise_left_shift only accepts two arguments and they must be Int32 or Int64 data type.",
349-
"root",
350-
"root",
350+
CommonDescriptor.getInstance().getConfig().getAdminName(),
351+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
351352
DATABASE_NAME);
352353

353354
assertTableTestFail(
354355
EnvFactory.getEnv(),
355356
"select time, bitwise_left_shift(s1,s4) from bitwise_left_shift_table",
356357
"701: Scalar function bitwise_left_shift only accepts two arguments and they must be Int32 or Int64 data type.",
357-
"root",
358-
"root",
358+
CommonDescriptor.getInstance().getConfig().getAdminName(),
359+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
359360
DATABASE_NAME);
360361
}
361362

@@ -387,16 +388,16 @@ public void bitwiseRightShiftTestWithNonInteger() {
387388
EnvFactory.getEnv(),
388389
"select time, bitwise_right_shift(s4) from bitwise_right_shift_table",
389390
"701: Scalar function bitwise_right_shift only accepts two arguments and they must be Int32 or Int64 data type.",
390-
"root",
391-
"root",
391+
CommonDescriptor.getInstance().getConfig().getAdminName(),
392+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
392393
DATABASE_NAME);
393394

394395
assertTableTestFail(
395396
EnvFactory.getEnv(),
396397
"select time, bitwise_right_shift(s1,s4) from bitwise_right_shift_table",
397398
"701: Scalar function bitwise_right_shift only accepts two arguments and they must be Int32 or Int64 data type.",
398-
"root",
399-
"root",
399+
CommonDescriptor.getInstance().getConfig().getAdminName(),
400+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
400401
DATABASE_NAME);
401402
}
402403

@@ -422,16 +423,16 @@ public void bitwiseRightShiftArithmeticTestWithNonInteger() {
422423
EnvFactory.getEnv(),
423424
"select time, bitwise_right_shift_arithmetic(s4) from bitwise_right_shift_arithmetic_table",
424425
"701: Scalar function bitwise_right_shift_arithmetic only accepts two arguments and they must be Int32 or Int64 data type.",
425-
"root",
426-
"root",
426+
CommonDescriptor.getInstance().getConfig().getAdminName(),
427+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
427428
DATABASE_NAME);
428429

429430
assertTableTestFail(
430431
EnvFactory.getEnv(),
431432
"select time, bitwise_right_shift_arithmetic(s1,s4) from bitwise_right_shift_arithmetic_table",
432433
"701: Scalar function bitwise_right_shift_arithmetic only accepts two arguments and they must be Int32 or Int64 data type.",
433-
"root",
434-
"root",
434+
CommonDescriptor.getInstance().getConfig().getAdminName(),
435+
CommonDescriptor.getInstance().getConfig().getAdminPassword(),
435436
DATABASE_NAME);
436437
}
437438
}

0 commit comments

Comments
 (0)