RandomizedTesting

码农软件 · 软件分类 · 单元测试工具 · 2019-11-18 21:42:25

软件介绍

RandomizedTesting 是一个 JUnit 测试的扩展,封装了内置重复随机的测试和超时控制、参数工厂、线程执行组等等。

示例代码:

@ThreadLeakScope(Scope.TEST)
@ThreadLeakAction({Action.WARN, Action.INTERRUPT})
@ThreadLeakLingering(linger =1000)
publicstaticclassTheGoodBadAndUglyextendsRandomizedTest {
  @Test
  publicvoidgood() {
    // I do nothing and I'm good.
  }
 
  @Test
  @Repeat(iterations =10)
  publicvoidbad() {
    // I fail randomly, about 20% of the time.
    assertFalse(randomIntBetween(1,100) <=20);
  }
 
  @Test
  publicvoidugly() {
    // I start and abandon a thread which falls
    // outside the test's scope. The test will fail.
    newThread() {
      publicvoidrun() {
        RandomizedTest.sleep(5000);
      }
    }.start();
  }
}

本文地址:https://www.codercto.com/soft/d/19291.html

任性

任性

电子工业出版社 / 2015-10-1 / 49.00

《任性:互联网语言表达的调性和技巧》是一本深度介绍互联网调性的书,也是从社会化媒体运作的角度较为系统地讲解互联网语言表达的书,它以独特的视角,从技术、需求和表现形式三种驱动力展开,从理论、策略、方法、技巧、实践等角度详细解析了互联网表达的变化和社会媒体的运营。《任性:互联网语言表达的调性和技巧》适合互联网从业人员阅读。一起来看看 《任性》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具