1 <?xml version="1.0" encoding="UTF-8"?>
   2 <!--  
   3 /*
   4  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6  *
   7  * This code is free software; you can redistribute it and/or modify it
   8  * under the terms of the GNU General Public License version 2 only, as
   9  * published by the Free Software Foundation. Oracle designates this
  10  * particular file as subject to the "Classpath" exception as provided
  11  * by Oracle in the LICENSE file that accompanied this code.
  12  *
  13  * This code is distributed in the hope that it will be useful, but WITHOUT
  14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  16  * version 2 for more details (a copy is included in the LICENSE file that
  17  * accompanied this code).
  18  *
  19  * You should have received a copy of the GNU General Public License version
  20  * 2 along with this work; if not, write to the Free Software Foundation,
  21  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22  *
  23  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24  * or visit www.oracle.com if you need additional information or have any
  25  * questions.
  26  */
  27 -->
  28 <project name="ControlsTests" default="default" basedir="."
  29          xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:fx="javafx:com.sun.javafx.tools.ant">
  30     <description>Builds, tests, and runs the project ControlsTests.</description>
  31 
  32     <import file="../../tools/SharedTestUtilsOpen/image-utils.xml"/>  
  33     <import file="../../tools/FxTestRunner/javatest_fx.xml"/>
  34     <import file="../../tools/FxTestRunner/run_javatest_macro.xml"/>
  35     <import file="../../tools/FxTestRunner/plugin_support.xml"/>
  36 
  37     <condition property="external.output" value="${external.output}" else="${basedir}/..">
  38         <isset property="external.output"/>
  39     </condition>
  40 
  41     <property name="image.properties" location="${basedir}/image.properties"/> 
  42     <property name="test.sources" value="test"/>
  43 
  44     <target name="-pre-init" unless="no.need.to.find.java.fx">
  45         <ant antfile="../../detect_javafx-nb.xml" inheritall="true">
  46             <property name="basedir" location="${basedir}/../.."/>
  47             <property name="property.file" value="${basedir}/nbproject/private/private.properties"/>
  48         </ant>
  49     </target>
  50 
  51     <import file="nbproject/build-impl.xml"/>    
  52 
  53     <target name="test-dir" depends="init, compile-test,-pre-test-run" if="have.tests">
  54         <fail unless="test.subdir">Must set test.subdir with short name of root dir of tests; eg ListView</fail>
  55         <j2seproject3:junit testincludes="javafx/scene/control/test/${test.subdir}/**/*Test.java"/>
  56     </target>
  57 
  58     <!-- javatest support -->
  59     <target name="javatest" depends="compile, compile-test, run-manual"/>
  60     <target name="run-manual" depends="init,dojavatest"/>
  61         <target name="run-automated" depends="-post-jar, javatest-automated"/>
  62         <target name="run-automated-nobuild" depends="init, dist-plugin, javatest-automated"/>
  63     <target name="-post-jar" depends="compile-test, dist-plugin"/>
  64 
  65     <!--    Prepare jars for manual testing -->
  66     <target name="-post-compile-test" depends="manual-jars" />
  67     <property name="content.dir" value="${basedir}/content" />
  68     <target name="manual-jars" depends="init">
  69         <echo message="FX-ANT=${file.reference.ant-javafx.jar}" />
  70 
  71         <condition property="file.reference.ant-javafx.jar" value="${javafx.home}/../lib/ant-javafx.jar" else="${javafx.rt}/../lib/ant-javafx.jar">
  72             <isset property="javafx.home"/>
  73         </condition>
  74         <echo message="debug: file.reference.ant-javafx.jar = ${file.reference.ant-javafx.jar}"/>
  75 
  76         <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
  77                  uri="javafx:com.sun.javafx.tools.ant"
  78                  classpath="${file.reference.ant-javafx.jar}"/>
  79                 
  80         <fx:jar destfile="${content.dir}/source.jar">
  81             <application mainClass="javafx.draganddrop.DragDropWithControls" name="DragAndClipboard"  />
  82             <fileset dir="${build.classes.dir}">
  83                 <include name="javafx/**" />
  84             </fileset>
  85             <fileset dir="${build.test.classes.dir}"/>
  86             <manifest>
  87                 <attribute name="Implementation-Vendor" value="Oracle"/>
  88                 <attribute name="Implementation-Title" value="FXSQE Manual Test"/>
  89                 <attribute name="Implementation-Version" value="1.0"/>
  90             </manifest>
  91             <fx:resources>
  92                 <fx:fileset dir="${content.dir}" includes="SharedTestUtilsOpen.jar"/>
  93                 <fx:fileset dir="${content.dir}" includes="JemmyAWTInput.jar"/>
  94                 <fx:fileset dir="${content.dir}" includes="JemmyCore.jar"/>
  95                 <fx:fileset dir="${content.dir}" includes="JemmyFX.jar"/>
  96             </fx:resources>
  97         </fx:jar>
  98         <copy file="../../tools/SharedTestUtilsOpen/dist/SharedTestUtilsOpen.jar" tofile="${content.dir}/SharedTestUtilsOpen.jar"/>               
  99         <copy file="../../tools/Jemmy/jemmy_core/JemmyAWTInput.jar"               tofile="${content.dir}/JemmyAWTInput.jar"/>
 100         <copy file="../../tools/Jemmy/jemmy_core/JemmyCore.jar"                   tofile="${content.dir}/JemmyCore.jar"/>
 101         <copy file="../../tools/Jemmy/JemmyFX/dist/JemmyFX.jar"                   tofile="${content.dir}/JemmyFX.jar"/>
 102     </target>
 103         
 104     <target name="check-template" unless="template">
 105         <fail message="template variable must be set to merge"/>
 106     </target>
 107     <target name="feature-coverage-merge" depends="-post-compile-test, check-template">
 108         <java classname="com.oracle.jdk.sqe.cc.markup.Merger">
 109             <classpath>
 110                 <pathelement location="../../tools/TestMarkup/dist/TestMarkup.jar"/>
 111             </classpath>
 112             <arg line="-o"/>
 113             <arg line="${basedir}/result.fcov"/>
 114             <arg line="${template}"/>
 115             <arg line="${basedir}/coverage.fcov"/>
 116         </java>
 117         <java classname="com.oracle.jdk.sqe.cc.markup.Report">
 118             <classpath>
 119                 <pathelement location="../../tools/TestMarkup/dist/TestMarkup.jar"/>
 120             </classpath>
 121             <arg line="-o"/>
 122             <arg line="${basedir}/report.html"/>
 123             <arg line="${basedir}/result.fcov"/>
 124         </java>
 125     </target>
 126     <target name="-post-clean">  <!--  depends="delete-jcov" -->
 127         <delete dir="dist-plugin"/>
 128     </target>
 129 
 130 </project>