@@ -3100,96 +3100,6 @@ public void test_TryRun_args_fetchSize() throws IOException, InterruptedExceptio
3100
3100
assertTrue ((endDT -startDT )<(afterDT -beforeDT ));
3101
3101
}
3102
3102
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
-
3193
3103
@ Test
3194
3104
public void test_getRemoteLittleEndian () throws Exception {
3195
3105
DBConnection conn = new DBConnection ();
0 commit comments