简体   繁体   English

是否有类似于Integration-Test的集成前和集成后测试的类名称约定

[英]Is there any class name conventions for pre-integration-test and post-integration-test similar to integration-test

For junit test cases The class should be named like XXTest.java 对于junit测试用例,该类的名称应类似于XXTest.java。

For intergation-test the class should be named like XXIT.java 对于集成测试,该类的名称应类似于XXIT.java。

Is there any class name conventions for pre-integration-test and post-integration-test goals in maven similar to unit and integration test? 在Maven中是否有任何类似于集成测试和集成测试目标的类名称约定?

The convention is that no tests of any kind are run during pre- and post-integration-test. 约定是在集成前和集成后测试期间不运行任何类型的测试。

As suggested by @biziclop, the way to think about this is "pre-X" and "post-X" - these are things executed before/after "X". 正如@biziclop所建议的那样,对此进行思考的方式是“ X之前”和“ X之后”-这些是在“ X”之前/之后执行的事情。 So, pre-integration-test phase is not the phase where "pre-integration" tests are run, but rather it is the phase before "integration-test" is run. 因此,集成前测试阶段不是运行“集成前”测试的阶段,而是运行“集成测试”之前的阶段。

These goals are usually used for managing system state for the running of integration tests. 这些目标通常用于管理系统状态以运行集成测试。 For example, pre-integration-test may start a container that is used by the integration tests, while post-integration-test will stop the container. 例如,集成前测试可能会启动集成测试所使用的容器,而集成后测试则会停止该容器。

There is nothing wrong with using a variety of plugins and/or custom code to support the execution of your integration tests. 使用各种插件和/或自定义代码来支持集成测试的执行没有错。 If using exec-maven-plugin really bothers you, you can always create your own maven plugin that knows about whatever naming convention you want to use to find java classes in your build and execute them. 如果使用exec-maven-plugin确实使您感到困扰,那么您始终可以创建自己的maven插件,该插件知道要用于在构建中查找Java类并执行它们的命名约定。 Then each of your modules can use the generic plugin to invoke the specific set of classes to do the setup/tear-down. 然后,您的每个模块都可以使用通用插件来调用特定的类集以进行设置/拆卸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM