Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [maxq-dev] code to contribute

maxq
Discussion topic

Back to topic list

[maxq-dev] code to contribute

Author Wayne_Hearn at Dell dot com
Full name Wayne_Hearn at Dell dot com
Date 2003-08-18 13:12:26 PDT
Message Like others in this list I have added some functionality to MaxQ after
finding it a very useful tool. I am new to contributing to open source so
I'm not sure how I should submit my changes. I followed this discussion
thread but I have a problem in that I'm behind a firewall that won't let me
connect to your CVS. The other issue I have is I'm not sure the changes
I've made would be acceptable to everyone. How are changes approved? I
made some changes to the jython script that is generated to make use of the
underlying JUnit framework and to allow the test scripts to be callable from
one another. I thought it would be easier to allow one script to call
another to facilitate reuse. I read the section in the docs about creating
libraries but this is easier for the workflow portions of the script. One
other thing I changed was to create the test file from the File->New
operation. This way MaxQ can give the test class a specific class name
instead of just "MaxQTest." My concern is that the script I generate is not
fully compatible with existing MaxQ scripts so a conversion would have to be
done if you wanted to leverage old scripts with the new scripts. Here is a
sample:
 
# imports
from com.bitmechanic.maxq import HttpTestCase, EditorPane
from junit.textui import TestRunner
from java.lang import *
from java.io import *
from java.util import *
from HTTPClient import NVPair
 

# definition of test class
class MaxTest(HttpTestCase):
    def __init__(self):
        HttpTestCase.__init__(self, testName)
 
    # Add setup code here. See Junit javadoc.
    def setUp(self):
        pass
 
    # Add tearDown code here. See Junit javadoc.
    def tearDown(self):
        pass
 
    #Runs the test
    def runTest(self):
        self.doTest()
 
    #Test script
    def doTest(self):
 pass

####################​####################​##
 
# Code to load and run the test
if __name__ == "main" :
 
    test = MaxTest("MaxTest")
    test.run()

 
I also wrote some extensions for Ant tasks base on the Jakarta JUnit tasks.
I take advantage of the JUnit TestResult formatters to create the same
summary files as JUnit creates. Using the JUnitReport tag gives you the
same XML/HTML based output junit builds for normal Java unit tests. Here is
a snip from my build file:
 
<target name="maxq_tests" depends="test-init"
    description="Runs the Maxq tests. Make sure the app is built and
running before executing this task.">
  <echo message="currentURL=​${webtest.currentUR​L}"/>
  <echo message="originalURL​=${webtest.original​URL}"/>
     <maxq
  printsummary="withOutAndErr"
  includeAntRuntime="true"
  showoutput="true">
  
  <formatter type="xml"/>
  <batchtest
      todir="${reports.tests}"
      fork="no"
      haltonfailure="false"
      failureproperty="tests.failed"
      originalURL="${webt​est.originalURL}"
      currentURL="${webte​st.currentURL}"
      pythonPath="Testing/​WebTests/Common;Test​ing/WebTests/Tests/S​ervice">
 
      <fileset dir=".">
        <include name="Testing/WebTes​ts/Tests/**/${webte​st.to.run}.py"/>
      </fileset>
  </batchtest>
      </maxq>
      
      <antcall target="test-report" />
      <fail if="tests.failed" message="tests failed!"/>
  
   </target>
  
   <target name="test-report">
       <junitreport todir="${reports.tests}">
    <fileset dir="${reports.tests}" excludes="TESTS-Test​Suites.xml"/>
    <report format="frames" todir="${reports.te​sts}/html"/>
       </junitreport>
   </target>

Wayne Hearn
Programmer Analyst
Dell Financial Services
Attachments

« Previous message in topic | 1 of 8 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] code to contribute Wayne_Hearn at Dell dot com Wayne_Hearn at Dell dot com 2003-08-18 13:12:26 PDT
     [maxq-dev] Re: code to contribute jmm James Manning 2003-08-19 06:26:04 PDT
     Re: [maxq-dev] code to contribute James Cooper <pixel at bitmechanic dot com> James Cooper <pixel at bitmechanic dot com> 2003-08-19 20:32:21 PDT
         [maxq-dev] Re: code to contribute jmm James Manning 2003-08-19 20:46:38 PDT
         [maxq-dev] load tester avery1701 Matt Avery 2003-08-21 08:32:07 PDT
             Re: [maxq-dev] load tester fcohen Frank Cohen 2003-08-21 12:44:22 PDT
                 [maxq-dev] Re: load tester jmm James Manning 2003-08-21 13:17:40 PDT
                     Re: [maxq-dev] Re: load tester avery1701 Matt Avery 2003-08-28 08:30:41 PDT
Messages per page: