| 1 | d2a8c3fd | Marc NICOLAS | <?xml version="1.0" encoding="UTF-8"?>
 | 
      
        | 2 |  |  | 
 | 
      
        | 3 |  |  | 
 | 
      
        | 4 |  |  | 
 | 
      
        | 5 |  |  | 
 | 
      
        | 6 |  |  | 
 | 
      
        | 7 |  |  | 
 | 
      
        | 8 |  |  | 
 | 
      
        | 9 |  |  | 
 | 
      
        | 10 |  |  | 
 | 
      
        | 11 |  |  | 
 | 
      
        | 12 |  |  | 
 | 
      
        | 13 |  |  | 
 | 
      
        | 14 |  |  | 
 | 
      
        | 15 |  |  | 
 | 
      
        | 16 |  |  | 
 | 
      
        | 17 |  |  | 
 | 
      
        | 18 |  |  | 
 | 
      
        | 19 |  |  | 
 | 
      
        | 20 |  |  | <project name="fr.cnes.sitools.test.install" basedir="."
 | 
      
        | 21 |  |  |         default="build">
 | 
      
        | 22 |  |  | 
 | 
      
        | 23 |  |  |         
 | 
      
        | 24 |  |  | 
 | 
      
        | 25 |  |  | 
 | 
      
        | 26 |  |  | 
 | 
      
        | 27 |  |  | 
 | 
      
        | 28 |  |  |         
 | 
      
        | 29 |  |  |         <property file="build.properties" />
 | 
      
        | 30 |  |  |         
 | 
      
        | 31 |  |  | 
 | 
      
        | 32 |  |  |         <property file="build-install.properties" />
 | 
      
        | 33 |  |  | 
 | 
      
        | 34 |  |  |         <import file="sitools.userlibraries.ant.xml" optional="true" />
 | 
      
        | 35 |  |  | 
 | 
      
        | 36 |  |  |         <property name="fr.cnes.sitools.core.dir"
 | 
      
        | 37 |  |  |                 value="${ROOT_DIRECTORY_LOCAL}/workspace/fr.cnes.sitools.core" />
 | 
      
        | 38 |  |  |         <property name="conf.dir" value="${fr.cnes.sitools.core.dir}/conf" />
 | 
      
        | 39 |  |  |         <property name="conf.bin.dir" value="${conf.dir}/bin" />
 | 
      
        | 40 |  |  |         <property name="conf.jar.dir" value="${conf.dir}/jar" />
 | 
      
        | 41 |  |  |         <property name="conf.properties.dir" value="${conf.dir}/properties" />
 | 
      
        | 42 |  |  |         <property name="conf.reference.dir" value="${conf.dir}/reference" />
 | 
      
        | 43 |  |  |         <property name="conf.build.userlib.dir" value="${conf.dir}/build/userlibrairies" />
 | 
      
        | 44 |  |  |         <property name="cots.dir" value="${ROOT_DIRECTORY_LOCAL}/cots" />
 | 
      
        | 45 |  |  | 
 | 
      
        | 46 |  |  |         
 | 
      
        | 47 |  |  |         <property name="install.dir" value="${basedir}" />
 | 
      
        | 48 |  |  |         <property name="install.res.dir" value="${install.dir}/res" />
 | 
      
        | 49 |  |  |         <property name="install.res.script.dir" value="${install.res.dir}/script" />
 | 
      
        | 50 |  |  |         <property name="install.res.properties.dir" value="${install.res.dir}/properties" />
 | 
      
        | 51 |  |  |         <property name="install.lib.dir" value="${install.dir}/lib" />
 | 
      
        | 52 |  |  | 
 | 
      
        | 53 |  |  |         <property name="temp.dir" value="${install.dir}/tmp" />
 | 
      
        | 54 |  |  | 
 | 
      
        | 55 |  |  |         
 | 
      
        | 56 |  |  | 
 | 
      
        | 57 |  |  |         
 | 
      
        | 58 |  |  | 
 | 
      
        | 59 |  |  | 
 | 
      
        | 60 |  |  | 
 | 
      
        | 61 |  |  |         
 | 
      
        | 62 |  |  |         <taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask">
 | 
      
        | 63 |  |  |                 <classpath>
 | 
      
        | 64 |  |  |                         <path location="${cots.dir}/dbunit-2.4.8/dbunit-2.4.8.jar" />
 | 
      
        | 65 |  |  |                         <path location="${cots.dir}/slf4j-1.6.1/slf4j-api-1.6.1.jar" />
 | 
      
        | 66 |  |  |                         <path location="${cots.dir}/slf4j-1.6.1/slf4j-jdk14-1.6.1.jar" />
 | 
      
        | 67 |  |  |                 </classpath>
 | 
      
        | 68 |  |  |         </taskdef>
 | 
      
        | 69 |  |  | 
 | 
      
        | 70 |  |  |         
 | 
      
        | 71 |  |  |         <taskdef name="izpack" classpath="./install_res/libraries/standalone-compiler.jar"
 | 
      
        | 72 |  |  |                 classname="com.izforge.izpack.ant.IzPackTask" />
 | 
      
        | 73 |  |  | 
 | 
      
        | 74 |  |  | 
 | 
      
        | 75 |  |  | 
 | 
      
        | 76 |  |  |         
 | 
      
        | 77 |  |  | 
 | 
      
        | 78 |  |  |         
 | 
      
        | 79 |  |  |         <target name="save-pg" description="Save the Postgresql DB as an xml file">
 | 
      
        | 80 |  |  |                 <dbunit driver="${PG_DATABASE_DRIVER}" url="${PG_DATABASE_URL}"
 | 
      
        | 81 |  |  |                         userid="${PG_DATABASE_USER}" password="${PG_DATABASE_PASSWORD}"
 | 
      
        | 82 |  |  |                         schema="fuse" classpath="${PG_DATABASE_DRIVER_PATH}">
 | 
      
        | 83 |  |  |                         <dbconfig>
 | 
      
        | 84 |  |  |                                 <property name="datatypeFactory"
 | 
      
        | 85 |  |  |                                         value="org.dbunit.ext.postgresql.PostgresqlDataTypeFactory" />
 | 
      
        | 86 |  |  |                                 <feature name="batchedStatements" value="true" />
 | 
      
        | 87 |  |  |                         </dbconfig>
 | 
      
        | 88 |  |  |                         
 | 
      
        | 89 |  |  |                         
 | 
      
        | 90 |  |  |                         
 | 
      
        | 91 |  |  |                         
 | 
      
        | 92 |  |  | 
 | 
      
        | 93 |  |  |                         
 | 
      
        | 94 |  |  | 
 | 
      
        | 95 |  |  |                         
 | 
      
        | 96 |  |  | 
 | 
      
        | 97 |  |  |                         
 | 
      
        | 98 |  |  |                         <export dest="./res/export/postgresql/export_sitools_pg.xml">
 | 
      
        | 99 |  |  |                                 <query name="USERS" sql='SELECT * FROM sitools."USERS"' />
 | 
      
        | 100 |  |  |                                 <query name="GROUPS" sql='SELECT * FROM sitools."GROUPS"' />
 | 
      
        | 101 |  |  |                                 <query name="USER_GROUP" sql='SELECT * FROM sitools."USER_GROUP"' />
 | 
      
        | 102 |  |  |                                 <query name="USER_PROPERTIES" sql='SELECT * FROM sitools."USER_PROPERTIES"' />
 | 
      
        | 103 |  |  |                         </export>
 | 
      
        | 104 |  |  |                         <export dest="./res/export/postgresql/export_tests_pg.xml">
 | 
      
        | 105 |  |  |                                 <query name="table_tests" sql='SELECT * FROM test."table_tests"' />
 | 
      
        | 106 |  |  |                         </export>
 | 
      
        | 107 |  |  |                 </dbunit>
 | 
      
        | 108 |  |  |         </target>
 | 
      
        | 109 |  |  | 
 | 
      
        | 110 |  |  |         
 | 
      
        | 111 |  |  | 
 | 
      
        | 112 |  |  |         
 | 
      
        | 113 |  |  |         <target name="save-mysql" description="Save the Mysql DB as an xml file">
 | 
      
        | 114 |  |  | 
 | 
      
        | 115 |  |  | 
 | 
      
        | 116 |  |  | 
 | 
      
        | 117 |  |  | 
 | 
      
        | 118 |  |  | 
 | 
      
        | 119 |  |  | 
 | 
      
        | 120 |  |  | 
 | 
      
        | 121 |  |  | 
 | 
      
        | 122 |  |  | 
 | 
      
        | 123 |  |  | 
 | 
      
        | 124 |  |  | 
 | 
      
        | 125 |  |  | 
 | 
      
        | 126 |  |  | 
 | 
      
        | 127 |  |  | 
 | 
      
        | 128 |  |  | 
 | 
      
        | 129 |  |  |                 
 | 
      
        | 130 |  |  |                 <dbunit driver="${MYSQL_DATABASE_DRIVER}" url="${MYSQL_DATABASE_URL}/cnes"
 | 
      
        | 131 |  |  |                         userid="${MYSQL_DATABASE_USER}" password="${MYSQL_DATABASE_PASSWORD}"
 | 
      
        | 132 |  |  |                         classpath="${MYSQL_DATABASE_DRIVER_PATH}">
 | 
      
        | 133 |  |  |                         <dbconfig>
 | 
      
        | 134 |  |  |                                 <property name="datatypeFactory" value="org.dbunit.ext.mysql.MySqlDataTypeFactory" />
 | 
      
        | 135 |  |  |                                 <feature name="batchedStatements" value="true" />
 | 
      
        | 136 |  |  |                         </dbconfig>
 | 
      
        | 137 |  |  |                         <export dest="./res/export/mysql/export_sitools_mysql.xml">
 | 
      
        | 138 |  |  |                                 <query name="USERS" sql='SELECT * FROM USERS' />
 | 
      
        | 139 |  |  |                                 <query name="GROUPS" sql='SELECT * FROM GROUPS' />
 | 
      
        | 140 |  |  |                                 <query name="USER_GROUP" sql='SELECT * FROM USER_GROUP' />
 | 
      
        | 141 |  |  |                                 <query name="USER_PROPERTIES" sql='SELECT * FROM USER_PROPERTIES' />
 | 
      
        | 142 |  |  |                         </export>                        
 | 
      
        | 143 |  |  |                 </dbunit>
 | 
      
        | 144 |  |  |                 
 | 
      
        | 145 |  |  |                 <dbunit driver="${MYSQL_DATABASE_DRIVER}" url="${MYSQL_DATABASE_URL}/cnes-test"
 | 
      
        | 146 |  |  |                         userid="${MYSQL_DATABASE_USER}" password="${MYSQL_DATABASE_PASSWORD}"
 | 
      
        | 147 |  |  |                         classpath="${MYSQL_DATABASE_DRIVER_PATH}">
 | 
      
        | 148 |  |  |                         <dbconfig>
 | 
      
        | 149 |  |  |                                 <property name="datatypeFactory" value="org.dbunit.ext.mysql.MySqlDataTypeFactory" />
 | 
      
        | 150 |  |  |                                 <feature name="batchedStatements" value="true" />
 | 
      
        | 151 |  |  |                         </dbconfig>
 | 
      
        | 152 |  |  |                         <export dest="./res/export/mysql/export_tests_mysql.xml">
 | 
      
        | 153 |  |  |                                 <query name="TABLE_TESTS" sql='SELECT * FROM TABLE_TESTS' />
 | 
      
        | 154 |  |  |                         </export>
 | 
      
        | 155 |  |  |                 </dbunit>
 | 
      
        | 156 |  |  |         </target>
 | 
      
        | 157 |  |  | 
 | 
      
        | 158 |  |  |         
 | 
      
        | 159 |  |  | 
 | 
      
        | 160 |  |  |         <target name="restore-pg">
 | 
      
        | 161 |  |  |                 <dbunit driver="${PG_DATABASE_DRIVER}" url="${PG_DATABASE_URL}"
 | 
      
        | 162 |  |  |                         userid="${PG_DATABASE_USER}" password="${PG_DATABASE_PASSWORD}"
 | 
      
        | 163 |  |  |                         classpath="${jdbc.postgresql.driver.jar}" schema="fuse">
 | 
      
        | 164 |  |  |                         <dbconfig>
 | 
      
        | 165 |  |  |                                 <property name="datatypeFactory"
 | 
      
        | 166 |  |  |                                         value="org.dbunit.ext.postgresql.PostgresqlDataTypeFactory" />
 | 
      
        | 167 |  |  |                                 <feature name="batchedStatements" value="true" />
 | 
      
        | 168 |  |  |                         </dbconfig>
 | 
      
        | 169 |  |  |                         <operation type="INSERT" src="./res/export/export_fuse_pg.xml" />
 | 
      
        | 170 |  |  |                 </dbunit>
 | 
      
        | 171 |  |  |         </target>
 | 
      
        | 172 |  |  | 
 | 
      
        | 173 |  |  |         
 | 
      
        | 174 |  |  | 
 | 
      
        | 175 |  |  |         <target name="restore-mysql">
 | 
      
        | 176 |  |  |                 <dbunit driver="${MYSQL_DATABASE_DRIVER}" url="${MYSQL_DATABASE_URL}/cnes-test"
 | 
      
        | 177 |  |  |                         userid="${MYSQL_DATABASE_USER}" password="${MYSQL_DATABASE_PASSWORD}"
 | 
      
        | 178 |  |  |                         classpath="${MYSQL_DATABASE_DRIVER_PATH}">
 | 
      
        | 179 |  |  |                         <dbconfig>
 | 
      
        | 180 |  |  |                                 <property name="datatypeFactory" value="org.dbunit.ext.mysql.MySqlDataTypeFactory" />
 | 
      
        | 181 |  |  |                                 <feature name="batchedStatements" value="true" />
 | 
      
        | 182 |  |  |                         </dbconfig>
 | 
      
        | 183 |  |  |                         <operation type="UPDATE" src="./res/export/export_sitools_mysql.xml" />
 | 
      
        | 184 |  |  |                 </dbunit>
 | 
      
        | 185 |  |  |         </target>
 | 
      
        | 186 |  |  | 
 | 
      
        | 187 |  |  | 
 | 
      
        | 188 |  |  |         <target name="build"
 | 
      
        | 189 |  |  |                 depends="build-jars, refresh-properties-for-install, build-izpack-installer" />
 | 
      
        | 190 |  |  | 
 | 
      
        | 191 |  |  | 
 | 
      
        | 192 |  |  |         
 | 
      
        | 193 |  |  |         <target name="refresh-properties-for-install"
 | 
      
        | 194 |  |  |                 description="Mise à jour du fichier de propriétés sitools.properties pour install">
 | 
      
        | 195 |  |  |                 <copy outputencoding="UTF-8"
 | 
      
        | 196 |  |  |                         tofile="${install.res.properties.dir}/sitools.properties" file="${fr.cnes.sitools.core.dir}/sitools.properties"
 | 
      
        | 197 |  |  |                         overwrite="true" />
 | 
      
        | 198 |  |  |                 <propertyfile file="${install.res.properties.dir}/sitools.properties"
 | 
      
        | 199 |  |  |                         comment="Update test ">
 | 
      
        | 200 |  |  |                         <entry key="Tests.PGSQL_DATABASE_USER" value="${PGSQL_DATABASE_USER}" />
 | 
      
        | 201 |  |  |                         <entry key="Tests.PGSQL_DATABASE_URL" value="${PGSQL_DATABASE_URL}" />
 | 
      
        | 202 |  |  |                         <entry key="Tests.PGSQL_DATABASE_PASSWORD" value="${PGSQL_DATABASE_PASSWORD}" />
 | 
      
        | 203 |  |  | 
 | 
      
        | 204 |  |  |                         <entry key="Tests.MYSQL_DATABASE_USER" value="${MYSQL_DATABASE_USER}" />
 | 
      
        | 205 |  |  |                         <entry key="Tests.MYSQL_DATABASE_URL" value="${MYSQL_DATABASE_URL}" />
 | 
      
        | 206 |  |  |                         <entry key="Tests.MYSQL_DATABASE_PASSWORD" value="${MYSQL_DATABASE_PASSWORD}" />
 | 
      
        | 207 |  |  |                 </propertyfile>
 | 
      
        | 208 |  |  |         </target>
 | 
      
        | 209 |  |  | 
 | 
      
        | 210 |  |  |         
 | 
      
        | 211 |  |  | 
 | 
      
        | 212 |  |  |         <target name="build-izpack-installer" description="generation de l'installeur IzPack">
 | 
      
        | 213 |  |  |                 <echo message="Build installer from file : ${install.dir}/install.xml">
 | 
      
        | 214 |  |  |                 </echo>
 | 
      
        | 215 |  |  |                 <property file="res/properties/sitools.properties" prefix="properties" />
 | 
      
        | 216 |  |  |                 
 | 
      
        | 217 |  |  |                 <izpack input="${install.dir}/install.xml"
 | 
      
        | 218 |  |  |                         output="${install.dir}/${properties.Starter.appName}-${properties.Starter.VERSION}-DB-tests.jar"
 | 
      
        | 219 |  |  |                         installerType="standard" inheritAll="true" basedir="${install.dir}"
 | 
      
        | 220 |  |  |                         compression="deflate" compressionlevel="9" />
 | 
      
        | 221 |  |  |         </target>
 | 
      
        | 222 |  |  | 
 | 
      
        | 223 |  |  |         
 | 
      
        | 224 |  |  | 
 | 
      
        | 225 |  |  |         
 | 
      
        | 226 |  |  | 
 | 
      
        | 227 |  |  | 
 | 
      
        | 228 |  |  |         
 | 
      
        | 229 |  |  |         <property name="project.name" value="sitools-test-izpack" />
 | 
      
        | 230 |  |  |         <property name="project.fullname" value="sitools-test-izpack" />
 | 
      
        | 231 |  |  |         <property name="project.version" value="0.9.1M4" />
 | 
      
        | 232 |  |  | 
 | 
      
        | 233 |  |  |         
 | 
      
        | 234 |  |  |         <property name="author" value="AKKA Technologies" />
 | 
      
        | 235 |  |  |         <property name="year" value="2010-2013" />
 | 
      
        | 236 |  |  | 
 | 
      
        | 237 |  |  |         
 | 
      
        | 238 |  |  |         <property name="debug" value="true" />
 | 
      
        | 239 |  |  |         <property name="optimize" value="off" />
 | 
      
        | 240 |  |  |         <property name="deprecation" value="off" />
 | 
      
        | 241 |  |  |         <property name="encoding" value="UTF-8" />
 | 
      
        | 242 |  |  | 
 | 
      
        | 243 |  |  | 
 | 
      
        | 244 |  |  |         
 | 
      
        | 245 |  |  |         <property name="out.dir" value="bin" />
 | 
      
        | 246 |  |  |         
 | 
      
        | 247 |  |  |         <property name="out.classes.dir" value="${out.dir}" />
 | 
      
        | 248 |  |  | 
 | 
      
        | 249 |  |  |         
 | 
      
        | 250 |  |  |         <property name="dist.dir.validator" value="bin/validator" />
 | 
      
        | 251 |  |  |         <property name="jar.name.validator" value="validator.jar" />
 | 
      
        | 252 |  |  | 
 | 
      
        | 253 |  |  | 
 | 
      
        | 254 |  |  |         
 | 
      
        | 255 |  |  | 
 | 
      
        | 256 |  |  |         <property name="dist.dir.database-panel" value="bin/panels" />
 | 
      
        | 257 |  |  |         <property name="jar.name.database-panel" value="DatabasePanel.jar" />
 | 
      
        | 258 |  |  | 
 | 
      
        | 259 |  |  |         
 | 
      
        | 260 |  |  |         <path id="compile.classpath">
 | 
      
        | 261 |  |  |                 <pathelement location="install_res/libraries/standalone-compiler.jar" />
 | 
      
        | 262 |  |  |                 <pathelement location="install_res/libraries/dbunit-2.4.8.jar" />
 | 
      
        | 263 |  |  |         </path>
 | 
      
        | 264 |  |  | 
 | 
      
        | 265 |  |  |         
 | 
      
        | 266 |  |  |         <target name="build-jars"
 | 
      
        | 267 |  |  |                 depends="prepare, compile,jar-validator,jar-database-panel,cleanup" />
 | 
      
        | 268 |  |  | 
 | 
      
        | 269 |  |  |         <target name="prepare">
 | 
      
        | 270 |  |  |                 
 | 
      
        | 271 |  |  |                 <mkdir dir="${out.classes.dir}" />
 | 
      
        | 272 |  |  |         </target>
 | 
      
        | 273 |  |  | 
 | 
      
        | 274 |  |  | 
 | 
      
        | 275 |  |  |         <target name="compile">
 | 
      
        | 276 |  |  |                 <javac srcdir="./src" debug="${debug}" destdir="${out.classes.dir}"
 | 
      
        | 277 |  |  |                         deprecation="${deprecation}" optimize="${optimize}" encoding="${encoding}"
 | 
      
        | 278 |  |  |                         includeAntRuntime="false">
 | 
      
        | 279 |  |  |                         <classpath refid="compile.classpath" />
 | 
      
        | 280 |  |  |                 </javac>
 | 
      
        | 281 |  |  |         </target>
 | 
      
        | 282 |  |  | 
 | 
      
        | 283 |  |  |         <target name="jar-validator">
 | 
      
        | 284 |  |  |                 <delete file="${dist.dir.validator}/${jar.name.validator}" />
 | 
      
        | 285 |  |  |                 <property name="version.num" value="${project.version}" />
 | 
      
        | 286 |  |  |                 <buildnumber file="build.num" />
 | 
      
        | 287 |  |  |                 <mkdir dir="${dist.dir.validator}"></mkdir>
 | 
      
        | 288 |  |  |                 <jar jarfile="${dist.dir.validator}/${jar.name.validator}">
 | 
      
        | 289 |  |  |                         <fileset dir="${out.classes.dir}" includes="**/JDBCConnectionModelTests.class" />
 | 
      
        | 290 |  |  |                         <fileset dir="${out.classes.dir}" includes="**/JDBCConnectionValidator.class" />
 | 
      
        | 291 |  |  |                         <fileset dir="${out.classes.dir}" includes="**/SchemaExportFileModel.class" />
 | 
      
        | 292 |  |  |                 </jar>
 | 
      
        | 293 |  |  | 
 | 
      
        | 294 |  |  |         </target>
 | 
      
        | 295 |  |  | 
 | 
      
        | 296 |  |  |         <target name="jar-database-panel">
 | 
      
        | 297 |  |  |                 <delete file="${dist.dir.database-panel}/${jar.name.database-panel}" />
 | 
      
        | 298 |  |  |                 <property name="version.num" value="${project.version}" />
 | 
      
        | 299 |  |  |                 <buildnumber file="build.num" />
 | 
      
        | 300 |  |  |                 <mkdir dir="${dist.dir.database-panel}"></mkdir>
 | 
      
        | 301 |  |  |                 <jar jarfile="${dist.dir.database-panel}/${jar.name.database-panel}">
 | 
      
        | 302 |  |  |                         <fileset dir="${out.classes.dir}" includes="**/DatabasePanel.class" />
 | 
      
        | 303 |  |  |                 </jar>
 | 
      
        | 304 |  |  |         </target>
 | 
      
        | 305 |  |  | 
 | 
      
        | 306 |  |  |         <target name="cleanup">
 | 
      
        | 307 |  |  |                 <delete>
 | 
      
        | 308 |  |  |                         <fileset dir="." includes="**/*.class" />
 | 
      
        | 309 |  |  |                 </delete>
 | 
      
        | 310 |  |  |         </target>
 | 
      
        | 311 |  |  | 
 | 
      
        | 312 |  |  | </project> |