当前位置 : 主页 > 网络安全 > 测试自动化 >

Junit4测试报错

来源:互联网 收集:自由互联 发布时间:2021-06-19
1、字符串数组越界 java.lang.String IndexOutOfBounds Exception:String index out of range:-1 导致: Transaction rolled back because it has been marked as rollback-only. 分析原因: String[] params = new String[2]; params[0] =

1、字符串数组越界

  java.lang.String IndexOutOfBounds Exception:String index out of range:-1

  导致:

   Transaction rolled back because it has been marked as rollback-only.

 

分析原因:

    String[] params = new String[2];

    params[0] = date;

    params[1] = code;

    int num = getSql(sb.toString(),params);

 

2、数据传输异常

    java.lang.AssertionError:expected:<5> but was :<12>

 

3、比较失败异常

    org.junit.ComparisonFailure:expected : <2014022[1]> but was :<2014022[0] 

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

网友评论