After you have set up your component tests, the next step is to run the tests.
在你设置好你的组件测试之后,下一步就是运行测试。
Next you'll execute the component tests that you have created for this new block of code.
下一步你可以执行为你的那部分新代码设计的组件测试。
Just as in component tests, a number of frameworks have been created to help facilitate these tests.
与在组件测试中一样,现在创建了大量的框架来为这些测试提供方便。
For example, the class shown in Listing 1 creates a TestSuite holding all component tests in the suite method.
例如,清单1中显示的类创建了一个TestSuite,其持有suite方法中所有的组件测试。
So, it turns out that your suite of unit tests is really a suite of unit tests, component tests, and system tests.
所以,您的单元测试套件就是名副其实的包括单元测试、组件测试和系统测试的套件。
To run these tests, you must define at least four Ant tasks: one for unit tests, another for component tests, and so on.
为运行这些测试,必需至少定义四个Ant任务:为单元测试定义一个,为组件测试定义一个,依此类推。
Moreover, you modify CruiseControl to only run your true unit tests on check-ins and component tests on an hourly basis.
不仅如此,您还修改了 CruiseControl,从而只在(代码)签入时运行真正的单元测试,并以小时为基础运行组件测试。
As you can see in Listing 3, my component tests can now rely on specific data residing in the database during their execution.
正如清单3所示,现在组件测试可在执行期间依赖驻留在数据库中的特定数据。
Using this technique, all unit tests will reside in a unit directory, all component tests in a component directory, and so on.
使用这项技术,所有的单元测试将驻留在一个unit目录中,所有的组件测试将驻留在一个component目录中,依此类推。
Because component tests deal with multiple layers of an architecture, they often deal with databases, file systems, network elements, etc.
由于组件测试处理一个架构的多个层次,所以它们经常用于处理数据库、文件系统、网络元素等。
Moreover, you now know after inspecting the tests that the reason the build takes three hours is that the majority of them are component tests.
不仅如此,在检查了这些测试后,您现在知道构建花了三个小时的原因是:绝大部分时间都被组件测试所占用。
This component tests the name of the item in the message, and sends it to the correct monitoring services (HammerMonitorService or SawMonitorService).
这个组件测试消息中的项目名,然后将它发送给正确的监测服务(HammerMonitorService或SawMonitorService)。
Once you start to use these helper frameworks to write tests, these tests start to become higher level ones that I tend to categorize as component tests.
一旦开始使用这些帮助框架来编写测试,这些测试就开始成为更高级别的测试,我把它们归类为组件测试。
Upon further inspection, it turns out that system tests can also be run hourly, so you create an additional task that runs component tests and system tests together.
在进一步检查之后,发现系统测试也可以按小时运行,所以您创建了一个将组件测试和系统测试一起运行的额外任务。
For example, I often employ the DbUnit framework to help manage a database so that my component tests can verify the functionality of code that relies on the database's data.
例如,我通常使用DbUnit框架来帮助管理数据库,以便组件测试可验证依赖数据库数据的代码功能。
In my case, I used the file in listing 4 to seed the database before running my component tests and then used the same file to indicate which data to delete from the database upon test completion.
在本文的例子中,将在运行组件测试前使用清单4中的文件在数据库中播种,然后使用相同的文件指示测试完成时从数据库中删除哪些数据。
Component tests are most commonly created and executed by developers.
组件测试通常是由开发人员来建立并执行。
Component tests take longer to write because they're more involved than unit tests.
编写组件测试要花更长的时间,因为它们比单元测试所涉及的东西要多。
Component tests are essentially tests that verify more than one class and, typically, rely on external dependencies such as a database.
组件测试是基本的测试,这些测试将验证不止一个类,且通常依赖于外部依赖项,如数据库。
Component tests are essentially tests that verify more than one class and, typically, rely on external dependencies such as a database.
组件测试是基本的测试,这些测试将验证不止一个类,且通常依赖于外部依赖项,如数据库。
应用推荐