unit-tests.xml.svn-base

来自「cqME :java framework for TCK test.」· SVN-BASE 代码 · 共 174 行

SVN-BASE
174 行
字号
<?xml version="1.0"?><!--  $Id$  Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER  This program is free software; you can redistribute it and/or  modify it under the terms of the GNU General Public License version  2 only, as published by the Free Software Foundation.  This program is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  General Public License version 2 for more details (a copy is  included at /legal/license.txt).  You should have received a copy of the GNU General Public License  version 2 along with this work; if not, write to the Free Software  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA  Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa  Clara, CA 95054 or visit www.sun.com if you need additional  information or have any questions.--><project name="unit-tests">    <property name="unit.tests.dir"        location="${basedir}/unitTests/classes"/>    <property name="unit.tests.build.dir"  location="${build}/unitTestsBuild/classes"/>    <property name="unit.tests.jar"        location="${dist}/unit.tests.jar"/>    <!-- Report dirs -->    <property name="unit.tests.reports.dir"        location="${dist}/unitTests-reports"/>    <property name="unit.tests.html.reports.dir"        location="${unit.tests.reports.dir}/html"/>    <property name="unit.tests.xml.reports.dir"        location="${unit.tests.reports.dir}/xml"/>    <property name="unit.tests.html.report.file"        location="${unit.tests.html.reports.dir}/index.html"/>    <property         name="unit.tests.properties"        location="${unit.tests.build.dir}/com/sun/tck/unitTests/unit.tests.properties"/>    <target name="init">        <path id="class.path.for.unit.tests">            <pathelement location="${javatest.jar}"/>            <pathelement location="${jckutils.jar}"/>            <pathelement location="${unit.tests.jar}"/>            <pathelement path="                ${j2mefw_jt.jar}:                ${JAVAHELP_JAR}:                ${jkssigner.jar}:                ${midp_httpsrvr.jar}:                ${j2me_messaging.jar}:                ${j2me_communication.jar}:                ${j2me_commClients.jar}:                ${j2me_httpCommServer.jar}:                ${midp_agent.jar}:                ${client.jar}:                ${datagram_commServer}:                ${datagram_commClient}:                ${main_agent.jar}"/>         </path>        <property name="class.path.for.unit.tests" refid="class.path.for.unit.tests"/>        <mkdir dir="${unit.tests.build.dir}"/>        <!-- Clean previous reports first -->        <delete dir="${unit.tests.html.reports.dir}"/>        <delete dir="${unit.tests.xml.reports.dir}"/>        <delete dir="${unit.tests.reports.dir}"/>        <mkdir dir="${unit.tests.reports.dir}"/>        <mkdir dir="${unit.tests.html.reports.dir}"/>        <mkdir dir="${unit.tests.xml.reports.dir}"/>    </target>    <target name="unit-tests" depends="init, unit-tests.init, dist-framework"        description="Executes all unit tests. (Use with -Dtestcase=TestName to run single test).">      <echo message="Classpath: ${class.path.for.unit.tests}"/>      <javac srcdir="${unit.tests.dir}"            destdir="${unit.tests.build.dir}"            debug="on"            source="1.5">        <classpath>            <path refid="class.path.for.unit.tests"/>        </classpath>      </javac>    <copy todir="${unit.tests.build.dir}">      <fileset dir="${unit.tests.dir}">        <include name="**/*.properties"/>      </fileset>    </copy>    <javac srcdir="${src}/share/classes"            includes="com/sun/tck/j2me/services/commService/clients/J2SEHTTPCommClient.java"            destdir="${unit.tests.build.dir}"            debug="on"            source="1.4">        <classpath>            <path refid="class.path.for.unit.tests"/>        </classpath>    </javac>    <propertyfile file="${unit.tests.properties}" comment="Unit Test Suite Properties">        <entry key="TCK_ROOT" value="${tckdir}"/>        <entry key="MAIN_JTI" value="${MAIN_JTI}"/>    </propertyfile>        <jar jarfile="${unit.tests.jar}" basedir="${unit.tests.build.dir}"        includes="**/*.class **/*.properties"        filesonly="yes"/>    <echo message="Starting Unit Tests..."/>    <junit fork="yes" forkmode="once" haltonfailure="no"        printsummary="no" tempdir="${build}"         failureproperty="unit.tests.failed">        <jvmarg value="-ea"/>        <jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma"/>        <classpath>            <path refid="class.path.for.unit.tests"/>            <path refid="coverage.lib"/>        </classpath>        <formatter type="brief" usefile="no"/>        <formatter type="xml" usefile="yes"/>        <test            name="${testcase}"             fork="yes"             todir="${unit.tests.xml.reports.dir}"             if="testcase"/>        <batchtest             fork="yes"             todir="${unit.tests.xml.reports.dir}"            unless="testcase">            <fileset dir="${unit.tests.dir}">                <include name="**/*Test*.java"/>                <exclude name="**/AllTests.java"/>                <exclude name="com/sun/tck/unitTests/lib/**.java"/>            </fileset>        </batchtest>    </junit>    <junitreport todir="${unit.tests.reports.dir}">        <fileset dir="${unit.tests.xml.reports.dir}">            <include name="TEST-*.xml"/>        </fileset>        <report format="frames" todir="${unit.tests.html.reports.dir}"/>       </junitreport>    <echo/>    <echo message="Unit Tests Results are here:"/>    <echo message="${unit.tests.html.report.file}"/>    <!-- If some tests failed and we're not calculating         coverage, then the build must fail -->    <condition property="terminate.build">      <and>        <isset property="unit.tests.failed"/>        <not>          <isset property="coverage.enabled"/>        </not>      </and>    </condition>    <fail message="Some Tests Failed!!!" if="terminate.build"/>  </target></project>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?