The version of Apache log4j used by SoundHelix.

[[ 🗃 ^aEp6o apache-log4j ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/aEp6o

SSH: git clone USERNAME@vervis.peers.community:aEp6o

Branches

Tags

PRE_UGLI_MOVE :: tests /

db.xml

<project name="db-tests" default="usage" basedir="." >

  <property file="build.properties"/>

  <!-- The base directory relative to which most targets are built -->
  <property name="base" value="."/>
 
  <!-- The directory where source files are stored. -->
  <property name="project.source.home" value="../src/java/"/>
  <property name="project.classes.home" value="../dist/classes/"/>
  <property name="examples.classes" value="../examples/classes/"/>
  
  <property name="tests.source.home" value="./src/java/"/>
  
  <!-- The stem where most log4j source code is located. -->
  <property name="stem" value="org/apache/log4j"/>
  
  <path id="tests.classpath">
    <pathelement location="${project.source.home}"/>
    <pathelement location="${project.classes.home}"/>
    <pathelement location="${examples.classes}"/>
    <pathelement location="${tests.source.home}"/>
    <pathelement location="./classes"/>
    <pathelement location="./resources"/>
    <pathelement location="${jakarta-oro.jar}"/>
    <fileset dir="./lib/">
      <include name="*.jar"/>
    </fileset>
  </path>
  
	
   <target name="usage">
     <echo>
	      hsqldb - to invoke HSQLDB tests
     </echo>
   </target>
	
   <!-- ================================================================= -->
   <!-- Build the parent project as well as the test classes              -->
   <!-- ================================================================= -->  
   <target name="build">
     <ant antfile="build.xml" target="build" inheritRefs="true"/>
   </target>

	<!-- ================================================================= -->
  <!-- ========================= DB Tests ======================= -->
  <!-- ================================================================= -->

  <!-- These tests follow the same pattern. They will be run if a property file 
       defining access as well as necessary class files are available. Otherwise,
       the test is skipped.
       --> 


  <!-- The target that performs the actual test -->
  <target name="invokeDBTestCase">    
    <junit printsummary="yes" fork="no" haltonfailure="yes"> 
      <sysproperty key="toto" value="${toto}"/>     
      <sysproperty key="appendConfigFile" value="${appendConfigFile}"/>
      <sysproperty key="readConfigFile" value="${readConfigFile}"/>
      <classpath refid="tests.classpath"/>
      <formatter type="plain" usefile="false"/>
      <test name="org.apache.log4j.db.FullCycleDBTest" />
    </junit>
  </target>
  
  
  <!-- the following target is shared by MySQL and PostgreSQL targets -->
  <target name="commonDB">
    <property file="./input/db/db.properties"/> 

    <!-- This task deletes existing entries in the database -->
    <!-- Do not use on a table with valuable dataset        -->
    <input
     message="All data is going to be deleted from DB. Continue (y/n)?"
     validargs="y,n"
     addproperty="do.delete"
     />
    <condition property="do.abort">
      <equals arg1="n" arg2="${do.delete}"/>
    </condition>
    <fail if="do.abort">Build aborted by user.</fail>
    <sql driver="${driverClass}" 
	 url="${url}" 
	 userid="${user}" 
	 password="${password}"
	 src="./input/db/deleteTables.sql">
      <classpath refid="tests.classpath"/>
    </sql>
    
    
    <echo message="Running test case with DriverManager config file"/>
    <antcall target="invokeDBTestCase">
      <param name="appendConfigFile" value="./input/db/append-with-drivermanager1.xml"/>
      <param name="readConfigFile"   value="./input/db/read-with-drivermanager1.xml"/>
    </antcall>
    
    <echo message="Running test case with DataSource"/>
    <antcall target="invokeDBTestCase">
      <param name="appendConfigFile" value="./input/db/append-with-datasource1.xml"/>
      <param name="readConfigFile"   value="./input/db/read-with-datasource1.xml"/>
    </antcall>
    
    <echo message="Running test case with a native *pooled* DataSource"/>
    <antcall target="invokeDBTestCase">
      <param name="appendConfigFile" value="./input/db/append-with-pooled-datasource1.xml"/>
      <param name="readConfigFile"   value="./input/db/read-with-pooled-datasource1.xml"/>
    </antcall>
    
    <echo message="Running test case with a DataSource with JNDI"/>
    <antcall target="invokeDBTestCase">
      <param name="appendConfigFile" value="./input/db/append-with-jndi1.xml"/>
      <param name="readConfigFile"   value="./input/db/read-with-jndi1.xml"/>
    </antcall> 
  </target>   
  
  <!-- ============ hsqldb  specific tests ============== -->     
  
  <target name="hsqldbCheck">
    <condition property="hsqldb-present">
      <and>
	<available file="./input/db/hsqldb.properties" />
	<available classname="org.hsqldb.jdbcDriver">
	  <classpath refid="tests.classpath"/>
	</available>
      </and>
    </condition>
  </target>
  
  <target name="hsqldb" depends="hsqldbCheck, build" if="hsqldb-present">
    <delete file="./input/db/db.properties"/>
    <echo message="hsqldb available"/>
    <copy file="./input/db/hsqldb.properties" tofile="./input/db/db.properties"/>
    
    <echo message="Running test case with DriverManager config file"/>
    <antcall target="invokeDBTestCase">
      <param name="appendConfigFile" value="./input/db/append-with-drivermanager1.xml"/>
      <param name="readConfigFile"   value="./input/db/read-with-drivermanager1.xml"/>
    </antcall>
  </target>
  
  <!-- ============ MySQL specific tests ============== -->     
  <target name="mysqlCheck">
    <condition property="mysql-present">
      <and>
	<available file="./input/db/mysql.properties" />
	<available classname="com.mysql.jdbc.Driver">
	  <classpath refid="tests.classpath"/>
	</available>
      </and>
    </condition>
  </target>
  
  <target name="mysql" depends="mysqlCheck, build" if="mysql-present">
    <delete file="./input/db/db.properties"/>
    <echo message="MySQL available"/>
    <copy file="./input/db/mysql.properties" tofile="./input/db/db.properties"/>
    
    <antcall target="commonDB"/>
  </target>
  
  <!-- ============ PostgreSQL specific tests ============== -->     
  
  <target name="postgresqlCheck">
    <condition property="postgresql-present">
      <and>
	<available file="./input/db/postgresql.properties" />
	<available classname="org.postgresql.Driver">
	  <classpath refid="tests.classpath"/>
	</available>
      </and>
    </condition>
  </target>
  
  <target name="postgresql" depends="postgresqlCheck, build" if="postgresql-present">
    <delete file="./input/db/db.properties"/>
    <echo message="PostgreSQL available"/>
    <copy file="./input/db/postgresql.properties" tofile="./input/db/db.properties"/>
    <antcall target="commonDB"/>
  </target>
  
  <!-- ============ Oracle specific tests ============== --> 
  <target name="oracleCheck"> 
    <condition property="oracle-present"> 
      <and> 
	<available file="./input/db/oracle.properties" /> 
	<available classname="oracle.jdbc.driver.OracleDriver"> 
	  <classpath refid="tests.classpath"/> 
	</available> 
      </and> 
    </condition> 
  </target> 
  
  <target name="oracle" depends="oracleCheck, build" if="oracle-present"> 
    <delete file="./input/db/db.properties"/> 
    <echo message="Oracle available"/> 
    <copy file="./input/db/oracle.properties" tofile="./input/db/db.properties"/> 
    
    <antcall target="commonDB"/> 
  </target> 
  
  <!-- ============ MS SQL Server specific tests ============== --> 
  <target name="msSqlCheck"> 
    <condition property="msSql-present"> 
      <and> 
	<available file="./input/db/msSql.properties" /> 
	<available classname="weblogic.jdbc.mssqlserver4.Driver"> 
	  <classpath refid="tests.classpath"/> 
	</available> 
      </and> 
    </condition> 
  </target> 
  
  <target name="msSql" depends="msSqlCheck, build" if="msSql-present"> 
    <delete file="./input/db/db.properties"/> 
    <echo message="Ms Sql available"/> 
    <copy file="./input/db/msSql.properties" tofile="./input/db/db.properties"/> 
    
    <antcall target="commonDB"/> 
  </target> 
</project>

  
[See repo JSON]