Author: rhs
Date: Wed Dec 3 11:34:40 2008
New Revision: 723029
URL: http://svn.apache.org/viewvc?rev=723029&view=rev
Log:
made ant build generate perftest scripts
Added:
incubator/qpid/trunk/qpid/java/lib/jython-2.2-rc2.jar
- copied unchanged from r721165,
incubator/qpid/trunk/qpid/java/common/jython-2.2-rc2.jar
incubator/qpid/trunk/qpid/java/lib/jython-lib.jar
- copied unchanged from r721165,
incubator/qpid/trunk/qpid/java/common/jython-lib.jar
incubator/qpid/trunk/qpid/java/perftests/etc/perftests.log4j
- copied, changed from r721165,
incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
incubator/qpid/trunk/qpid/java/perftests/generate-scripts
incubator/qpid/trunk/qpid/java/perftests/scripts.xml
Removed:
incubator/qpid/trunk/qpid/java/common/jython-2.2-rc2.jar
incubator/qpid/trunk/qpid/java/common/jython-lib.jar
incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
Modified:
incubator/qpid/trunk/qpid/java/common.xml
incubator/qpid/trunk/qpid/java/common/build.xml
incubator/qpid/trunk/qpid/java/perftests/build.xml
Modified: incubator/qpid/trunk/qpid/java/common.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common.xml?rev=723029&r1=723028&r2=723029&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common.xml (original)
+++ incubator/qpid/trunk/qpid/java/common.xml Wed Dec 3 11:34:40 2008
@@ -39,7 +39,7 @@
<property name="build.data" location="${build}/data"/>
<property name="build.plugins" location="${build}/lib/plugins"/>
<property name="build.coveragereport" location="${build}/coverage"/>
-
+
<property name="java.target" value="1.5"/>
<property name="java.source" value="1.5"/>
@@ -52,6 +52,7 @@
<property name="javac.compiler.args" value=""/>
<property name="cobertura.dir" value="${project.root}/lib/cobertura" />
+ <property name="mllib.dir" value="${project.root}/../python" />
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
@@ -61,7 +62,7 @@
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
-
+
<macrodef name="indirect">
<attribute name="name"/>
<attribute name="variable"/>
@@ -89,6 +90,21 @@
</sequential>
</macrodef>
+ <macrodef name="jython">
+ <attribute name="path"/>
+ <element name="args"/>
+ <sequential>
+ <java classname="org.python.util.jython" fork="true" failonerror="true">
+ <arg value="-Dpython.cachedir.skip=true"/>
+ <arg value="-Dpython.path=${project.root}/lib/jython-lib.jar/[EMAIL
PROTECTED]"/>
+ <args/>
+ <classpath>
+ <pathelement location="${project.root}/lib/jython-2.2-rc2.jar"/>
+ </classpath>
+ </java>
+ </sequential>
+ </macrodef>
+
<mkdir dir="${tasks.classes}"/>
<javac source="${java.source}" target="${java.target}" srcdir="${tasks.src}"
destdir="${tasks.classes}" classpath="${java.class.path}">
<compilerarg line="${javac.compiler.args}"/>
Modified: incubator/qpid/trunk/qpid/java/common/build.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/build.xml?rev=723029&r1=723028&r2=723029&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/build.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/build.xml Wed Dec 3 11:34:40 2008
@@ -28,7 +28,6 @@
<property name="xml.spec.dir" location="${project.root}/../specs" />
<property name="xml.spec.deps" value="amqp.0-8.xml amqp.0-9.xml" />
<property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-8.xml
${xml.spec.dir}/amqp.0-9.xml" />
- <property name="mllib.dir" value="${project.root}/../python" />
<property name="gentools.timestamp"
location="${generated.dir}/gentools.timestamp" />
<property name="jython.timestamp"
location="${generated.dir}/jython.timestamp" />
@@ -39,17 +38,14 @@
</target>
<target name="jython" depends="check_jython_deps"
unless="jython.notRequired">
- <java classname="org.python.util.jython" fork="true" failonerror="true">
- <arg value="-Dpython.cachedir.skip=true"/>
- <arg
value="-Dpython.path=${basedir}/jython-lib.jar/Lib${path.separator}${mllib.dir}"/>
- <arg value="${basedir}/codegen"/>
- <arg value="${module.precompiled}"/>
- <arg value="${xml.spec.dir}/amqp.0-10-qpid-errata.xml"/>
- <arg value="${basedir}"/>
- <classpath>
- <pathelement location="jython-2.2-rc2.jar"/>
- </classpath>
- </java>
+ <jython path="${mllib.dir}">
+ <args>
+ <arg value="${basedir}/codegen"/>
+ <arg value="${module.precompiled}"/>
+ <arg value="${xml.spec.dir}/amqp.0-10-qpid-errata.xml"/>
+ <arg value="${basedir}"/>
+ </args>
+ </jython>
<touch file="${jython.timestamp}" />
</target>
Modified: incubator/qpid/trunk/qpid/java/perftests/build.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/build.xml?rev=723029&r1=723028&r2=723029&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/build.xml (original)
+++ incubator/qpid/trunk/qpid/java/perftests/build.xml Wed Dec 3 11:34:40 2008
@@ -30,11 +30,23 @@
<property name="qpid.logging.level" value="-Damqj.logging.level=warn"/>
<property name="log4j.config"
value="-Dlog4j.configuration=perftests.log4j"/>
<property name="properties" value="perftests.properties"/>
+ <property name="scripts.dir" value="${build.bin}/${module.name}"/>
<condition property="results" value="${result-path}/results"
else="${project.root}/${module}/results">
<isset property="result-path"/>
</condition>
+ <target name="precompile">
+ <mkdir dir="${scripts.dir}"/>
+ <jython path="${mllib.dir}">
+ <args>
+ <arg value="generate-scripts"/>
+ <arg value="scripts.xml"/>
+ <arg value="${scripts.dir}"/>
+ </args>
+ </jython>
+ </target>
+
<target name="all-tests" depends="all-queue-tests,all-topic-tests"/>
<target name="all-queue-tests"
depends="Queue-Duration-Persistent,Queue-Concurrent,
Copied: incubator/qpid/trunk/qpid/java/perftests/etc/perftests.log4j (from
r721165, incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j)
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/etc/perftests.log4j?p2=incubator/qpid/trunk/qpid/java/perftests/etc/perftests.log4j&p1=incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j&r1=721165&r2=723029&rev=723029&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/etc/perftests.log4j Wed Dec 3
11:34:40 2008
@@ -19,6 +19,8 @@
log4j.rootLogger=${root.logging.level}
+log4j.logger.org.apache.mina=${amqj.logging.level}
+
log4j.logger.org.apache.qpid=${amqj.logging.level}, console
log4j.additivity.org.apache.qpid=false
@@ -27,9 +29,8 @@
log4j.logger.org.apache.qpid.ping=${amqj.test.logging.level}
log4j.logger.org.apache.qpid.topic=${amqj.test.logging.level}
-
-log4j.logger.uk.co.thebadgerset.junit.extensions=${badger.level}, console
-log4j.additivity.uk.co.thebadgerset.junit.extensions=false
+log4j.logger.org.apache.qpid.junit.extensions=${badger.level}, console
+log4j.additivity.org.apache.qpid.junit.extensions=false
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=all
Added: incubator/qpid/trunk/qpid/java/perftests/generate-scripts
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/generate-scripts?rev=723029&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/generate-scripts (added)
+++ incubator/qpid/trunk/qpid/java/perftests/generate-scripts Wed Dec 3
11:34:40 2008
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+#
+# 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import os, sys, mllib
+
+template = """#!/bin/bash
+#
+# 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+if [ -z "$QPID_HOME" ]; then
+ export QPID_HOME=$(dirname $(dirname $(dirname $(readlink -f $0))))
+ export PATH=${PATH}:${QPID_HOME}/bin
+fi
+
+# Parse arguements taking all - prefixed args as JAVA_OPTS
+for arg in "$@"; do
+ if [[ $arg == -java:* ]]; then
+ JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
+ else
+ ARGS="${ARGS}$arg "
+ fi
+done
+
+# Set classpath to include Qpid jar with all required jars in manifest
+QPID_LIBS=$QPID_HOME/lib/qpid-incubating.jar
+
+# Set other variables used by the qpid-run script before calling
+export JAVA=java \
+ JAVA_VM=-server \
+ JAVA_MEM=-Xmx1024m \
+ QPID_CLASSPATH=$QPID_LIBS
+
+. qpid-run -Xms256m
-Dlog4j.configuration=file://${QPID_HOME}/etc/perftests.log4j
-Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn
org.apache.qpid.junit.extensions.TKTestRunner %s ${ARGS}
+"""
+
+doc = mllib.xml_parse(sys.argv[1])
+dir = sys.argv[2]
+for s in doc.query["scripts/script"]:
+ file = open(os.path.join(dir, "%s.sh" % s["@name"]), "w")
+ file.write(template % s.text())
+ file.close()