<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
  <!ENTITY buildmagic SYSTEM "../tools/etc/buildmagic/buildmagic.ent">
  <!ENTITY libraries  SYSTEM "../thirdparty/libraries.ent">
  <!ENTITY modules    SYSTEM "../tools/etc/buildmagic/modules.ent">
]>

<!-- $Id: build.xml 57030 2006-09-20 22:02:00Z dimitris@jboss.org $ -->

<!--+======================================================================+-->
<!--| JBoss (The OpenSource J2EE WebOS) Build File                         |-->
<!--|                                                                      |-->
<!--| Distributable under LGPL license.                                    |-->
<!--| See terms of license at http://www.gnu.org.                          |-->
<!--|                                                                      |-->
<!--| This file has been designed to work with the 'tools' module and      |-->
<!--| Buildmagic extentions.                                               |-->
<!--+======================================================================+-->

<project default="main" name="JBoss/JMX">

  <!--+====================================================================+-->
  <!--| Setup                                                              |-->
  <!--|                                                                    |-->
  <!--| Include the common build elements.                                 |-->
  <!--|                                                                    |-->
  <!--| This defines several different targets, properties and paths.      |-->
  <!--| It also sets up the basic extention tasks amoung other things.     |-->
  <!--+====================================================================+-->

  &buildmagic;

  <!--+====================================================================+-->
  <!--| Initialization                                                     |-->
  <!--|                                                                    |-->
  <!--| Initialize the build system.  Other targets should depend on       |-->
  <!--| 'init'.                                                            |-->
  <!--+====================================================================+-->

    <target name="init" unless="init.disable" depends="_buildmagic:init">
    </target>

    <!-- Added since in target.ent, but can not include since duplicate _default:init
         in buildmagic.ent -->
    <target name="_default:most"
       description="Builds almost everything."
       depends="output"/>

    <target name="_default:help"
            description="Show this help message."
       depends="_buildmagic:help:standard"/>

    <target name="_default:all"
       description="Builds everything."
       depends="most,docs"/>


  <!--+====================================================================+-->
  <!--| Configuration                                                      |-->
  <!--|                                                                    |-->
  <!--| This target is invoked by the Buildmagic initialization logic      |-->
  <!--| and should contain module specific configuration elements.         |-->
  <!--+====================================================================+-->

  <target name="configure" unless="configure.disable">

      &libraries;
      &modules;

      <property name="source.classes" value="${module.source}/main"/>
      <property name="source.java" value="${source.classes}"/>

      <!-- Configure modules -->
      <path id="dependentmodule.classpath">
         <!-- Add dependent module classpath elements here. -->
        <path refid="jboss.common.classpath"/>
      </path>

      <!-- Configure thirdparty libraries -->
      <path id="library.classpath">
        <path refid="apache.log4j.classpath"/>
        <path refid="oswego.concurrent.classpath"/>
        <path refid="jboss.dom4j.jarjar.classpath"/>
        <path refid="sax.classpath"/>
        <path refid="junit.junit.classpath"/>
        <path refid="apache.bcel.classpath"/>
        <path refid="apache.commons.classpath"/>
      </path>

        <!-- The combined thirdparty classpath -->
        <path id="thirdparty.classpath">
          <path refid="library.classpath"/>
          <path refid="dependentmodule.classpath"/>
        </path>

      <!-- The classpath required to build classes. -->
      <path id="javac.classpath">
        <pathelement path="${classpath}"/>
        <pathelement path="${local.classpath}"/>
        <path refid="thirdparty.classpath"/>
      </path>

      <!-- Where source files live -->
      <property name="source.classes" value="${module.source}/main"/>
      <property name="source.docs" value="${module.source}/docs"/>
      <property name="source.etc" value="${module.source}/etc"/>
      <property name="source.examples" value="${module.source}/examples"/>
      <property name="source.bin" value="${module.source}/bin"/>
      <property name="source.resources" value="${module.source}/resources"/>
      <property name="source.stylesheets" value="${module.source}/stylesheets"/>
      <property name="source.web" value="${module.source}/web"/>
      <property name="source.test" value="${module.source}/test"/>
      <property name="source.java" value="${module.source}/main"/>

      <!-- Where build generated files will go -->
      <property name="build.api" value="${module.output}/api"/>
      <property name="build.bin" value="${module.output}/bin"/>
      <property name="build.classes" value="${module.output}/classes"/>
      <property name="build.docs" value="${module.output}/docs"/>
      <property name="build.stylesheets" value="${module.output}/stylesheets"/>
      <property name="build.etc" value="${module.output}/etc"/>
      <property name="build.examples" value="${module.output}/examples"/>
      <property name="build.gen" value="${module.output}/gen"/>
      <property name="build.gen.classes" value="${build.gen}/classes"/>
      <property name="build.jmx-api" value="${module.output}/jmx-api"/>
      <property name="build.jmx-doc" value="${module.output}/jmx-doc"/>
      <property name="build.lib" value="${module.output}/lib"/>
      <property name="build.deploy" value="${module.output}/deploy"/>
      <property name="build.reports" value="${module.output}/reports"/>
      <property name="build.resources" value="${module.output}/resources"/>
      <property name="build.todo" value="${module.output}/todo"/>
      <property name="build.web" value="${module.output}/web"/>
      <property name="build.log" value="${module.output}/log"/>
      <property name="build.cache" value="${module.output}/cache"/>
      <property name="build.test" value="${module.output}/test"/>
      <property name="build.gen.test" value="${build.gen}/test"/>

    <!-- Module name & version -->
    <property name="module.name" value="jbossmx"/>
    <property name="module.Name" value="JBoss/JMX"/>

      <!-- xdoclet -->
      <path id="xdoclet.task.classpath">
        <path refid="javac.classpath"/>
        <fileset dir="${xdoclet.xdoclet.lib}">
          <include name="**/*.jar"/>
        </fileset>
      </path>
      <property name="xdoclet.task.classpath"
            refid="xdoclet.task.classpath"/>

      <!-- Where build generated files will go -->
      <property name="build.reports" value="${module.output}/reports"/>
      <property name="build.classes" value="${module.output}/classes"/>
      <property name="build.lib" value="${module.output}/lib"/>
      <property name="build.api" value="${module.output}/api"/>
      <property name="build.etc" value="${module.output}/etc"/>
      <property name="build.gen-src" value="${module.output}/gen-src"/>
      <property name="build.gen" value="${module.output}/gen"/>


    <!--+=======================================+-->
    <!--| Override any default properties here. |-->
    <!--+=======================================+-->

    <property name="javadoc.packages" value="javax.management.*, org.jboss.*"/>

    <!--+=======================================+-->
    <!--| Define module specific elements here. |-->
    <!--+=======================================+-->

    <property name="com.sun.jmx.trace.file"
              location="${module.output}/ri-testsuite.log"/>
    <property name="com.sun.jmx.trace.level" value="1"/>

    <!-- Properties used in serialization tests -->
    <property name="jboss.test.location.jmxri"
              location="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
    <property name="jboss.test.location.jbossmx"
              location="${build.lib}/jboss-jmx.jar"/>

    <path id="serialization.classpath">
        <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
       <path refid="thirdparty.classpath"/>
    </path>

  </target>


  <!--+====================================================================+-->
  <!--| Compile                                                            |-->
  <!--|                                                                    |-->
  <!--| This target should depend on other compile-* targets for each      |-->
  <!--| different type of compile that needs to be performed, short of     |-->
  <!--| documentation compiles.                                            |-->
  <!--+====================================================================+-->

  <target name="compile"
	  description="Compile all source files."
	  depends="init,
                   compile-classes,
                   compile-mbean-sources,
                   _default:compile-etc,
                   compile-resources">
    <!-- Add module specific elements here. -->
  </target>

  <target name="compile-classes" depends="compile-mbean-sources,_default:compile-classes"/>

    <!-- Compile mbeans with XDoclet -->
    <target name="compile-mbean-sources" depends="init">
        <taskdef name="jmxdoclet" classname="xdoclet.modules.jmx.JMXDocletTask" classpathref="xdoclet.task.classpath"/>

      <mkdir dir="${build.gen-src}"/>

    </target>

  <!-- Compile resource files (dtds) -->
  <target name="compile-resources" depends="init">
    <mkdir dir="${build.resources}"/>
    <copy todir="${build.resources}">
      <fileset dir="${source.resources}">
         <include name="dtd/*.dtd"/>
         <include name="*.xml"/>
      </fileset>
    </copy>
  </target>


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

  <target name="tests" depends="test-all"/>

  <!--+====================================================================+-->
  <!--| Generate Output                                                    |-->
  <!--|                                                                    |-->
  <!--| Generates the target output for this module. Target output is      |-->
  <!--| the output which is ment to be released or used by external        |-->
  <!--| modules.                                                           |-->
  <!--+====================================================================+-->

  <target name="output"
	  description="Generate all target output."
          depends="_buildmagic:build-bypass-check"
	  unless="build-bypass.on">

    <call target="compile"/>

    <mkdir dir="${build.lib}"/>

    <!-- Build the jboss-jmx.jar -->
    <jar jarfile="${build.lib}/jboss-jmx.jar" manifest="${build.etc}/default.mf">
      <fileset dir="${build.classes}">
        <include name="**"/>
        <exclude name="test/**"/>
      </fileset>
      <!-- include dtds for xmbeans -->
      <fileset dir="${build.resources}">
        <include name="dtd/*.dtd"/>
        <!-- include descriptor for MBean Info DB service -->
        <include name="*-xmbeandd.xml"/>
      </fileset>
      <!-- generated xmbean descriptors -->
      <fileset dir="${build.gen-src}">
        <include name="**/*.xml"/>
      </fileset>
      <!-- include dom4j-jarjar -->
      <zipfileset src="${jboss.dom4j.jarjar.lib}/dom4j-jarjar.jar">
        <include name="org/jboss/dom4j/**"/>
      </zipfileset>
    </jar>

    <!-- Build the jboss-jmx-core.jar -->
    <jar jarfile="${build.lib}/jboss-jmx-core.jar" manifest="${build.etc}/default.mf">
      <fileset dir="${build.classes}">
        <include name="**"/>
        <exclude name="javax/management/monitor/**"/>
        <exclude name="javax/management/openmbean/**"/>
        <exclude name="javax/management/relation/**"/>
        <exclude name="javax/management/timer/**"/>
        <exclude name="test/**"/>

        <!-- Exclude service utility classes -->
        <exclude name="org/jboss/mx/util/RunnableScheduler.class"/>
        <exclude name="org/jboss/mx/util/SchedulableRunnable.class"/>
        <exclude name="org/jboss/mx/util/ThreadPool*"/>

        <!-- Exclude all the query stuff except QueryExp -->
        <exclude name="javax/management/AndQueryExp.class"/>
        <exclude name="javax/management/AnySubStringQueryExp.class"/>
        <exclude name="javax/management/AttributeValueExp.class"/>
        <exclude name="javax/management/BadAttributeValueExpException.class"/>
        <exclude name="javax/management/BadBinaryOpValueExpException.class"/>
        <exclude name="javax/management/BadStringOperationException.class"/>
        <exclude name="javax/management/BetweenQueryExp.class"/>
        <exclude name="javax/management/BinaryComparisonQueryExp.class"/>
        <exclude name="javax/management/BinaryOpValueExp.class"/>
        <exclude name="javax/management/BooleanValueExp.class"/>
        <exclude name="javax/management/ClassAttributeValueExp.class"/>
        <exclude name="javax/management/FinalSubStringQueryExp.class"/>
        <exclude name="javax/management/InQueryExp.class"/>
        <exclude name="javax/management/InitialSubStringQueryExp.class"/>
        <exclude name="javax/management/InvalidApplicationException.class"/>
        <exclude name="javax/management/MatchQueryExp.class"/>
        <exclude name="javax/management/NotQueryExp.class"/>
        <exclude name="javax/management/NumberValueExp.class"/>
        <exclude name="javax/management/OrQueryExp.class"/>
        <exclude name="javax/management/QualifiedAttributeValueExp.class"/>
        <exclude name="javax/management/Query.class"/>
        <exclude name="javax/management/QueryEval.class"/>
        <exclude name="javax/management/QueryExpSupport.class"/>
        <exclude name="javax/management/SingleValueExpSupport.class"/>
        <exclude name="javax/management/StringValueExp.class"/>
        <exclude name="javax/management/ValueExp.class"/>
        <exclude name="javax/management/ValueExpSupport.class"/>
      </fileset>
      <!-- include dtds for xmbeans -->
      <fileset dir="${build.resources}">
        <include name="dtd/*.dtd"/>
        <!-- include descriptor for MBean Info DB service -->
        <include name="*-xmbeandd.xml"/>
      </fileset>
    </jar>

    <!-- Build the jboss-jmx-services.jar -->
    <jar jarfile="${build.lib}/jboss-jmx-services.jar" manifest="${build.etc}/default.mf">
      <fileset dir="${build.classes}">
        <include name="javax/management/monitor/**"/>
        <include name="javax/management/openmbean/**"/>
        <include name="javax/management/relation/**"/>
        <include name="javax/management/timer/**"/>

        <!-- Include service utility classes -->
        <include name="org/jboss/mx/util/RunnableScheduler.class"/>
        <include name="org/jboss/mx/util/SchedulableRunnable.class"/>
        <include name="org/jboss/mx/util/ThreadPool*"/>

        <!-- Include all the query stuff except QueryExp -->
        <include name="javax/management/AndQueryExp.class"/>
        <include name="javax/management/AnySubStringQueryExp.class"/>
        <include name="javax/management/AttributeValueExp.class"/>
        <include name="javax/management/BadAttributeValueExpException.class"/>
        <include name="javax/management/BadBinaryOpValueExpException.class"/>
        <include name="javax/management/BadStringOperationException.class"/>
        <include name="javax/management/BetweenQueryExp.class"/>
        <include name="javax/management/BinaryComparisonQueryExp.class"/>
        <include name="javax/management/BinaryOpValueExp.class"/>
        <include name="javax/management/BooleanValueExp.class"/>
        <include name="javax/management/ClassAttributeValueExp.class"/>
        <include name="javax/management/FinalSubStringQueryExp.class"/>
        <include name="javax/management/InQueryExp.class"/>
        <include name="javax/management/InitialSubStringQueryExp.class"/>
        <include name="javax/management/InvalidApplicationException.class"/>
        <include name="javax/management/MatchQueryExp.class"/>
        <include name="javax/management/NotQueryExp.class"/>
        <include name="javax/management/NumberValueExp.class"/>
        <include name="javax/management/OrQueryExp.class"/>
        <include name="javax/management/QualifiedAttributeValueExp.class"/>
        <include name="javax/management/Query.class"/>
        <include name="javax/management/QueryEval.class"/>
        <include name="javax/management/QueryExpSupport.class"/>
        <include name="javax/management/SingleValueExpSupport.class"/>
        <include name="javax/management/StringValueExp.class"/>
        <include name="javax/management/ValueExp.class"/>
        <include name="javax/management/ValueExpSupport.class"/>
      </fileset>
    </jar>

    <!-- Build the jboss-jmx-testsuite.jar -->
    <jar jarfile="${build.lib}/jboss-jmx-testsuite.jar">
      <fileset dir="${build.classes}">
        <include name="test/**"/>
        <exclude name="test/compliance/loading/support/*.class"/>
        <exclude name="test/compliance/server/support/AClass.*"/>
        <exclude name="test/implementation/loading/support/*.class"/>
      </fileset>
      <fileset dir="${source.resources}/test/log4j">
        <include name="log4j.properties"/>
      </fileset>
      <!--wait for xdoclet 1.1.2
      <fileset dir="${build.gen-src}">
        <include name="test/implementation/modelmbean/support/User.xml"/>
      </fileset-->
    </jar>

    <mkdir dir="${build.etc}/test/compliance/loading"/>
    <mkdir dir="${build.etc}/test/compliance/server"/>
    <mkdir dir="${build.etc}/test/implementation/loading"/>

    <jar jarfile="${build.etc}/test/compliance/loading/MyMBeans.jar">
      <fileset dir="${build.classes}">
        <include name="test/compliance/loading/support/Trivial.class"/>
        <include name="test/compliance/loading/support/Trivial2.class"/>
        <include name="test/compliance/loading/support/TrivialMBean.class"/>
        <include name="test/compliance/loading/support/Trivial2MBean.class"/>
        <include name="test/compliance/loading/support/Another*.class"/>
      </fileset>
    </jar>

    <jar jarfile="${build.etc}/test/compliance/loading/MyMBeans2.jar">
      <fileset dir="${build.classes}">
        <include name="test/compliance/loading/support/Trivial*.class"/>
      </fileset>
    </jar>

    <jar jarfile="${build.etc}/test/compliance/loading/MoreMBeans.jar">
      <fileset dir="${build.classes}">
        <include name="test/compliance/loading/support/AClass.class"/>
      </fileset>
    </jar>

    <jar jarfile="${build.etc}/test/implementation/loading/MyMBeans.jar">
      <fileset dir="${build.classes}">
        <include name="test/implementation/loading/support/Trivial*.class"/>
      </fileset>
    </jar>

    <jar jarfile="${build.etc}/test/compliance/server/Test.jar">
      <fileset dir="${build.classes}">
        <include name="test/compliance/server/support/AClass.class"/>
      </fileset>
    </jar>

    <copy todir="${build.etc}">
      <fileset dir="${source.resources}">
        <include name="test/compliance/loading/*.mlet"/>
        <include name="test/implementation/loading/*.mlet"/>
      </fileset>
    </copy>

    <mkdir dir="${build.etc}/test/implementation/loading"/>

    <jar jarfile="${build.etc}/test/implementation/loading/Start.jar">
      <fileset dir="${build.classes}">
        <include name="test/implementation/loading/support/Start*.class"/>
        <include name="test/implementation/loading/support/AClass.class"/>
      </fileset>
    </jar>

    <jar jarfile="${build.etc}/test/implementation/loading/Target.jar">
      <fileset dir="${build.classes}">
        <include name="test/implementation/loading/support/Target*.class"/>
        <include name="test/implementation/loading/support/AClass.class"/>
      </fileset>
    </jar>

    <!-- added for MBean info persistence -->
    <!-- @todo: someone familiar with the build system might want to find a better way to do this. -->
    <!-- copy service to the lib folder -->
    <copy todir="${build.lib}">
      <fileset dir="${build.resources}">
        <include name="*-service.xml"/>
      </fileset>
    </copy>

    <!-- Update the build marker to allow bypassing -->
    <touch file="${build-bypass.marker}"/>

  </target>


  <!--+====================================================================+-->
  <!--| Documents                                                          |-->
  <!--|                                                                    |-->
  <!--| Generate all documentation for this module.                        |-->
  <!--+====================================================================+-->

