RE: Unit testing web apps

From: Fredrik Liden (flide..ranslate.com)
Date: Wed Jun 13 2007 - 11:56:13 EDT

  • Next message: Mike Kienenberger: "Re: Unit testing web apps"

    Thanks both,

    Yeah I'm guessing the UI layer is not as important as long as the service classes doesn't crumble if there's some UI bugs. Selenium looks quite interesting though. Peter, if I test the classes as plain java classes I'm guessing I would have to use

    DataContext context = DataContext.createDataContext();
    DataContext.bindThreadDataContext(context);

    Fredrik

    -----Original Message-----
    From: Peter Schröder [mailto:Peter.Schroede..reenet-ag.de]
    Sent: Wednesday, June 13, 2007 12:35 AM
    To: use..ayenne.apache.org
    Subject: AW: Unit testing web apps

    hi fredrik,

    we use simple junit tests for testing the service layer of our webapps. in the service layer we receive a datacontext via the cayenne servlet-listener using DataContext.getThreadedDataContext(). so we do a DataContext.bindThreadedDataContext(newContext) in the setup-method of the unit-test.

    for testing the webapp there are several possibilites: html-unit, selenium ...

    kind regards
    peter

    -----Ursprüngliche Nachricht-----
    Von: Fredrik Liden [mailto:flide..ranslate.com]
    Gesendet: Mittwoch, 13. Juni 2007 02:47
    An: use..ayenne.apache.org
    Betreff: Unit testing web apps

    Do you have any recommendations/guide lines for testing a Cayenne web
    application. Do I need a combination of cactus for the web pages and
    jUnit for the service layer and data objects? Would I be able to access
    the cayenne data context from within the setup and tear down functions.
    Or should I consider this testing as a completely separate application
    from the current web app since the test is not running as a servlet and
    can't get the context from there? How do you guys test your apps?

    Thanks!
    Fredrik



    This archive was generated by hypermail 2.0.0 : Wed Jun 13 2007 - 11:56:38 EDT