> Thanks for the info.  This does look quite
> interesting, although I don't
> know Python, so there'd be a bit of a curve there. 
>

There is, but not that bad. J/Python is quite nice
language and in case of Jython you do not have to have
much of Jython code around: all the functionality can
be kept in Java classes and script just calls
functions for example using jakarta regexp package
looks like this:

TestUtils.py:
from java.lang import Exception
from org.apache.regexp import RE


def getParen( n, regexp, txt ):
        re = RE( regexp )
        if  re.match( txt ):
                return re.getParen( n )
        return ""

def checkWords( words, res ):
        r = getParen( 1, '('+words+')', res.text )
        if words != r :
                raise Exception( 'Words ['+words+']were not found at
[' + res.getOriginalURI().toString() +']!' )


And actual test checks if there are necessary words in
the response:

from xxxxx import Commons
from www.TestHelper import *



class TestHomePage:

    def runTests(self):
        res =
Commons.tests[0].GET(Commons.baseURL+'/index.html')
        checkOK( res )
        checkWords( 'lets corporate IT buyers', res)


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of 
CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a 
Strategy for Reforming Universities and Public Schools.  New York:  State 
University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to