| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Commons Math example source code file (test-jar.xml)

This example Commons Math source code file (test-jar.xml) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons Math tags/keywords

any, apache, asf, asf, java, java, junit, license, license, see, the, the, use, you

The Commons Math test-jar.xml source code

<?xml version="1.0" encoding="UTF-8"?>

   Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.

   Compiles and runs unit tests against distribution jar(s).  Use .antrc or the 
   command line to control the jdk used to execute this build file.  
   Assumes that the distribution jar to be tested is in the base directory. 
   Use the "jardir" property to specify the path to the directory containing
   the jar. Any other jars in this directory will also be added to the
   The default target, "test," executes clean as a dependency.
<project default="test" name="commons-math" basedir=".">
  <property name="defaulttargetdir" value="target"/>
  <property name="libdir" value="target/lib"/>
  <property name="testclassesdir" value="target/test-classes"/>
  <property name="testreportdir" value="target/test-reports"/>
  <property name="defaulttargetdir" value="target"/>
  <property name="jardir" value="${basedir}"/>
   <path id="build.classpath">
    <fileset dir="${libdir}">
      <include name="**/*.jar">
  <target name="clean" description="o Clean up the generated directories">
    <delete dir="${defaulttargetdir}"/>
  <target name="init" description="o Initializes some properties">
    **************************Java runtime version*****************************
    **************************Java class path**********************************
    **************************Java home****************************************
     *************************Java library path*******************************
    Java library path: ${java.library.path}
    <mkdir dir="${libdir}" />
    <condition property="noget">
      <equals arg2="only" arg1="${build.sysclasspath}">
    <!--Test if JUNIT is present in ANT classpath-->
    <available property="Junit.present" classname="junit.framework.Test">
  <target name="test" description="o Run the test cases" if="test.failure" depends="internal-test">
    <fail message="There were test failures.">
  <target name="internal-test" if="Junit.present" depends="clean, junit-present,compile-tests">
    <mkdir dir="${testreportdir}"/>
    <junit dir="./" failureproperty="test.failure" printSummary="yes" fork="true" haltonerror="true">
      <sysproperty key="basedir" value="."/>
      <formatter usefile="false" type="plain"/>
        <path refid="build.classpath"/>
        <pathelement path="${testclassesdir}"/>
      <batchtest todir="${testreportdir}">
        <fileset dir="src/test/java">
          <include name="**/*"/>
          <exclude name="**/*"/>
  <target name="junit-present" unless="Junit.present" depends="init">
    ================================= WARNING ================================
    Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed.
  <target name="compile-tests" if="Junit.present" depends="junit-present">
    <mkdir dir="${testclassesdir}"/>
    <javac destdir="${testclassesdir}" deprecation="true" debug="true"
            optimize="false" excludes="**/package.html">
        <pathelement location="src/test"/>
        <path refid="build.classpath"/>
    <copy todir="${testclassesdir}">
      <fileset dir="src/test/resources">
        <include name="**/*.xml"/>
        <include name="**/*.txt"/>

Other Commons Math examples (source code examples)

Here is a short list of links related to this Commons Math test-jar.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.