[jboss-svn-commits] JBL Code SVN: r29663 - in labs/jbosstm/workspace/whitingjr/trunk/performance: src/main/java/org/jboss/application and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 19 09:46:17 EDT 2009
Author: whitingjr
Date: 2009-10-19 09:46:16 -0400 (Mon, 19 Oct 2009)
New Revision: 29663
Modified:
labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml
labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/java/org/jboss/application/Demo.java
labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile.properties
Log:
Updated build script. Working execution of Demo application.
Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml 2009-10-19 13:45:27 UTC (rev 29662)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml 2009-10-19 13:46:16 UTC (rev 29663)
@@ -16,7 +16,31 @@
<include name="*.jar" />
</fileset>
+ <property name="JIP_HOME" value="/home/whitingjr/java/jip" />
+ <path id="ant.classpath">
+ <pathelement path="${ant.home}/lib/ant" />
+ <pathelement path="${ant.home}/lib/optional.jar" />
+ <pathelement path="${ant.home}/lib/ant.jar" />
+ <pathelement path="${ant.home}/lib/ant-launcher.jar" />
+ </path>
+
+ <path id="demo.compile.classpath">
+ <path refid="project.classpath" />
+ <pathelement path="/home/whitingjr/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar" />
+ </path>
+
+ <path id="demo.run.classpath">
+ <path refid="demo.compile.classpath" />
+ <pathelement path="build/classes"/>
+ <pathelement path="src/main/resources"/>
+ </path>
+
+ <path id="demo.test.classpath">
+ <path refid="demo.run.classpath" />
+ <pathelement path="src/test/resources"/>
+ </path>
+
<target name="check-arguments">
<fail message="Usage: ant ${required-args}">
@@ -81,12 +105,47 @@
</not>
</condition>
</fail>
+ </target>
+ <target name="prepare" depends="check-arguments, check-setup">
+ <delete dir="build" />
+ <mkdir dir="build" />
+ <mkdir dir="build/classes" />
+
</target>
+ <target name="compile-demo" depends="prepare">
+ <javac srcdir="src/main/java" destdir="${build.classes.dir}" classpathref="demo.compile.classpath" />
+ <javac srcdir="src/test/java" destdir="${build.classes.dir}" classpathref="demo.run.classpath" />
+ </target>
- <target name="prepare" depends="check-arguments, check-setup">
+ <target name="call-profile-demo" depends="compile-demo">
+ <!--java classname="org.apache.tools.ant.launch.Launcher" fork="yes">
+ <jvmarg value="-javaagent:${JIP_HOME}/profile/profile.jar" />
+ <jvmarg value="-Dprofile.properties=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/src/main/resources/profile-ant-demo.properties" />
+ <arg value="-Dant.home=${ant.home}" />
+ <arg value="-Dant.library.dir=${ant.home}/lib" />
+ <arg value="run-demo-test" />
+ <classpath>
+ <path refid="ant.classpath"/>
+ <path refid="demo.run.classpath"/>
+ </classpath>
+ </java-->
+ </target>
+ <target name="run-demo-test" depends="compile-demo" description="task to call the Demo application with profiling enabled.">
+ <delete dir="${test.output.dir}"/>
+ <mkdir dir="${test.output.dir}"/>
+ <testng outputDir="${test.output.dir}">
+ <jvmarg value="-javaagent:${JIP_HOME}/profile/profile.jar" />
+ <jvmarg value="-Dprofile.properties=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/src/main/resources/profile-ant-demo.properties" />
+ <classpath>
+ <path refid="demo.test.classpath" />
+ </classpath>
+ <xmlfileset dir="src/test/resources">
+ <include name="testsuite-integration-demo.xml" />
+ </xmlfileset>
+ </testng>
</target>
<target name="profile" depends="prepare">
Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/java/org/jboss/application/Demo.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/java/org/jboss/application/Demo.java 2009-10-19 13:45:27 UTC (rev 29662)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/java/org/jboss/application/Demo.java 2009-10-19 13:46:16 UTC (rev 29663)
@@ -16,6 +16,9 @@
private static final String DATABASE = "database Activity.";
private static final String ORM = "orm Activity.";
private static final String DISK = "disk Activity.";
+ /**
+ * Used multi threading classes to achieve delays. Should have used the Timer api instead.
+ */
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Callable<Boolean> callApplication = new Callable<Boolean>()
{
@@ -29,13 +32,11 @@
public static void main(String[] args)
{
+ logger.info(Thread.currentThread().getContextClassLoader().getClass().getName());
+
Demo application = new Demo();
- while (true)
- {
- application.applicationActivity();
- logger.info(DONE);
- break;
- }
+ application.applicationActivity();
+ logger.info(DONE);
}
@Override
public void applicationActivity()
Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile.properties
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile.properties 2009-10-19 13:45:27 UTC (rev 29662)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile.properties 2009-10-19 13:46:16 UTC (rev 29663)
@@ -46,10 +46,10 @@
# What is the default file name for the profile information
# default=./profile.txt
#
-#file=/tmp/profile.txt
+file=/tmp/profile.txt
#
# specify a directory and jip will create uniquely named files.
-file=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/logs
+#file=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/logs
#
# What packages are excluded from the display
# (comma separated)
More information about the jboss-svn-commits
mailing list