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.
asier@24247
     1
<?xml version="1.0" encoding="UTF-8" ?>
asier@24247
     2
<!--
asier@24247
     3
 *************************************************************************
asier@24247
     4
 * The contents of this file are subject to the Openbravo Public License 
asier@24247
     5
 * Version 1.1 (the "License"), being the Mozilla Public License 
asier@24247
     6
 * version 1.1  with a permitted attribution clause ; you may not use 
asier@24247
     7
 * this file except in compliance with the License. 
asier@24247
     8
 * You may obtain a copy of the License at  
asier@24247
     9
 * http://www.openbravo.com/legal/license.txt 
asier@24247
    10
 * Software distributed under the License is distributed on an 
asier@24247
    11
 * "AS IS" basis, WITHOUT WARRANTY OF  ANY KIND, either express or 
asier@24247
    12
 * implied. See the License for the specific language governing rights 
asier@24247
    13
 * and  limitations under the License. 
asier@24247
    14
 * The Original Code is Openbravo ERP. 
asier@24247
    15
 * The Initial Developer of the Original Code is Openbravo SLU 
asier@24247
    16
 * All portions are Copyright (C) 2014 Openbravo SLU 
asier@24247
    17
 * All Rights Reserved. 
asier@24247
    18
 * Contributor(s): Openbravo S.L.U.
asier@24247
    19
 ************************************************************************
asier@24247
    20
-->
asier@24247
    21
asier@24247
    22
<project name="openbravo" default="compile.complete" basedir="..">
asier@24247
    23
  <import file="../src/build.xml" />
asier@24247
    24
asier@24247
    25
  <property name="build.test" location="${base.src.test}/build/classes" />
asier@24247
    26
asier@24247
    27
  <path id="test-src-dirs">
asier@24247
    28
    <pathelement path="${base.src.test}" />
asier@24247
    29
    <dirset dir="${base.modules}">
asier@24247
    30
      <include name="*/src-test" />
asier@24247
    31
    </dirset>
asier@24247
    32
  </path>
asier@24247
    33
asier@24247
    34
  <path id="test.class.path">
asier@24247
    35
    <path refid="project.class.path"/>
asier@24247
    36
    <fileset dir="${base.lib}">
asier@24247
    37
      <include name="**/test/*.jar" />
asier@24247
    38
    </fileset>
asier@24247
    39
    <fileset dir="${base.modules}">
asier@24247
    40
      <include name="**/test/*.jar" />
asier@24247
    41
    </fileset> 
asier@24247
    42
  </path>
asier@24247
    43
asier@24247
    44
  <target name="compile.test" depends="compileSqlc,generate.entities.quick">
asier@24247
    45
  	 <mkdir dir="${build.test}"/>
asier@24247
    46
     <javac destdir="${build.test}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" nowarn="${friendlyWarnings}" includeantruntime="false">
asier@24247
    47
      <src refid="test-src-dirs"/>
asier@24247
    48
      <classpath refid="test.class.path" />
asier@24247
    49
    </javac>
asier@24247
    50
  </target>
asier@24247
    51
asier@24247
    52
  <target name="copy.xml">
asier@24247
    53
    <copy todir="${build}">
asier@24247
    54
      <fileset dir="${base.src.test}" includes="**/*.xml" />
asier@24247
    55
    </copy>
asier@24247
    56
  </target>
asier@24247
    57
asier@24247
    58
  <target name="run.tests" depends="compile.test, copy.xml">
asier@24247
    59
    <junit printsummary="yes" haltonfailure="yes">
asier@24247
    60
      <classpath refid="project.class.path" />
asier@24247
    61
      <formatter type="plain" usefile="no"/>
asier@24247
    62
      <test name="org.openbravo.test.AntTaskTests" haltonfailure="no"/>
asier@24247
    63
    </junit>
asier@24247
    64
  </target>
asier@24247
    65
asier@24247
    66
  <target name="run.all.tests" depends="compile.test, copy.xml">
asier@24247
    67
    <junit printsummary="yes" haltonfailure="yes">
asier@24247
    68
      <classpath refid="project.class.path" />
asier@24247
    69
      <formatter type="plain" usefile="no"/>
asier@24247
    70
      <test name="org.openbravo.test.AllAntTaskTests" haltonfailure="no" outfile="../src/result">
asier@24247
    71
      <formatter type="xml" />
asier@24247
    72
    </test>
asier@24247
    73
    </junit>
asier@24247
    74
  </target>
asier@24247
    75
asier@24247
    76
  <target name="run.quick.tests" depends="compile.test, copy.xml">
asier@24247
    77
    <junit printsummary="yes" haltonfailure="yes">
asier@24247
    78
      <classpath refid="project.class.path" />
asier@24247
    79
      <formatter type="plain" usefile="no"/>
asier@24247
    80
      <test name="org.openbravo.test.AllQuickAntTaskTests" haltonfailure="no"/>
asier@24247
    81
    </junit>
asier@24247
    82
  </target>
asier@24247
    83
asier@24247
    84
  <target name="run.webservice.tests" depends="compile.test, copy.xml">
asier@24247
    85
    <junit printsummary="yes" haltonfailure="yes">
asier@24247
    86
      <classpath refid="project.class.path" />
asier@24247
    87
      <formatter type="plain" usefile="no"/>
asier@24247
    88
      <test name="org.openbravo.test.AllWebserviceTests" haltonfailure="no" outfile="../src/resultws">
asier@24247
    89
        <formatter type="xml" />
asier@24247
    90
      </test>
asier@24247
    91
    </junit>
asier@24247
    92
  </target>
asier@24988
    93
asier@24988
    94
  <target name="run.api.test.javascript" depends="compile.test">
asier@24988
    95
    <taskdef name="jstest" classname="org.openbravo.test.javascript.JavaScriptAntTest" classpathref="project.class.path" />
asier@24988
    96
    <property name="export" value="no" />
asier@24988
    97
    <jstest apiDetailsPath="${api.test.javascript.details}" jsPath="${base.web}/js" export="${export}" />
asier@24988
    98
  </target>
staff@25286
    99
</project>