src-test/build.xml
author Asier Lostalé <asier.lostale@openbravo.com>
Mon, 19 Jun 2017 15:16:26 +0200
changeset 32244 443c3cdbf841
parent 27242 28f34efdae7d
permissions -rw-r--r--
fixed bug 36274: abandoned connection in SessionListener

Detach connection from current thread to allow it to be properly returned
to pool.

This is required whever the thread doing the actio is not handling an standard
request.
<?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="test-src-dirs"/>
    <pathelement path="${build.test}" />
  	<pathelement path="${build}" />
    <fileset dir="${base.lib}">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="${build.core.lib}">
      <include name="openbravo-core.jar" />
    </fileset>
    <fileset dir="${build.trl.lib}">
      <include name="openbravo-trl.jar" />
    </fileset>
    <fileset dir="${build.wad.lib}">
      <include name="openbravo-wad.jar" />
    </fileset>
    <fileset dir="${base.lib}">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="${base.db}/lib/">
      <include name="**/*.jar" />
    </fileset>
    <fileset dir="${base.modules}">
      <include name="*/lib/**" />
    </fileset>
  </path>

  <target name="compile.test" depends="sqlc,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="test.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="test.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="test.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="org.openbravo.test.AllQuickAntTaskTests" haltonfailure="no"/>
    </junit>
  </target>

  <target name="run.test" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="test.class.path" />
      <formatter type="plain" usefile="no"/>
      <test name="${test}" haltonfailure="no"/>
    </junit>
  </target>

  <target name="run.webservice.tests" depends="compile.test, copy.xml">
    <junit printsummary="yes" haltonfailure="yes">
      <classpath refid="test.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="test.class.path" />
    <property name="export" value="no" />
    <jstest apiDetailsPath="${api.test.javascript.details}" jsPath="${base.web}/js" export="${export}" />
  </target>
</project>