Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [maxq-dev] IAgent - pluggable HTTP agents

maxq
Discussion topic

Back to topic list

Re: [maxq-dev] IAgent - pluggable HTTP agents

Author fcohen
Full name Frank Cohen
Date 2004-10-18 09:41:39 PDT
Message Good thoughts Oliver. Some feedback:

1) I use the term "agent" in TestMaker a lot to encompass the business
logic in a test. The test agent embodies the behavior of an archetypal
user. (I talk about this a lot in my book Java Testing and Design, see
http://thebook.pushtotest.com) So I would prefer to call the interface
something other than 'agent'. How about 'connection'?

2) The interface should provide for proxy server information: proxy
address, port, user name, user password.

3) The interface should have timing value getters. For example,
totaltime to make the request, set-up-time to marshall the request

-Frank



On Oct 18, 2004, at 1:14 AM, Oliver Bock wrote:

> Here is a first suggestion for a Java interface that identifies the
> minimum facilities that must be provided by HTTP libraries. This is
> motivated by a desire to experiment with HttpUnit without throwing
> away HttpClient. It may also be a useful way for Frank to invoke his
> own libraries while keeping MaxQ "clean".
>
> My intention is that the PyHttpTestCase would be extended to provide
> the helper methods currently provided by HttpTestCase, without knowing
> which HTTP library was in use. Examples of the helper functions
> include assert(), userConfirm(), responseContains(), etc.
>
> Thoughts?
>
>
> Oliver
>
> --
> package com.bitmechanic.maxq.agent;
>
> /**
> * This interface must be implemented by classes that act as agents
> (virtual
> * web browsers) for MaxQ scripts. An agent is created when a script
> is run.
> * As a minimum, it must support HTTP GET, POST and cookies.
> *
> * This interface is simpler than that typically provided by agent
> * implementations such as Jakarta HttpClient and HttpUnit. This
> keeps MaxQ
> * scripts simple. Implementors may expose other methods for use by
> more
> * sophisticated users who do not mind that their scripts will only
> work with
> * one agent. (e.g users who want HttpUnit's ability to look into the
> response
> * body.)
> *
> * MaxQ will "mix in" an implementations of this interface with the
> Jython base
> * class it provides for test (PyHttpTestCase). That is, it will
> dynamically
> * use the IAgent implementation as the top-level base class for the
> MaxQ
> * scripts.
> */
> public interface IAgent {
> /**
> * Performs an HTTP GET
> */
> public void get(String url, Object[] params);
>
> /**
> * Performs an HTTP POST
> */
> public void get(String url, Object[] params)
>
> /*
> * The headers from the response to the previous request.
> */
> public PyDictionary getResponseHeader();
>
> /*
> * The HTTP response code from the previous request (get()/post()).
> */
> public int getResponseCode();
>
> /*
> * The body of the response from the previous request
> (get()/post()).
> */
> public int getResponseText();
> }
>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
> For additional commands, e-mail: dev-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: dev-unsubscribe at maxq dot tigris dot org
For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 2 of 12 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 01:14:06 PDT
     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 09:41:39 PDT
         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 15:00:14 PDT
             Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 16:19:00 PDT
                 Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 16:33:03 PDT
                     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 16:40:42 PDT
                         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 16:46:26 PDT
                             Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 18:29:00 PDT
                                 Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 18:47:04 PDT
                                     Re: [maxq-dev] IAgent - pluggable HTTP agents fcohen Frank Cohen 2004-10-18 19:19:08 PDT
     Re: [maxq-dev] IAgent - pluggable HTTP agents hdara at primavera dot com hdara at primavera dot com 2004-10-18 11:02:51 PDT
         Re: [maxq-dev] IAgent - pluggable HTTP agents oliverbock Oliver Bock 2004-10-18 15:19:16 PDT
Messages per page: