[jboss-svn-commits] JBL Code SVN: r34739 - in labs/jbosstm/trunk/qa: tests/src/org/jboss/jbossts/qa/ArjunaCore/Common and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Aug 16 07:52:53 EDT 2010


Author: jhalliday
Date: 2010-08-16 07:52:52 -0400 (Mon, 16 Aug 2010)
New Revision: 34739

Modified:
   labs/jbosstm/trunk/qa/TaskImpl.properties
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/Common/UidTest.java
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TestGroupBase.java
Log:
Add emma coverage to the qa tests. JBTM-682


Modified: labs/jbosstm/trunk/qa/TaskImpl.properties
===================================================================
--- labs/jbosstm/trunk/qa/TaskImpl.properties	2010-08-16 04:20:54 UTC (rev 34738)
+++ labs/jbosstm/trunk/qa/TaskImpl.properties	2010-08-16 11:52:52 UTC (rev 34739)
@@ -18,7 +18,7 @@
 COMMAND_LINE_0=/qa/tools/opt/jdk1.6.0_11/bin/java
 # use this form to inherit the java version used by ant:
 #COMMAND_LINE_0=${java.home}${file.separator}bin${file.separator}java
-#COMMAND_LINE_0=/usr/local/jdk1.6.0_18/bin/java
+#COMMAND_LINE_0=/usr/local/jdk1.6.0_21/bin/java
 #
 COMMAND_LINE_1=-classpath
 #
@@ -39,7 +39,8 @@
   ${path.separator}ext${file.separator}jboss-profiler-jvmti.jar${path.separator}ext${file.separator}jboss-logging-spi.jar\
   ${path.separator}tests${file.separator}build${file.separator}jbossts-jts-qa.jar\
   ${path.separator}..${file.separator}ArjunaJTS${file.separator}jts${file.separator}build${file.separator}lib${file.separator}jts_tests.jar\
-  ${path.separator}dbdrivers${file.separator}selected_dbdriver${file.separator}*
+  ${path.separator}dbdrivers${file.separator}selected_dbdriver${file.separator}*\
+  ${path.separator}..${file.separator}build${file.separator}extlib${file.separator}emma.jar
 #
 # properties used by the tests or test framework:
 #

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/Common/UidTest.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/Common/UidTest.java	2010-08-16 04:20:54 UTC (rev 34738)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/Common/UidTest.java	2010-08-16 11:52:52 UTC (rev 34739)
@@ -155,7 +155,7 @@
 
 	public int mNumberOfThreads;
 	public int mNumberOfUids;
-	public String mCommand = "java -cp " + System.getProperty("java.class.path") + " org.jboss.jbossts.qa.ArjunaCore.Common.UidTestWorker";
+	public String mCommand = "java -Demma.verbosity.level=silent -cp " + System.getProperty("java.class.path") + " org.jboss.jbossts.qa.ArjunaCore.Common.UidTestWorker";
 	public ArrayList mUidList = new ArrayList();
 	private UidTestProcess[] mUidSubProcess;
 }

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java	2010-08-16 04:20:54 UTC (rev 34738)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java	2010-08-16 11:52:52 UTC (rev 34739)
@@ -134,7 +134,13 @@
      * an output stream to which the contents of the task's stdout and stderr are redirected.
      */
     private PrintStream out;
+
     /**
+     * Name of a file to which emma code coverage should be written
+     */
+    private String emmaCoverageFile;
+
+    /**
      * a thread which reads the task's merged stdout/stderr stream and identifies whether or not a Passed/Failed
      * or a Ready message has been printed. the reader thread alos needs to write the output to a log file.
      */
@@ -152,8 +158,9 @@
      * @param type the type of the test either PASS_FAIL or READY
      * @param out the output stream to which output from the task's process shoudl be redirected.
      * @param timeout the timeout for the task in seconds
+     * @param emmaCoverageFile name of a file to which emma code coverage should be written
      */
-    TaskImpl(String taskName, Class clazz, TaskType type, PrintStream out, int timeout)
+    TaskImpl(String taskName, Class clazz, TaskType type, PrintStream out, int timeout, String emmaCoverageFile)
     {
         if(clazz == null || type == null) {
             throw new ExceptionInInitializerError("TaskImpl()<ctor> params may not be null");
@@ -164,6 +171,7 @@
         this.type = type;
         this.timeout = timeout;
         this.out = out;
+        this.emmaCoverageFile = emmaCoverageFile;
         this.started = false;
         this.isDone = false;
         this.isTimedOut = false;
@@ -531,7 +539,7 @@
 
         int i = 0;
         boolean done = false;
-        List<String> list = new LinkedList();
+        List<String> list = new LinkedList<String>();
         while(!done) {
             String element = properties.getProperty("COMMAND_LINE_"+i);
             if(element == null) {
@@ -544,6 +552,11 @@
 
         list.addAll(additionalCommandLineElements);
 
+        if(emmaCoverageFile != null) {
+            list.add("-Demma.coverage.out.file="+emmaCoverageFile);
+            //list.add("-Demma.verbosity.level=silent");
+        }
+
         list.add(classname);
 
         if(params != null) {

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TestGroupBase.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TestGroupBase.java	2010-08-16 04:20:54 UTC (rev 34738)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TestGroupBase.java	2010-08-16 11:52:52 UTC (rev 34739)
@@ -114,6 +114,7 @@
 
     protected Task createTask(String taskName, Class clazz, Task.TaskType taskType, int timeout) {
         OutputStream out;
+
         String filename = "./testoutput/"+getTestGroupName()+"/"+(testName.getMethodName() == null ? "" : testName.getMethodName())+
                 (testName.getParameterSetNumber() == null ? "" : "_paramSet"+testName.getParameterSetNumber())+"/"+taskName+"_output.txt";
         try {
@@ -127,7 +128,9 @@
             }
             out = new FileOutputStream(outFile);
 
-            return new TaskImpl(taskName, clazz, taskType, new PrintStream(out, true), timeout);
+            File emmaCoverageFile = new File(outFile.getParentFile(), taskName+"-coverage.ec");
+
+            return new TaskImpl(taskName, clazz, taskType, new PrintStream(out, true), timeout, emmaCoverageFile.getCanonicalPath());
         } catch (Exception e) {
             e.printStackTrace();
             Assert.fail("createTask : could not open output stream for file " + filename);



More information about the jboss-svn-commits mailing list