Test configurations for the JBUILDER2005 unit Test experience

Source: Internet
Author: User
Tags window
In the final step of the Test Case Wizard, you are allowed to create a run configuration entry for a test case, as shown in the following illustration:


Wrong figure! Text with no specified style in the document. To create a run test item

In general, you do not have to create a separate run configuration entry for each test case class, and JBuilder runs the test case with the default run configuration.

Test run Configuration items allow you to make special customizations when you need to specify a different test run (the default is Jbtestrunner) and run multiple test cases at a time. By Project->project Properties...->run, all of the project's defined run configuration items are listed in the Run Settings page, Runtime The Run configuration item in the configurations list with type test is the test run configuration item and can be passed to the right of the dialog box, edit ... button to edit these run configuration items as shown in the following illustration:


Wrong figure! Text with no specified style in the document. Run the configuration page list

Next, we'll create a new run configuration item named Testalldbtest. Run the test case with the Junit.swingui.TestRunner test run provided by JUnit, so that all test case classes that start with testing are run under the Chapter25.db package.

Error in Figure! text with no specified style in document。 Click New ... button, pop-up the new Runtime Configuration dialog box, as shown in the following figure


Wrong figure! Text with no specified style in the document. Testsubsection Run

Fill in the Testalldb in name. Select Test in type, and the lower window of the dialog box adjusts to the interface for the test run configuration. The default class Radio box is selected to allow you to specify a test case class, because we want to run all the test cases under the CHAPTER25.DB package through this configuration item, so we select the Package checkbox and pass the following ... button to select the Chapter25.db package.

Fill in the name starts with test, which runs all classes with the class name prefixed with test, and you can also specify the class name suffix in the name ends with.

Attention:

Note that if the package has a non test case class that starts with test, the test run configuration entry will throw an error, especially if the test suite prefixed with test is not allowed, and the class that satisfies the filter condition must be a test case class.

There are 3 test runs in the beta Runner, JBuilder test Runner, JUnit Swingui test Runner
and JUnit Testui Test Runner. The default is JBuilder Test Runner, also known as Jbtestrunner, which is the most powerful function of the runtime. For a curious developer, it may be desirable to look at the hosting of JUnit's own runtime, and one of them, so here we choose JUnit Swingui Test Runner.

For additional settings for the New Runtime Configuration dialog box, the Help button is available for JBuilder.

After completing the setup of the TESTADDDB run configuration item, click the down arrow to the right of the icon in the toolbar and select Testadddb in the pop-up menu, as shown in the following image:


Wrong figure! Text with no specified style in the document. Run a test case from a test run configuration item

Click the TESTALLDB entry, JBuilder uses JUnit's junit.swingui.TestRunner to run the Testemployeedao and testemployee two test case classes in the Chapter25.db package, because both use case classes begin with Test, and the runtime window looks like this:


Wrong figure! Text with no specified style in the document. Junit.swingui.TestRunner Test Run

The Testemployeedao and testemployee two test case classes are listed in the Testing Hierarchy tab, so you can achieve similar results with test suites by testing run configuration items, and of course there is no way to achieve the flexibility of the test suite. Assuming that the test case naming is irregular or there is a filtering conflict, the test suite has to be invoked.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.