1 Star 0 Fork 2

周周/vertx-examples

forked from githubsync/vertx-examples 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.adoc 1.38 KB
一键复制 编辑 原始数据 按行查看 历史

Vert.x Unit examples

Here you’ll find some examples of how to use Vert.x unit to test your asynchronous applications.

Tests are located in the link:src/test/java/io/vertx/example/unit/test directory.

Examples can be run directly from the IDE.

Vertx Unit Test

The link:src/test/java/io/vertx/example/unit/test/VertxUnitTest.java demonstrates how the Vert.x Unit API can be used to run tests using the Vert.x Unit test runner.

Run this example by running the main method.

Junit

Vert.x Unit can be used with Junit:

  • link:src/test/java/io/vertx/example/unit/test/MyJunitTest.java demonstrates how to use the Vert.x Unit Junit runner to execute your tests

  • link:src/test/java/io/vertx/example/unit/test/ParameterizedTest.java demonstrates how to inject parameters into your Junit tests

  • link:src/test/java/io/vertx/example/unit/test/RunOnContextTest.java demonstrates how to delegate Vert.x instance creation to Vert.x Unit and how to use a rule to run the test methods on the event loop (caution: they must be non-blocking)

  • link:src/test/java/io/vertx/example/unit/test/JUnitAndAssertJTest.java demonstrates how to use AssertJ in combination with Vert.x Unit

  • link:src/test/java/io/vertx/example/unit/test/JUnitAndHamcrestTest.java demonstrates how to use Hamcrest in combination with Vert.x Unit

All the tests can be run from your IDE, or directly with Maven:

mvn clean test
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhouzq2046/vertx-examples.git
git@gitee.com:zhouzq2046/vertx-examples.git
zhouzq2046
vertx-examples
vertx-examples
4.x

搜索帮助