Skip to content

Commit bc86232

Browse files
committed
AJ-422:fix broken case
1 parent a9b6be5 commit bc86232

13 files changed

+58
-40
lines changed

test/com/xxdb/ConnectionPoolTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,9 @@ public void test_PartitionedTableAppender_ArrayVector_AllDataType() throws Excep
12881288
cols.add(bdv32a);
12891289
List<Vector> bdv128 = new ArrayList<Vector>();
12901290
Vector v128=new BasicDecimal32Vector(3,8);
1291-
v128.set(0,new BasicDecimal32(15645.99999999,8));
1292-
v128.set(1,new BasicDecimal32(24635.00000001,8));
1293-
v128.set(2,new BasicDecimal32(24635.12345678,8));
1291+
v128.set(0,new BasicDecimal32(0.99999999,8));
1292+
v128.set(1,new BasicDecimal32(0.00000001,8));
1293+
v128.set(2,new BasicDecimal32(0.12345678,8));
12941294
bdv128.add(0,v128);
12951295
bdv128.add(1,v128);
12961296
bdv128.add(2,v128);

test/com/xxdb/MultithreadedTableWriterTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4583,16 +4583,16 @@ public void test_mtw_concurrentWrite_hash_Symbol_partition_table() throws Except
45834583
@Test(timeout = 120000)
45844584
public void test_mtw_concurrentWrite_getFailedData() throws Exception {
45854585
conn.run("login(`admin,`123456)\n" +
4586-
"dbName = \"dfs://test_mtw_concurrentWrite_getFailedData\"\n" +
4586+
"dbName = \"dfs://test_mtw_concurrentWrite_getFailedData1\"\n" +
45874587
"if(existsDatabase(dbName)){\n" +
45884588
"\tdropDB(dbName)\n" +
45894589
"}\n" +
45904590
"db = database(dbName,RANGE,0 10 20 30)\n" +
45914591
"t = table(10:0,`id`price`val,[INT,DOUBLE,INT])\n" +
45924592
"pt = db.createPartitionedTable(t,`pt,`id)");
4593-
MultithreadedTableWriter mtw_getFailedData1 = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://test_mtw_concurrentWrite_getFailedData", "pt",
4593+
MultithreadedTableWriter mtw_getFailedData1 = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://test_mtw_concurrentWrite_getFailedData1", "pt",
45944594
false, false, null, 1000, 0.001f, 10, "id");
4595-
MultithreadedTableWriter mtw_getFailedData2 = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://test_mtw_concurrentWrite_getFailedData", "pt",
4595+
MultithreadedTableWriter mtw_getFailedData2 = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://test_mtw_concurrentWrite_getFailedData1", "pt",
45964596
false, false, null, 1000, 0.001f, 10, "id");
45974597

