ANT and LISA Test Configurations

  1. Set environment variable 
    1. ANT_HOME = C:\apps\apache-ant-1.9.2 (As per your installation structure)
    2. LISA_HOME = C:\Lisa_7.1.0.1043 (As per your installation structure)
    3. JAVA_HOME = C:\Program Files\Java\jdk1.7.0_45 (As per your installation structure)
    4. PATH = ;C:\Lisa_7.1.0.1043\bin; C:\apps\apache-ant-1.9.2\bin (append in path variable) 
  2. Copy ant-junit-1.7.1.jar and junit-4.11.jar jar to C:\Lisa_7.1.0.1043\lib directory
  3. Create build.properties file and set below mention properties
    # This is the properties file defining build properties for ant tasks
    LISA_HOME=C:/Lisa_7.1.0.1043
    vs.sandbox.registry.url=tcp://sandbox:2010/Registry
    vs.sandbox.vse.name=sandbox
    vs.project.name=sandbox_soap
    vs.project.version=v1.0
    vs.project.path=workspace/sandbox_soap
    vs.project.test.suite.dir=${vs.project.build.dir}/${vs.project.path}/Suites/AllTestsSuite.ste
    vs.project.build.dir=${basedir}/build/
    vs.project.build.report.dir=${vs.project.build.dir}/report/
    vs.project.build.temp.dir=${basedir}/build/tmp
  4. Create AntTasks.properties file and set below mention properties
    # This is the properties file defining LISA's custom ant tasks
    junitlisa=com.itko.lisa.ant.JUnitLisaTask
    junitlisareport=com.itko.lisa.ant.JUnitLisaReportTask
  5. Create below build.xml file 
    <?xml version="1.0"?>
    <project name="${projectName}" default="lisaTests" basedir=".">
    <loadproperties>
    <filefile="build.properties"/>
    </loadproperties>
     <taskdef resource="AntTasks.properties">
    <classpath>
    <filesetdir="${LISA_HOME}/bin">
    <include name="lisa-modules.jar"/>
    <include name="lisa-core.jar"/>
    <include name="lisa-annotations.jar"/>
    </fileset>
    <filesetdir="${LISA_HOME}/lib">
    <include name="lisa-core.jar"/>
    <include name="_misc-modules.jar"/>
    <include name="_misc-core.jar"/>
    <include name="_misc-annotations.jar"/>
    <include name="emma.jar"/>
    <include name="junit-4.11.jar"/>
    <include name="ant-junit-1.7.1.jar"/>
    </fileset>
    </classpath>
    </taskdef>
     <target name="lisaTests" description="Executes a LISA Test Suite as JUnit tests.">
    <echo message="Executes a LISA Test Suite as JUnit tests.( make sure old reports are deleted”/>
    <delete dir="${vs.project.build.report.dir}"/>
    <mkdir dir="${vs.project.build.report.dir}"/>
    <echo message="Run the lisa test in junit mode in base dir:${basedir}"/>
    <junitlisa toDir="${vs.project.build.report.dir}" registry="${vs.sandbox.registry.url}">
    <jvmarg value="-Dlisa.tmpdir=${vs.project.build.temp.dir}"/>
    <lisatest suite="${vs.project.test.suite.dir}"/>
    </junitlisa>
        <echo message="Generate junit style html report."/>
            <junitlisareport toDir="${vs.project.build.report.dir}"/>
            <echo message="The JUnit report is available at ${vs.project.build.report.dir}/index.html"/>
        </target>
    </project> 
  6. Done, please run ant, you are able to view results.

Comments

Popular Posts