TAILIEUCHUNG - Java Development with Ant phần 3

Chạy một trường hợp thử nghiệm từ dòng lệnh Sau khi dự án của bạn có một số lượng đủ lớn các trường hợp thử nghiệm, bạn có thể cần phải cô lập một trường hợp thử nghiệm duy nhất để chạy khi ủi ra một vấn đề cụ thể. Feat này có thể được thực hiện bằng cách sử dụng nếu / trừ khi các điều khoản trên | ones you do need to use these exact file names. To use your custom XSL files simply point the styledir attribute of the report element at them. Here we have a property that is set to the directory where the XSL files exist junitreport todir fileset dir include name TEST- .xml fileset report format frames styledir todir junitreport Run a single test case from the command-line Once your project has a sufficiently large number of test cases you may need to isolate a single test case to run when ironing out a particular issue. This feat can be accomplished using the if unless clauses on test and batchtest . Our junit task evolves again junit printsummary false errorProperty failureProperty classpath refid formatter type brief usefile false formatter type xml test name testcase todir if testcase batchtest todir unless testcase fileset dir includes batchtest junit By default testcase will not be defined the test will be ignored and batchtest will execute all of the test cases. In order to run a single test case run Ant using a command line like ant test -Dtestcase fully qualified classname Initializing the test environment There are a few steps typically required before running junit Create the directories where the test cases will compile to results data will be gathered and reports will be generated. Place any external resources used by tests into the classpath. Clear out previously generated data files and reports. Because of the nature of the junit task old data files should be removed prior to running the tests. If a test case is renamed or removed its results may still be present. The junit task simply generates results from the tests being run and does not concern itself with previously generated data files. Generating test result reports 103 Our test-init target is defined as target .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.