src-test/build.xml
author Víctor Martínez Romanos <victor.martinez@openbravo.com>
Thu, 07 May 2015 12:11:39 +0200
changeset 26684 2311966afd7b
parent 25286 d7cf69d29673
child 26020 83d2b7d66367
permissions -rw-r--r--
Fixed bug 29809: Impossible to create several calendars for the same organization

Two pieces of code were affected by this bug:
PeriodEventHandler.java: EntityPersistenceEventObserver in charge of checking overlap in manual inserts/updates (or any java process) in c_period table
C_YEARPERIODS: db function associated to the create periods process inside the Fiscal Calendar | Year tab. It also verifies the periods don't overlap other periods.

The fix consists in checking that there is no date overlap per calendar. Before this fix the calendar wasn't taken into account, so it was not possible to define several calendars for the same organization with the same periods.
<?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 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}" 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>