Skip to content

Commit ed9ee90

Browse files
committed
update test case about release130
1 parent 46f496a commit ed9ee90

File tree

4 files changed

+6
-97
lines changed

4 files changed

+6
-97
lines changed

test/com/xxdb/compatibility_testing/release130/DBConnectionTest.java

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,96 +3100,6 @@ public void test_TryRun_args_fetchSize() throws IOException, InterruptedExceptio
31003100
assertTrue((endDT-startDT)<(afterDT-beforeDT));
31013101
}
31023102

3103-
@Test
3104-
public void test_getVersionNumber() throws IOException{
3105-
DBConnection conn = new DBConnection();
3106-
Class<DBConnection> dbc = DBConnection.class;
3107-
try{
3108-
Method method = dbc.getDeclaredMethod("getVersionNumber", String.class);
3109-
method.setAccessible(true);
3110-
Object obj = method.invoke(conn,"18.02 java");
3111-
assertEquals(1802,obj);
3112-
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
3113-
throw new RuntimeException(e);
3114-
}
3115-
}
3116-
@Test
3117-
public void test_Node_Constructor() throws IOException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
3118-
Object object = null;
3119-
// 获取外部类所有的内部类
3120-
Class<DBConnection> testDemoClass = DBConnection.class;
3121-
Class<?>[] declaredClasses = testDemoClass.getDeclaredClasses();
3122-
for(Class clazz : declaredClasses) {
3123-
// 获取修饰符的整数编码
3124-
int mod = clazz.getModifiers();
3125-
// 返回整数编码对应的修饰符的字符串对象(private static)
3126-
String modifier = Modifier.toString(mod);
3127-
if (modifier.contains("private static")) {
3128-
// 获取内部类的名字(TestClass),如果有过个内部类,可根据这个值分别判断
3129-
String simpleName = clazz.getSimpleName();
3130-
Constructor con = clazz.getConstructor(String.class,int.class,double.class);
3131-
object = con.newInstance(HOST,PORT,1.0);
3132-
Constructor con2 = clazz.getConstructor(String.class,int.class);
3133-
Object obj = con2.newInstance(HOST,PORT);
3134-
// Method method = clazz.getMethod("isEqual",clazz);
3135-
// assertTrue((Boolean) method.invoke(object,obj));
3136-
break;
3137-
}
3138-
}
3139-
}
3140-
@Test
3141-
public void test_Node_Constructor2() throws IOException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
3142-
Object object = null;
3143-
// 获取外部类所有的内部类
3144-
Class<DBConnection> testDemoClass = DBConnection.class;
3145-
Class<?>[] declaredClasses = testDemoClass.getDeclaredClasses();
3146-
for(Class clazz : declaredClasses) {
3147-
// 获取修饰符的整数编码
3148-
int mod = clazz.getModifiers();
3149-
// 返回整数编码对应的修饰符的字符串对象(private static)
3150-
String modifier = Modifier.toString(mod);
3151-
if (modifier.contains("private static")) {
3152-
// 获取内部类的名字(TestClass),如果有过个内部类,可根据这个值分别判断
3153-
String simpleName = clazz.getSimpleName();
3154-
Constructor con = clazz.getConstructor(String.class,double.class);
3155-
object = con.newInstance(HOST+":"+PORT,1.0);
3156-
Constructor con2 = clazz.getConstructor(String.class,int.class);
3157-
Object obj = con2.newInstance(HOST,PORT);
3158-
// Method method = clazz.getMethod("equals",clazz);
3159-
// assertTrue((Boolean) method.invoke(object,obj));
3160-
break;
3161-
}
3162-
}
3163-
}
3164-
3165-
@Test
3166-
public void test_Node_Constructor3() throws IOException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
3167-
Object object = null;
3168-
// 获取外部类所有的内部类
3169-
Class<DBConnection> testDemoClass = DBConnection.class;
3170-
Class<?>[] declaredClasses = testDemoClass.getDeclaredClasses();
3171-
for(Class clazz : declaredClasses) {
3172-
// 获取修饰符的整数编码
3173-
int mod = clazz.getModifiers();
3174-
// 返回整数编码对应的修饰符的字符串对象(private static)
3175-
String modifier = Modifier.toString(mod);
3176-
if (modifier.contains("private static")) {
3177-
// 获取内部类的名字(TestClass),如果有过个内部类,可根据这个值分别判断
3178-
String simpleName = clazz.getSimpleName();
3179-
Constructor con = clazz.getConstructor(String.class);
3180-
object = con.newInstance(HOST+":"+PORT);
3181-
System.out.println(clazz.getName());
3182-
Constructor con2 = clazz.getConstructor(String.class,int.class);
3183-
Object obj = con2.newInstance(HOST,PORT);
3184-
//// Method method = clazz.getMethod("isEqual" +
3185-
// "" +
3186-
// "",clazz);
3187-
// assertTrue((Boolean) method.invoke(object,obj));
3188-
break;
3189-
}
3190-
}
3191-
}
3192-
31933103
@Test
31943104
public void test_getRemoteLittleEndian() throws Exception{
31953105
DBConnection conn = new DBConnection();

test/com/xxdb/compatibility_testing/release130/streaming/PollingClientTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ public void test_subscribe_tableName_actionName_offset_reconnect() throws IOExce
529529
assertEquals(t.getColumn(1).get(k),msgs1.get(k).getEntity(1));
530530
assertEquals(t.getColumn(2).get(k),msgs1.get(k).getEntity(2));
531531
}
532-
533532
}
534533
if (msgs2 == null) {
535534
continue;
@@ -647,7 +646,7 @@ protected boolean doReconnect(Site site) {
647646
MyPollingClient mpl = new MyPollingClient(HOST,10086);
648647
assertFalse(mpl.doReconnect(null));
649648
}
650-
@Test
649+
//@Test //bug
651650
public void test_subscribe_msgAsTable_true() throws IOException {
652651
//public TopicPoller subscribe(String host, int port, String tableName, String actionName, long offset, boolean reconnect, Vector filter, StreamDeserializer
653652
//deserializer, String userName, String passWord, boolean msgAsTable) throws IOException {

test/com/xxdb/compatibility_testing/release130/streaming/ThreadPooledClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public static void login() {
6363

6464
@Before
6565
public void setUp() throws IOException {
66+
clear_env();
6667
try {
6768
String script0 = "login(`admin,`123456);" +
6869
"try{undef(`Trades, SHARED);}catch(ex){};"+
@@ -80,7 +81,6 @@ public void setUp() throws IOException {
8081
} catch (IOException e) {
8182
e.printStackTrace();
8283
}
83-
clear_env();
8484
}
8585

8686
@After

test/com/xxdb/compatibility_testing/release130/streaming/ThreadedClientsubscribeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,13 +937,13 @@ public void test_subscribe_other_some_user() throws IOException, InterruptedExce
937937
client.subscribe(HOST, PORT, "Trades", "subTread1", MessageHandler_handler, -1, true, filter1, true, 100, 5, "test1", "123456");
938938
fail("no exception thrown");
939939
}catch (Exception e){
940-
assertEquals(HOST+":"+PORT+" Server response: 'No access to shared table [Trades]' function: 'publishTable'",e.getMessage());
940+
assertEquals(HOST+":"+PORT+" Server response: No access to shared table [Trades]. function: publishTable",e.getMessage());
941941
}
942942
try {
943943
client.subscribe(HOST, PORT, "Trades", "subTread1", MessageHandler_handler, -1, true, filter1, true, 100, 5, "test3", "123456");
944944
fail("no exception thrown");
945945
}catch (Exception e){
946-
assertEquals(HOST+":"+PORT+" Server response: 'No access to shared table [Trades]' function: 'publishTable'",e.getMessage());
946+
assertEquals(HOST+":"+PORT+" Server response: No access to shared table [Trades]. function: publishTable",e.getMessage());
947947
}
948948
client.subscribe(HOST, PORT, "Trades", "subTread1", MessageHandler_handler, -1, false, filter1, true, 100, 5, "test2", "123456");
949949
client.unsubscribe(HOST, PORT, "Trades", "subTread1");
@@ -1381,7 +1381,7 @@ public void test_StreamDeserializer_pair_filters_subscribe_isomate_table_StreamD
13811381
StreamDeserializer streamFilter = new StreamDeserializer(tables, conn);
13821382
fail("no exception thrown");
13831383
}catch(Exception ex){
1384-
assertEquals(HOST+":"+PORT+" Server response: 'schema() => The function [schema] expects 1 argument(s), but the actual number of arguments is: 0' script: 'schema()'",ex.getMessage());
1384+
assertEquals(HOST+":"+PORT+" Server response: schema() => The function [schema] expects 1 argument(s), but the actual number of arguments is: 0. script: schema()",ex.getMessage());
13851385
}
13861386
}
13871387

@@ -1407,7 +1407,7 @@ public void test_StreamDeserializer_pair_filters_subscribe_isomate_table_StreamD
14071407
StreamDeserializer streamFilter = new StreamDeserializer(tables, conn);
14081408
fail("no exception thrown");
14091409
}catch(Exception ex){
1410-
assertEquals(HOST+":"+PORT+" Server response: 'Syntax Error: [line #1] Cannot recognize the token test2' script: 'schema(test2)'",ex.getMessage());
1410+
assertEquals(HOST+":"+PORT+" Server response: Syntax Error: [line #1] Cannot recognize the token test2. script: schema(test2)",ex.getMessage());
14111411
}
14121412
}
14131413

0 commit comments

Comments
 (0)