<!--  <target name="docs" depends="_default:docs">
  </target> -->


  <!--+====================================================================+-->
  <!--| Misc.                                                              |-->
  <!--|                                                                    |-->
  <!--| Standard targets and psuedo-targets.                               |-->
  <!--+====================================================================+-->

  <target name="clean" depends="_default:clean">
    <!-- Add module specific elements here. -->
  </target>

  <target name="clobber" depends="_default:clobber">
    <!-- Add module specific elements here. -->
  </target>

  <!-- main, all, most and help are primary psuedo-targets -->
  <target name="main" depends="most"/>
  <target name="all" depends="_default:all"/>
  <target name="most" depends="_default:most"/>
  <target name="help" depends="_default:help"/>


  <!--+====================================================================+-->
  <!--| Custom                                                             |-->
  <!--|                                                                    |-->
  <!--| Custom module targets.                                             |-->
  <!--+====================================================================+-->

  <!-- ================================================================== -->
  <!-- Run ALL the test suites                                            -->
  <!-- ================================================================== -->

  <target name="test-all"
          depends="test-compliance,test-implementation,test-performance,test-serialization,test-stress"
          description="Run ALL test suites"/>

  <!-- ================================================================== -->
  <!-- FULL Compliance - Run the complicance suite including long test    -->
  <!-- ================================================================== -->

  <!--
     | There are three targets, one for the RI, one for JBossMX and one for both.
     | WARNING, everthing is compiled over JBossMX
   -->


  <!-- IBM Tivoli FULL Implementation compliance -->
  <!--
  <target name="test-compliance-full-Tivoli" depends="jars"
          description="Run FULL compliance test against IBM Tivoli">

   <path id="compliance.Tivoli.classpath">
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxx.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxc.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/log.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.compliance.FullComplianceSUITE" fork="true">
      <classpath refid="compliance.Tivoli.classpath"/>
   </java>
  </target>
  -->

  <!-- Reference FULL Implementation compliance -->
  <target name="test-compliance-full-RI" depends="output"
          description="Run FULL compliance test against RI">

    <path id="compliance.RI.classpath">
       <pathelement path="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
       <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
       <path refid="thirdparty.classpath"/>
    </path>

    <java classname="test.compliance.FullComplianceSUITE" fork="true">
       <classpath refid="compliance.RI.classpath"/>
    </java>

  </target>

  <!-- JBossMX FULL Implementation compliance -->
  <target name="test-compliance-full-JBossMX" depends="output"
          description="Run FULL compliance test against JBossMX">

    <path id="compliance.JBossMX.classpath">
      <pathelement path="${build.lib}/jboss-jmx.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
    </path>

    <java classname="test.compliance.FullComplianceSUITE" fork="true">
       <classpath refid="compliance.JBossMX.classpath"/>
    </java>

  </target>

  <!-- Run both FULL compliance tests -->
  <target name="test-compliance-full" depends="test-compliance-full-RI, test-compliance-full-JBossMX"
          description="Run FULL compliance test against RI and JBossMX">
  </target>


  <!-- ================================================================== -->
  <!-- Compliance - Run the complicance suite                             -->
  <!-- ================================================================== -->

  <!--
     | There are three targets, one for the RI, one for JBossMX and one for both.
     | WARNING, everthing is compiled over JBossMX
   -->


  <!-- IBM Tivoli Implementation compliance -->
  <!--
  <target name="test-compliance-Tivoli" depends="output"
          description="Run compliance test against IBM Tivoli">

   <path id="compliance.Tivoli.classpath">
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxx.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxc.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/log.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.compliance.ComplianceSUITE" fork="true">
      <classpath refid="compliance.Tivoli.classpath"/>
   </java>
  </target>
  -->

  <!-- Reference Implementation compliance -->
  <target name="test-compliance-RI" depends="output"
          description="Run compliance test against RI">

    <path id="compliance.RI.classpath">
       <pathelement path="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
       <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
       <path refid="thirdparty.classpath"/>
    </path>

    <java classname="test.compliance.ComplianceSUITE" fork="true">
       <classpath refid="compliance.RI.classpath"/>
       <sysproperty key="com.sun.jmx.trace.file"
                value="${com.sun.jmx.trace.file}"/>
       <sysproperty key="com.sun.jmx.trace.level"
                value="${com.sun.jmx.trace.level}"/>
    </java>

  </target>

  <!-- JBossMX Implementation compliance -->
  <target name="test-compliance-JBossMX" depends="output"
          description="Run compliance test against JBossMX">

    <path id="compliance.JBossMX.classpath">
      <pathelement path="${build.lib}/jboss-jmx.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
    </path>

    <java classname="test.compliance.ComplianceSUITE" fork="true">
       <classpath refid="compliance.JBossMX.classpath"/>
    </java>

    <!--
    <java classname="test.compliance.ComplianceSUITE" fork="true">
      <classpath refid="compliance.JBossMX.classpath"/>
      <sysproperty key="jbossmx.optimized.dispatcher" value="true"/>
    </java>
    -->

  </target>

  <!-- JBossMX Implementation compliance -->
  <target name="test-compliance-JBossMX-RI" depends="output"
          description="Run compliance test against JBossMX on top of the RI">

    <path id="compliance.JBossMX.RI.classpath">
       <pathelement path="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
       <pathelement path="${build.lib}/jboss-jmx.jar"/>
       <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
       <path refid="thirdparty.classpath"/>
    </path>

    <java classname="test.compliance.ComplianceSUITE" fork="true">
       <classpath refid="compliance.JBossMX.RI.classpath"/>
       <sysproperty key="javax.management.builder.initial"
                value="org.jboss.mx.server.MBeanServerBuilderImpl"/>
       <sysproperty key="com.sun.jmx.trace.file"
                value="${com.sun.jmx.trace.file}"/>
       <sysproperty key="com.sun.jmx.trace.level"
                value="${com.sun.jmx.trace.level}"/>
    </java>

  </target>

  <!-- Run both compliance tests -->
  <target name="test-compliance" depends="test-compliance-RI, test-compliance-JBossMX"
          description="Run compliance test against RI and JBossMX">
  </target>

  <!-- ================================================================== -->
  <!-- Performance - Runs the performance test suite                      -->
  <!-- ================================================================== -->

  <!--
     | There are three targets, one for the RI, one for JBossMX and one for both.
     | WARNING, everthing is compiled over JBossMX
   -->

  <!-- IBM Tivoli Implementation performance -->
  <!--
  <target name="test-performance-Tivoli" depends="output"
          description="Run performance test against IBM Tivoli">

   <path id="performance.Tivoli.classpath">
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxx.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/jmxc.jar"/>
      <pathelement path="${project.thirdparty}/ibm/tivoli/jmx/lib/log.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.performance.PerformanceSUITE" fork="true">
      <classpath refid="performance.Tivoli.classpath"/>
   </java>
  </target>
  -->

  <!-- Reference Implementation performance -->
  <target name="test-performance-RI" depends="output"
          description="Run performance test against RI">

   <path id="performance.RI.classpath">
      <pathelement path="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.performance.PerformanceSUITE" fork="true">
      <classpath refid="performance.RI.classpath"/>
   </java>
  </target>

  <!-- JBossMX Implementation performance -->
  <target name="test-performance-JBossMX" depends="output"
          description="Run performance test against JBossMX">

   <path id="performance.JBossMX.classpath">
      <pathelement path="${build.lib}/jboss-jmx.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.performance.PerformanceSUITE" fork="true">
      <classpath refid="performance.JBossMX.classpath"/>
   </java>
  </target>

  <!-- Run both performance tests -->
  <target name="test-performance" depends="test-performance-RI, test-performance-JBossMX"
          description="Run performance test against RI and JBossMX">
  </target>

  <!-- ================================================================== -->
  <!-- Implementation - tests the JBossMX implementation classes.         -->
  <!-- ================================================================== -->
  <target name="test-implementation" depends="output"
          description="Tests JBossMX implementation classes">

   <path id="implementation.JBossMX.classpath">
      <pathelement path="${build.lib}/jboss-jmx.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.implementation.ImplementationSUITE" fork="true">
      <classpath refid="implementation.JBossMX.classpath"/>
      <sysproperty key="force.jvm.exit" value="true"/>
   </java>

   <!--
   <java classname="test.implementation.ImplementationSUITE" fork="true">
      <classpath refid="implementation.JBossMX.classpath"/>
      <sysproperty key="jbossmx.optimized.dispatcher" value="true"/>
      <sysproperty key="force.jvm.exit" value="true"/>
   </java>
   -->

  </target>

  <!-- ================================================================== -->
  <!-- Serialization  - tests the JBossMX serialization compatibility     -->
  <!--                  with the RI                                       -->
  <!-- ================================================================== -->
  <target name="test-serialization-1.0" depends="output"
          description="Tests JBossMX serialization with jmx 1.0">

   <java classname="test.serialization.SerializationSUITE" fork="true">
      <classpath refid="serialization.classpath"/>
      <sysproperty key="jboss.test.location.jmxri"
                   value="${jboss.test.location.jmxri}"/>
      <sysproperty key="jboss.test.location.jbossmx"
                   value="${jboss.test.location.jbossmx}"/>
      <sysproperty key="jmx.serial.form" value="1.0"/>
   </java>
  </target>

  <target name="test-serialization-latest" depends="output"
          description="Tests JBossMX serialization with latest RI">

   <java classname="test.serialization.SerializationSUITE" fork="true">
      <classpath refid="serialization.classpath"/>
      <sysproperty key="jboss.test.location.jmxri"
                   value="${jboss.test.location.jmxri}"/>
      <sysproperty key="jboss.test.location.jbossmx"
                   value="${jboss.test.location.jbossmx}"/>
      <sysproperty key="jboss.test.location.jbossmx"
                   value="${jboss.test.location.jbossmx}"/>
   </java>
  </target>

  <target name="test-serialization"
          depends="test-serialization-1.0, test-serialization-latest"
          description="Tests all JBossMX serialization with latest RI">
  </target>

  <!-- ================================================================== -->
  <!-- Stress - tests under stress conditions                             -->
  <!-- ================================================================== -->

  <!--
     | There are three targets, one for the RI, one for JBossMX and one for both.
     | WARNING, everthing is compiled over JBossMX
   -->

  <!-- Reference Implementation stress -->
  <target name="test-stress-RI" depends="output"
          description="Run stress test against RI">

   <path id="stress.RI.classpath">
      <pathelement path="${project.thirdparty}/sun-jmx/lib/jmxri.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.stress.StressSUITE" fork="true">
      <classpath refid="stress.RI.classpath"/>
   </java>
  </target>

  <!-- JBossMX stress -->
  <target name="test-stress-JBossMX" depends="output"
          description="Tests JBossMX under stress">

   <path id="stress.JBossMX.classpath">
      <pathelement path="${build.lib}/jboss-jmx.jar"/>
      <pathelement path="${build.lib}/jboss-jmx-testsuite.jar"/>
      <path refid="thirdparty.classpath"/>
   </path>

   <java classname="test.stress.StressSUITE" fork="true">
      <classpath refid="stress.JBossMX.classpath"/>
   </java>
  </target>

  <!-- Run both stress tests -->
  <target name="test-stress" depends="test-stress-RI, test-stress-JBossMX"
          description="Run stress test against RI and JBossMX">
  </target>


</project>
