Menu

custom tags/JTidy properties/extendability?

2002-07-09
2002-07-24
  • Maurice Schoenmakers

    I just wanted to change some allowing some custom tags for JTidy. This is supported by JTidy but was not supported by HTTPUnit... mm OK.
    Well maybe we can somehow extend HTTP classes or plug in some other components?

    Unfortunately HTTP unit is not as extendable as it could be. It seems that many methods are private, contain hard coded new calls and there is no concept of a plugging in own derived alternatives.

    Just to change the way the DOM is generated in the ReceivedPage Class, I considered to extend the Webconversation class (copying 3 private methods) to allow the creation of an own type derived of HttpWebResponse wich in turn allows to use an own type of ReceivedPage (while duplicating code for x methods for delegating as getReceivePage was private and __page also), this own ReceivePage in turn would then allow to define an own way to use a parser to create the required DOM.

    As an alternative I could play around with the class loader ..., or simply change the orginal code ....

    but isn't there a "simpler" way to achieve this ?

    Maybe changing the orginal code to use the factory pattern could help here togehter with some configurable class names in the HttpUnitOptions class ? What do you think?

     
    • Russell Gold

      Russell Gold - 2002-07-24

      I think it sounds interesting. Could you submit some test cases that demonstrate what you want to do and a patch to make it work? Or even just the test cases?

       

Log in to post a comment.

Auth0 Logo