src-test/build.xml
author RM packaging bot <staff.rm@openbravo.com>
Fri, 13 Mar 2015 01:44:08 +0000
changeset 26175 6f599d5217c4
parent 25986 83d2b7d66367
child 27096 1efeff756e75
permissions -rw-r--r--
CI: update AD_MODULE to version 26172
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 *************************************************************************
 * The contents of this file are subject to the Openbravo Public License 
 * Version 1.1 (the "License"), being the Mozilla Public License 
 * version 1.1  with a permitted attribution clause ; you may not use 
 * this file except in compliance with the License. 
 * You may obtain a copy of the License at  
 * http://www.openbravo.com/legal/license.txt 
 * Software distributed under the License is distributed on an 
 * "AS IS" basis, WITHOUT WARRANTY OF  ANY KIND, either express or 
 * implied. See the License for the specific language governing rights 
 * and  limitations under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SLU 
 * All portions are Copyright (C) 2014-2015 Openbravo SLU 
 * All Rights Reserved. 
 * Contributor(s): Openbravo S.L.U.
 ************************************************************************
-->

<project name="openbravo" default="compile.complete" basedir="..">
  <import file="../src/build.xml" />

  <property name="build.test" location="${base.src.test}/build/classes" />

  <path id="test-src-dirs">
    <pathelement path="${base.src.test}" />
    <dirset dir="${base.modules}">
      <include name="*/src-test" />
    </dirset>
  </path>

  <path id="test.class.path">
    <path refid="project.class.path"/>
    <fileset dir="${base.lib}">
      <include name="**/test/*.jar" />
    </fileset>
    <fileset dir="${base.modules}">
      <include name="**/test/*.jar" />
    </fileset> 
  </path>

  <target name="compile.test" depends="compileSqlc,generate.entities.quick">
  	 <mkdir dir="${build.test}"/>
     <javac destdir="${build.test}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}" includeantruntime="false">
      <src refid="test-src-dirs"/>
      <classpath refid="test.class.path" />
    </javac>
  </target>

  <target name="copy.xml">
    <copy todir="${build}">
      <fileset dir="${base.src.test}/src" includes="**/*.xml" />
    </copy>
  </target>

  <target name="run.tests" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="project.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="org.openbravo.test.AntTaskTests" haltonfailure="no"/>
    </junit>
  </target>

  <target name="run.all.tests" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="project.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="org.openbravo.test.AllAntTaskTests" haltonfailure="no" outfile="../src/result">
      <formatter type="xml" />
    </test>
    </junit>
  </target>

  <target name="run.quick.tests" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="project.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="org.openbravo.test.AllQuickAntTaskTests" haltonfailure="no"/>
    </junit>
  </target>

  <target name="run.webservice.tests" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="project.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="org.openbravo.test.AllWebserviceTests" haltonfailure="no" outfile="../src/resultws">
        <formatter type="xml" />
      </test>
    </junit>
  </target>

  <target name="run.api.test.javascript" depends="compile.test">
    <taskdef name="jstest" classname="org.openbravo.test.javascript.JavaScriptAntTest" classpathref="project.class.path" />
    <property name="export" value="no" />
    <jstest apiDetailsPath="${api.test.javascript.details}" jsPath="${base.web}/js" export="${export}" />
  </target>
</project>