Errors building flexunit tasks using ant


hi

i having trouble while trying run flexunit tests through ant script have searched on internet cannot find helpful. project using flash builder 4.6 , flex sdk 4.6.

ant version being used 1.8.4

 

i getting error when run ant script. below complete trace.

 

buildfile: c:\cygwin\home\admin\mca\apps\nac\build.xml

 

build:

 

clean:

      [delete] deleting directory c:\cygwin\home\admin\mca\apps\nac\release

 

init:

       [mkdir] created dir: c:\cygwin\home\admin\mca\apps\nac\build

        [copy] copying 2 files c:\cygwin\home\admin\mca\apps\nac\build

       [mkdir] created dir: c:\cygwin\home\admin\mca\apps\nac\release

 

compile:

       [mxmlc] loading configuration file c:\program files\adobe\adobe flash builder 4.6\sdks\4.6.0\frameworks\air-config.xml

       [mxmlc] c:\cygwin\home\admin\mca\apps\nac\build\nimbutas.swf (850356 bytes)

 

package:

 

cleanup:

      [delete] deleting directory c:\cygwin\home\admin\mca\apps\nac\build

 

test:

 

cleanflexunitreport:

        [echo] deleting flexunit report directory...

      [delete] deleting directory c:\cygwin\home\admin\mca\apps\nac\flexunitreports

        [echo] deleted flexunit report directory

        [echo] creating flexunit report directory...

       [mkdir] created dir: c:\cygwin\home\admin\mca\apps\nac\flexunitreports

        [echo] created flexunit report directory

 

cleantest:

        [echo] deleting test directory...

      [delete] deleting directory c:\cygwin\home\admin\mca\apps\nac\flexunittest

        [echo] deleted test directory

        [echo] creating test directory...

       [mkdir] created dir: c:\cygwin\home\admin\mca\apps\nac\flexunittest

        [echo] created test directory

 

compiletestrunner:

        [echo] compiling test runner swf test

       [mxmlc] loading configuration file c:\program files\adobe\adobe flash builder 4.6\sdks\4.6.0\frameworks\flex-config.xml

       [mxmlc] warning: source path entry, 'c:\cygwin\home\admin\mca\apps\nac\src\flexunittests\com\nimbutas', subdirectory of source path entry, 'c:\cygwin\home\admin\mca\apps\nac\src'.

       [mxmlc] required rsls:

       [mxmlc]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/framework_4.6.0.23201.swz 1 failover.

       [mxmlc]     http://fpdownload.adobe.com/pub/swz/tlf/2.0.0.232/textlayout_2.0.0.232.swz 1 failover.

       [mxmlc]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/spark_4.6.0.23201.swz 1 failover.

       [mxmlc]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/sparkskins_4.6.0.23201.swz 1 failover.

       [mxmlc]     http://fpdownload.adobe.com/pub/swz/flex/4.6.0.23201/mx_4.6.0.23201.swz 1 failover.

       [mxmlc] c:\cygwin\home\admin\mca\apps\nac\flexunittest\flexunitapplication.swf (352174 bytes)

        [echo] compiled test runner swf test

 

executetestrunner:

        [echo] running test runner swf

    [flexunit] validating task attributes ...

 

build failed

c:\cygwin\home\admin\mca\apps\nac\build.xml:24: following error occurred while executing line:

c:\cygwin\home\admin\mca\apps\nac\build.xml:31: following error occurred while executing line:

c:\cygwin\home\admin\mca\apps\nac\build.xml:151: java.lang.nullpointerexception

 

 

and here build.xml file

 

<?xml version="1.0" encoding="utf-8"?>

