最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to run a set of tests on the result of an operation that is part of a parameterized test - Stack Overflow

programmeradmin0浏览0评论

In the process of running tests for an operation that involves the processing of an image, I want to have a parameterized test that loads an image and generates a new one. If that operation is successful (this "test" is written mainly to catch any exceptional issues), then I want to individually test different aspects of the result separately (e.g. component count, bit depth etc.) and those tests should succeed/fail independently.

Back in the days of JUnit 4, there were parameterized test classes that would do this. These are not available JUnit 5 :(

I suspect I could use nested tests, test instance lifecycle adjustments and/or custom ordering, but my experiments have so far failed. All tests always runs separately from all others. Only the report is different, in that it has a format describing a hierarchy.

Any suggestions, or should I just wait for parameterized containers and container templates?

Notes:

  • Obviously I shouldn't have to run the operation all over again for each of the sub-tests because it is already very resource-consuming.
  • Another thing is that I also need to control tests at the level of the initial operation by using "assumptions" to weed out cases that are to be ignored (e.g. unsupported source image types). That makes the top-level "setup" test control the sub-tests as well.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论