`

@Test的timeout属性

阅读更多
   当我们测试一个方法时,也许它是一个死循环,这样就永远执行不完了,而且可能会导致我们的系统死机,
这个时候,我们可以通过一个@Test 的参数timeout来设置运行时间,即可以限定该方法的最大运行时间,
如果运行超过了该时间,那么就认为测试是失败的。格式如下:




@Test(timeout = 1000)
public void xxxx() {
  .......
}
分享到:
评论

相关推荐

    Ajax完全自学手册(PPT)

    Test4Timeout.htm 时间间隔和暂停 Test4History.htm 浏览器历史 Test4location.htm locatio对象 第3章 XMLHttpRequest对象 3.1.3 最简单的Ajax示例 第4章 DOM基础及高级DOM技术 柳州龙腾.xml XML-无限...

    Ajax完全自学手册(源代码).rar

    Test4Timeout.htm 时间间隔和暂停 Test4History.htm 浏览器历史 Test4location.htm locatio对象 第3章 XMLHttpRequest对象 3.1.3 最简单的Ajax示例 第4章 DOM基础及高级DOM技术 柳州龙腾.xml XML-无限...

    Ajax完全自学手册PPT和源代码(ptt格式)

    Test4Timeout.htm 时间间隔和暂停 Test4History.htm 浏览器历史 Test4location.htm locatio对象 第3章 XMLHttpRequest对象 3.1.3 最简单的Ajax示例 第4章 DOM基础及高级DOM技术 柳州龙腾.xml XML-无限数据传输 ...

    Loadrunner报错日志

    Action.c(13):错误-27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this ...

    java8源码-springboot:弹簧靴

    java8 ...connection-timeout: 5000 #开发环境设置false(这样改动前段不需重启应用了),生产去掉该配置,使用默认的true thymeleaf: cache: false #request before '/static/**' will control with

    java8源码-springboot-mybatis-demo01:springboot-mybatis-demo01

    java8 ...connection-timeout: 5000 #开发环境设置false(这样改动前段不需重启应用了),生产去掉该配置,使用默认的true thymeleaf: cache: false #request before '/static/**' will control with

    java8源码-springboot-mybatis-demo02:springboot-mybatis-demo02

    java8 ...connection-timeout: 5000 #开发环境设置false(这样改动前段不需重启应用了),生产去掉该配置,使用默认的true thymeleaf: cache: false #request before '/static/**' will control with

    jpivot学习总结.doc

    levelType 该 Level 的类型,默认为 regular (正常的),如果你在其 Dimension 属性 type 里选择了 TimeDimension 那么这里就可以选择 TimeYears 、 TimeQuarters 、 TimeMonth 、 TimeWeeds 、 TimeDays 。...

    测试培训教材

    You create a system test by adding a system test to the test plan tree, defining the test, and adding the test to a test set. Note: To run a system test, you must install the System Test Remote Agent...

    IO输入输出留

    System.out.println("获得最后一次修改时间:"+f.lastModified()); System.out.println("文件字节量:"+f.length()); System.out.println("是否是目录:"+f.isDirectory()); System.out.println("是否是文件...

    jquery-1.1.3 效率提高800%

    // the options for this ajax request }timeout 数据类型: Number 如果通过$.ajaxSetup设置了一个全局timeout,那么此函数使用一个局部timeout覆盖了全局timeout(单位为毫秒)。例如,你可以设置比较长的...

    J2EE面试题

    <session-timeout>30</session-timeout> 对于以下描述,正确的是: b a) 定义了默认的会话超时时长。时长为30秒。 b) 可以使用HttpSession接口的getMaxInactiveInterval()方法把该值取出来。 c) 定义了...

    freemarker总结

    如: sequence里面放入的是10 个user对象,user对象里面包含name,age等属性 sequence?sort_by(name) 表示所有的user按user.name进行排序 hashes内置方法 hash?keys 返回hash里的所有keys, 返回结果类型sequence hash...

    经典SQL语句大全

    select * from table1 where time between time1 and time2 select a,b,c, from table1 where a not between 数值1 and 数值2 9、说明:in 的使用方法 select * from table1 where a [not] in (‘值1’,’值2’,’值...

    数据库操作语句大全(sql)

    select * from table1 where time between time1 and time2 select a,b,c, from table1 where a not between 数值1 and 数值2 9、说明:in 的使用方法 select * from table1 where a [not] in (‘值1’,’值2’,’...

    ajax经典怎样传输数据

    timeout: 1000, // 设置请求超时时间 success: function(xml) { // 请求成功后回调函数 参数:服务器返回数据,数据格式. $("#users").empty(); // 用Jquery处理xml数据 $(xml).find('Table').each(function() {...

    sql经典语句一部分

    select * from table1 where time between time1 and time2 select a,b,c, from table1 where a not between 数值1 and 数值2 9、说明:in 的使用方法 select * from table1 where a [not] in (‘值1’,’值2’,’值...

    tomcat环境变量配置

    System.out.println("This is a test program."); } } 将上面的这段程序保存为文件名为Test.java的文件。 然后打开命令提示符窗口,cd到你的Test.java所在目录,然后键入下面的命令 javac Test.java java Test ...

    ThinkPHP3.2 集成 php-resque: PHP Resque Worker

    set_time_limit(0); // 定义应用目录 define('APP_PATH','./Application/'); define('MODE_NAME', 'cli'); // 自定义cli模式 define('BIND_MODULE', 'Home'); // 绑定到Home模块 define('BIND_CONTROLLER'...

Global site tag (gtag.js) - Google Analytics