我正在使用挂毯开发 Web 应用程序。我正在使用 junit 测试套件测试我的应用程序,并使用 ant build 生成战争文件和 html 报告。在我的 html 报告文件中,我有以下警告。
Multiple annotations found at this line:
- Attribute (width) is obsolete. Its use is discouraged in HTML5 documents.
- Attribute (cellpadding) is obsolete. Its use is discouraged in HTML5
documents.
- Undefined attribute value (0).
- Attribute (language) is obsolete. Its use is discouraged in HTML5 documents.
以下是我的测试和报告生成代码。
<target name="test" depends="compile" description="Running Test Suite">
<mkdir dir="${target.data.dir}"/>
<mkdir dir="${target.htmlreports.dir}"/>
<junit fork="no" haltonfailure="no" showoutput="yes" printsummary="true" >
<test name="${junit.class.name}" todir="${target.data.dir}"/>
<formatter type="brief" usefile="false"/>
<classpath refid="classpath.test"/>
<sysproperty key="ant.home" value="${ant.home}"/>
<formatter type="xml"/>
</junit>
<junitreport todir="${target.htmlreports.dir}">
<fileset dir="${target.data.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${target.htmlreports.dir}"/>
</junitreport>
</target>
这是我的 html 报告文件之一。
<html xmlns:lxslt="http://xml.apache.org/xslt" xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Unit Test Results: Summary</title>
<link rel="stylesheet" type="text/css" title="Style" href="stylesheet.css">
</head>
<body onload="open('allclasses-frame.html','classListFrame')">
<h1>Unit Test Results.</h1>
<table width="100%">
<tr>
<td align="left"></td><td align="right">Designed for use with <a href="http://www.junit.org/">JUnit</a> and <a href="http://ant.apache.org/">Ant</a>.</td>
</tr>
</table>
<hr size="1">
<h2>Summary</h2>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
<th>Tests</th><th>Failures</th><th>Errors</th><th>Success rate</th><th>Time</th>
</tr>
<tr valign="top" class="Pass">
<td><a title="Display all tests" href="all-tests.html">1</a></td><td><a title="Display all failures" href="alltests-fails.html">0</a></td><td><a title="Display all errors" href="alltests-errors.html">0</a></td><td>100.00%</td><td>0.070</td>
</tr>
</table>
<table border="0" width="95%">
<tr>
<td style="text-align: justify;">
Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
</td>
</tr>
</table>
<h2>Packages</h2>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
<th width="80%">Name</th><th>Tests</th><th>Errors</th><th>Failures</th><th nowrap>Time(s)</th><th nowrap>Time Stamp</th><th>Host</th>
</tr>
<tr valign="top" class="Pass">
<td><a href="./test/web/app/sampleApp/juint/package-summary.html">test.web.app.sampleApp.juint</a></td><td>1</td><td>0</td><td>0</td><td>0.070</td><td>2013-01-17T04:52:59</td><td>123456</td>
</tr>
</table>
</body>
</html>
请任何人说我怎样才能删除这个警告。