45984598
for(int i = 0;i <2000;i++) {

test/com/xxdb/data/BasicDecimal128Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public void testBasicDecimal128_toJsonString() throws IOException {
421421
BasicDecimal128 re1 = new BasicDecimal128("12341.23", 3);
422422
String re = JSONObject.toJSONString(re1);
423423
System.out.println(re);
424-
assertEquals("{\"chart\":false,\"chunk\":false,\"dataCategory\":\"DENARY\",\"dataForm\":\"DF_SCALAR\",\"dataType\":\"DT_DECIMAL128\",\"dictionary\":false,\"jsonString\":\"12341.230\",\"matrix\":false,\"null\":false,\"number\":12341.23,\"pair\":false,\"scalar\":true,\"scale\":3,\"string\":\"12341.230\",\"table\":false,\"vector\":false}\n", re);
424+
assertEquals("{\"chart\":false,\"chunk\":false,\"dataCategory\":\"DENARY\",\"dataForm\":\"DF_SCALAR\",\"dataType\":\"DT_DECIMAL128\",\"dictionary\":false,\"jsonString\":\"12341.230\",\"matrix\":false,\"null\":false,\"number\":12341.23,\"pair\":false,\"scalar\":true,\"scale\":3,\"string\":\"12341.230\",\"table\":false,\"vector\":false}", re);
425425

426426
}
427427
@Test

test/com/xxdb/data/BasicDecimal128VectorTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,13 @@ public void test_BasicDecimal128Vector_set_null() throws Exception {
187187
public void test_BasicDecimal128Vector_set_int() throws Exception {
188188
String[] tmp_string_v = {"0.0","-123.00432","132.204234","100.0"};
189189
BasicDecimal128Vector tmp_128_v = new BasicDecimal128Vector(tmp_string_v,4);
190-
tmp_128_v.set(0,new BasicInt(2));
191-
assertEquals("[2.0000,-123.0043,132.2042,100.0000]",tmp_128_v.getString());
190+
String RE = null;
191+
try{
192+
tmp_128_v.set(0,new BasicInt(2));
193+
}catch(Exception E){
194+
RE = E.getMessage();
195+
}
196+
assertEquals("value type is not BasicDecimal64!",RE);
192197
}
193198

194199
@Test
@@ -361,7 +366,7 @@ public void testBasicDecimal128_run_vector_all_NULL() throws IOException {
361366
}
362367
@Test
363368
public void testBasicDecimal128_run_bigvector1() throws IOException {
364-
BasicArrayVector re1 =(BasicArrayVector) conn.run("bigarray(Decimal128(2)[], 0, 3000000).append!(take([[92233720368547758, NULL, 100000000000000, NULL, -92233720368547758, -100000000000000], [], [00i], [92233720368547758]], 30000)) * 10");
369+
BasicArrayVector re1 =(BasicArrayVector) conn.run("bigarray(DECIMAL128(2)[], 0, 3000000).append!(take([[92233720368547758, NULL, 100000000000000, NULL, -92233720368547758, -100000000000000], [], [00i], [92233720368547758]], 30000)) * 10");
365370
System.out.println(re1.getString());
366371
assertEquals("[[922337203685477580.00,,1000000000000000.00,,-922337203685477580.00,-1000000000000000.00],[],[],[922337203685477580.00],[922337203685477580.00,,1000000000000000.00,,-922337203685477580.00,-1000000000000000.00],[],[],[922337203685477580.00],[922337203685477580.00,,1000000000000000.00,,-922337203685477580.00,-1000000000000000.00],[],...]",re1.getString());
367372
}

test/com/xxdb/data/BasicDecimal32VectorTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,14 @@ public void test_BasicDecimal32Vector_set_int() throws Exception {
152152
double[] tmp_double_v = {0.0,-123.00432,132.204234,100.0};
153153
BasicDecimal32Vector tmp_32_v = new BasicDecimal32Vector(tmp_double_v,4);
154154
BasicDecimal32 tmp_32 = (BasicDecimal32) conn.run("decimal32(NULL,4)");
155-
tmp_32_v.set(0,new BasicInt(2));
155+
String RE = null;
156+
try{
157+
tmp_32_v.set(0,new BasicInt(2));
158+
}catch(Exception E){
159+
RE = E.getMessage();
160+
}
161+
assertEquals("value type is not BasicDecimal32!",RE);
162+
156163
}
157164
@Test
158165
public void test_BasicDecimal32Vector_set_string() throws Exception {

test/com/xxdb/data/BasicDecimal64Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void testBasicDecimal64_value_string_scale_18_overflow(){
109109
catch(Exception e){
110110
re = e.getMessage();
111111
}
112-
assertEquals(re,"Decimal math overflow!");
112+
assertEquals(re,"Decimal math overflow: 9.9999999999999999999");
113113

114114
String re1 = null;
115115
try{
@@ -118,7 +118,7 @@ public void testBasicDecimal64_value_string_scale_18_overflow(){
118118
catch(Exception e){
119119
re1 = e.getMessage();
120120
}
121-
assertEquals(re1,"Decimal math overflow!");
121+
assertEquals("Decimal math overflow: -9.9999999999999999999",re1);
122122
}
123123
@Test
124124
public void testBasicDecimal64_value_string_scale_19(){

test/com/xxdb/data/BasicDecimal64VectorTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ public void test_BasicDecimal64Vector_set_null() throws Exception {
149149
public void test_BasicDecimal64Vector_set_int() throws Exception {
150150
double[] tmp_double_v = {0.0,-123.00432,132.204234,100.0};
151151
BasicDecimal64Vector tmp_64_v = new BasicDecimal64Vector(tmp_double_v,4);
152-
tmp_64_v.set(0,new BasicInt(2));
153-
assertEquals("[2.0000,-123.0043,132.2042,100.0000]",tmp_64_v.getString());
152+
String RE = null;
153+
try{
154+
tmp_64_v.set(0,new BasicInt(2));
155+
}catch(Exception E){
156+
RE = E.getMessage();
157+
}
158+
assertEquals("value type is not BasicDecimal64!",RE);
154159
}
155160
@Test
156161
public void test_BasicDecimal64Vector_set_string() throws Exception {

test/com/xxdb/data/BasicLongTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void test_BasicLongVector_toJSONString() throws Exception {
192192
BasicLongVector blv = new BasicLongVector(new long[]{600,615,617});
193193
String re = JSONObject.toJSONString(blv);
194194
System.out.println(re);
195-
assertEquals("{\"chart\":false,\"chunk\":false,\"dataArray\":[600,615,617],\"dataCategory\":\"INTEGRAL\",\"dataForm\":\"DF_VECTOR\",\"dataType\":\"DT_LONG\",\"dictionary\":false,\"elementClass\":\"com.xxdb.data.BasicLong\",\"matrix\":false,\"pair\":false,\"scalar\":false,\"string\":\"[600,615,617]\",\"table\":false,\"unitLength\":16,\"vector\":true}\n", re);
195+
assertEquals("{\"chart\":false,\"chunk\":false,\"dataArray\":[600,615,617],\"dataCategory\":\"INTEGRAL\",\"dataForm\":\"DF_VECTOR\",\"dataType\":\"DT_LONG\",\"dictionary\":false,\"elementClass\":\"com.xxdb.data.BasicLong\",\"matrix\":false,\"pair\":false,\"scalar\":false,\"string\":\"[600,615,617]\",\"table\":false,\"unitLength\":16,\"vector\":true}", re);
196196
}
197197
@Test
198198
public void test_BasicLongMatrix_toJSONString() throws Exception {

test/com/xxdb/data/BasicStringTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ public void test_BasicStringVector_toJSONString() throws Exception {
885885
BasicStringVector bsv = new BasicStringVector(array,false,true);
886886
String re = JSONObject.toJSONString(bsv);
887887
System.out.println(re);
888-
assertEquals("{\"chart\":false,\"chunk\":false,\"dataArray\":[\"Dolphindb\",\"MongoDB\",\"GaussDB\",\"GoldenDB\"],\"dataCategory\":\"LITERAL\",\"dataForm\":\"DF_VECTOR\",\"dataType\":\"DT_STRING\",\"dictionary\":false,\"elementClass\":\"com.xxdb.data.BasicString\",\"matrix\":false,\"pair\":false,\"scalar\":false,\"string\":\"[Dolphindb,MongoDB,GaussDB,GoldenDB]\",\"table\":false,\"unitLength\":1,\"vector\":true}", re);
888+
assertEquals("{\"chart\":false,\"chunk\":false,\"dataCategory\":\"LITERAL\",\"dataForm\":\"DF_VECTOR\",\"dataType\":\"DT_STRING\",\"dictionary\":false,\"elementClass\":\"com.xxdb.data.BasicString\",\"matrix\":false,\"pair\":false,\"scalar\":false,\"string\":\"[Dolphindb,MongoDB,GaussDB,GoldenDB]\",\"table\":false,\"unitLength\":1,\"vector\":true}", re);
889889
}
890890
@Test
891891
public void test_BasicStringMatrix_toJSONString() throws Exception {

test/com/xxdb/data/TimeTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ public void test_BasicNanoTimeStampVector(){
910910
long[] array = new long[]{23641343568000L,23995876902000L,24104786790000L,12013435579000L,Long.MIN_VALUE};
911911
BasicNanoTimestampVector btv = new BasicNanoTimestampVector(array,true);
912912
assertNull(btv.getNanoTimestamp(4));
913+
System.out.println(btv.getNanoTimestamp(4));
913914
bnts = btv;
914915
assertEquals(Entity.DATA_CATEGORY.TEMPORAL,bnts.getDataCategory());
915916
assertEquals("[1970.01.01T03:20:13.435579000,1970.01.01T06:34:01.343568000," +

0 commit comments

Comments
 (0)