<project name="build file" basedir="." default="build">

 

    <!--location of property file -->

    <property file="${basedir}/build.properties" description="your specific properities builds" />

 

    <!-- additional tasks -->

    <taskdef name="mxmlc" classname="flex.ant.mxmlctask" classpath="${flex_tasks}"/>

    <taskdef name="compc" classname="flex.ant.compctask" classpath="${flex_tasks}"/>

    <taskdef name="asdoc" classname="flex.ant.asdoctask" classpath="${flex_tasks}"/>

    <taskdef resource="flexunittasks.tasks" classpath="${flexunittasks.file}"/>

    <!--

 

 

       build

 

 

   -->

 

    <target name="build" description="compiles application">

        <antcall target="init"/>

        <antcall target="package"/>

        <antcall target="cleanup"/>

        <antcall target="test"/>

    </target>

 

    <target name="test" description="compiles unit tests">

        <antcall target="cleanflexunitreport"/>

        <antcall target="cleantest"/>

        <antcall target="compiletestrunner"/>

        <antcall target="executetestrunner"/>

    </target>

 

    <target name="compile"

        description="compiles air application swf file , places swf in temp directory packaged.">

        <mxmlc file="${source_dir}/${app_name}.${app_extension}"

            output="${build_dir}/${app_name}.swf"

            locale="${locale}"

            static-rsls="true"

            accessible="true"

            configname="air"

            debug="${debug_flag}"

            failonerror="true"

            fork="true">

            <source-path path-element="${source_dir}"/>

            <source-path path-element="${basedir}/resources"/>

            <external-library-path file="${app_home}/libs/airglobal.swc" append="true"/>

            <library-path dir="${library_dir}" includes="*.swc" append="true"/>

        </mxmlc>

    </target>

 

    <target name="certificate" unless="certificate_flag">

        <java jar="${adt}" fork="true"

            failonerror="true">

            <arg value="-certificate"/>

            <arg value="-cn"/>

            <arg value="${cert_name}"/>

            <arg value="-ou"/>

            <arg value="${cert_org_unit}"/>

            <arg value="-o"/>

            <arg value="${cert_org_name}"/>

            <arg value="-c"/>

            <arg value="${cert_country}"/>

            <arg value="${cert_key_type}"/>

            <arg value="${keystore}"/>

            <arg value="${cert_password}"/>

        </java>

    </target>

 

    <target name="package" depends="compile"

        description="packages build swf file temp directory.">

        <java jar="${adt}" fork="true"

            failonerror="true">

            <arg value="-package"/>

            <arg value="-tsa" />

            <arg value="http://ca.signfiles.com/tsaserver.aspx" />

            <arg value="-storetype"/>

            <arg value="${storetype}"/>

            <arg value="-keystore"/>

            <arg value="${keystore}"/>

            <arg value="-storepass"/>

            <arg value="${cert_password}"/>

            <arg value="${release_dir}/${app_name}.air"/>

            <arg value="${source_dir}/${app_name}-app.xml"/>

            <arg value="-c"/>

            <arg value="${build_dir}"/>

            <arg value="${build_dir}/${app_name}.swf"/>

            <arg value="${build_dir}/doorbell-old-tring.mp3"/>

            <arg value="${build_dir}/us_ringback_tone.mp3"/>

        </java>

    </target>

 

    <target name="init" depends="clean"

    description="cleans deploy file">

        <mkdir dir="${build_dir}"/>

        <copy todir="${build_dir}">

            <fileset dir="${basedir}/resources"/>

          </copy>

        <mkdir dir="${release_dir}"/>

        <available file="${keystore}" property="certificate_flag"/>

    </target>

 

    <!-- start of flex unit tests -->

    <target name="cleanflexunitreport" description="cleans report file">

            <echo>deleting flexunit report directory...</echo>

            <delete dir="${flexunitreport.dir}" failonerror="false"

                includeemptydirs="true" />

            <echo>deleted flexunit report directory</echo>

            <echo>creating flexunit report directory...</echo>

            <mkdir dir="${flexunitreport.dir}" />

            <echo>created flexunit report directory</echo>

        </target>

 

    <target name="cleantest" description="cleans test file">

        <echo>deleting test directory...</echo>

        <delete dir="${test.dir}" failonerror="false"

            includeemptydirs="true" />

        <echo>deleted test directory</echo>

        <echo>creating test directory...</echo>

        <mkdir dir="${test.dir}" />

        <echo>created test directory</echo>

    </target>

 

    <target name="compiletestrunner">

            <echo>compiling test runner swf test</echo>

            <mxmlc file="${testrunnersrc.dir}/${testrunner.name}.mxml"

                output="${test.dir}/${testrunner.name}.swf"

                debug="true">

                <load-config filename="${flex_home}/frameworks/flex-config.xml"/>

 

                <compiler.source-path path-element="${source_dir}/flexunittests/com/nimbutas" />

 

                <compiler.library-path dir="${testrunnerlib.dir}" append="true">

                    <include name="*.swc"/>

                </compiler.library-path>

 

                <compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>

                <compiler.headless-server>true</compiler.headless-server>

            </mxmlc>

            <echo>compiled test runner swf test</echo>

        </target>

 

 

    <target name="executetestrunner" description="executes test runner app">

            <echo>running test runner swf</echo>

            <flexunit

                todir="${flexunitreport.dir}"

                haltonfailure="true"

                verbose="true"

                player="air"

                headless="false"/>

            <echo>ran test runner swf</echo>

 

            <echo>generate readable tests</echo>

            <junitreport todir="${flexunitreport.dir}">

                <fileset dir="${flexunitreport.dir}">

                    <include name="test-*.xml"/>

                </fileset>

                <report format="frames" todir="${flexunitreport.dir}/html"/>

            </junitreport>

            <echo>generated readable tests</echo>

        </target>

    <!-- end of flex unit tests -->

 

    <target name="clean"

        description="cleans old files.">

        <delete dir="${build_dir}" failonerror="false" includeemptydirs="true" />

        <delete dir="${release_dir}" failonerror="false" includeemptydirs="true" />

    </target>

 

    <target name="cleanup"

        description="cleans old files.">

        <delete dir="${build_dir}" failonerror="false" includeemptydirs="true" />

    </target>

 

</project>

hi,

 

think there internet connection problem in case hence build not getting required files while running. error got rectified downloading swc's , putting in thirdpartylib folder in build directory. , giving path in build.xml  thirdpartylib.

 

this how got worked may wrong, other experts on forum can shed light on this.

 

thanks

mayank



More discussions in Archived Spaces


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support