Login | Register
My pages Projects Community openCollabNet

Discussions > users > Re: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ?

maxq
Discussion topic

Back to topic list

Re: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ?

Author fcohen
Full name Frank Cohen
Date 2005-01-14 13:44:25 PST
Message Hi Timothy: Welcome to the MaxQ user's community.

> I am looking at MaxQ for building a regression test suite against a
> webapp
> here at work. I love how it created the Jython script simply by
> making me
> go through it's proxy server. Having the output of this tool be yet
> another
> program seems like a very rewarding move. The particular benefit I am
> looking for is to able to do extremely detailed validations on the
> response
> body output.

MaxQ relies on JTidy to validate response output. Another approach is
to use HTTPUnit for APIs to do validations on the response. HTTPUnit is
an open-source library written in 100% Java. You can use the Jython
import commands to access HTTPUnit's classes and methods.


> I figured a good first baby step would be to add some code to the
> generated
> Jython scripts so that they save certain response bodies to disk as
> separate
> files, then point a Konqueror or Mozilla window to that output file
> (so I
> can see the output as it happens). I am not terribly familiar with
> Python
> (yet), but quickly found the calls for opening/writing/closing files,
> and
> tested them with the real Python interpreter (at this point I thought
> Jython
> was just an interface to regular Python. I now realize that Jython is
> a
> partial re-implementation of Python, missing a lot of pieces). So
> when I
> tried to do the same thing in Jython, I ran into problems (the open()
> call
> couldn't be found).
>

Jython 2.1 is an implementation of Python 2.1. There are a number of
Python modules that use native commands that are not available to
Jython. However, Jython more than compensates by making any Java class
available and Java is much further ahead than Python in terms of
functionality and APIs.

For learning Jython I recommend any of the Jython books (Jython
Essentials from O'Rielly, Jython for Java Programmers from New Riders.)
I find myself often going back to The Python Quickstart from Peachpit
Press to help me remember the file commands and how to work with
dictionaries and the like.


> After finding that Jython 1.1 doesn't seem to implement the built-in
> Python
> open/close routines (if I'm wrong on this, please correct me!), I
> discovered
> that the Jython project has versions 2.0 and 2.1 available on their
> site.
>
> Before I try the Jython 2.1 (see if the I/O libraries are
> implemented), I
> wanted to ask: Is there some reason that MaxQ 0.98 (released last
> month)
> can't use Jython 2.x? (Jython 1.1 isn't even mentioned on jython.org
> anymore?)
>

MaxQ ships with Jython 2.1, which is the latest.

> Or should I try using the java.io.* libraries from Jython to write the
> files
> from the generated scripts?

In general, I first try to use Python commands and when I can't get
that to work I use a Java class.

Hope this helps.

-Frank


> Thanks,
>
>
>
> Timothy Jones - Sr. Systems Engineer, Development
> (813) 273-4743 - Syniverse Technologies
> Do the Right Thing. It will gratify some people and astound the rest.
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: users-unsubscribe@ma​xq.tigris.org
> For additional commands, e-mail: users-help at maxq dot tigris dot org
>
>
---
Frank Cohen, PushToTest, http://www.PushToTest.com, phone: 408 374 7426
Author of "Java Testing and Design: From Unit Tests to Automated Web
Tests"
from Prentice Hall, details at http://thebook.pushtotest.com


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: users-unsubscribe@ma​xq.tigris.org
For additional commands, e-mail: users-help at maxq dot tigris dot org

« Previous message in topic | 3 of 5 | Next message in topic »

Messages

Show all messages in topic

[maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ? timothyjones Timothy Jones 2005-01-14 09:57:59 PST
     RE: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ? timothyjones Timothy Jones 2005-01-14 13:12:32 PST
     Re: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ? fcohen Frank Cohen 2005-01-14 13:44:25 PST
         RE: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ? timothyjones Timothy Jones 2005-01-14 14:54:55 PST
             Re: [maxq-users] Why Jython 1.1 instead of 2.0 or 2.1 ? oliverbock Oliver Bock 2005-01-14 23:15:09 PST
Messages per page: