tailieunhanh - Java Extreme Programming Cookbook phần 3

Một stack của thẻ chỉ số, quét mã vạch một, hoặc thậm chí một mảnh giấy có thể phục vụ như một công cụ thiết kế hiệu quả đáng ngạc nhiên. Đây là quá trình: . 3. . Vẽ một sơ đồ. Viết một thử nghiệm đơn vị. Viết một số mã. Lặp lại các bước 2-3 cho đến khi tính năng được hoàn tất. Vứt bỏ sơ đồ. | Discussion In earlier examples we sent test results directly to the console. In order to format our results as HTML we need to first write the test results to a series of XML files. We do this with the following line formatter type xml This causes test results to go to a series of XML files one per test. The XML files are written to the directory named by the todir attribute of the junit task or the nested batchtest element. Once the files are created j unitreport uses XSLT stylesheets to convert the XML files into a nice HTML report. The complete Ant target is shown in Example 3-9. Example 3-9. Generating a test report target name junit depends compile junit printsummary on fork false haltonfailure false classpath refid -formatter type xml batchtest todir fileset dir include name Test .java fileset batchtest junit junitreport todir fileset dir -include name TEST- .xml fileset -report format frames todir junitreport -- convert an Ant path to a fully-qualified platform specific path -- pathconvert dirsep property reportUrl path pathelement location path pathconvert -- launch a web browser to view the results -- exec executable cmd os Windows XP arg value C arg value reportUrl -- the full path to the report -- exec target Our buildfile runs all tests in the src directory tree and then sends XML results to the build directory which was specified in the todir attribute of junitreport. After junitreport runs we launch a web browser to view the test results. This last portion of the example only works on Microsoft Windows. If you are on a different platform simply change the exec task to point to your browser. See Also The previous two recipes show other ways to run tests. Checking Out Code from CVS Problem You want your Ant buildfile to check out code from CVS before compiling. Solution Use Ant s cvs task. Discussion You can use the cvs Ant task

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.