Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] ASP and Unit Testing

Expand Messages
  • Joe Tatem
    I have just taken a small plunge into just this (ASP work, test first). I am using HTTPUnit to test the pages and its working OK with just a few gotchas. - To
    Message 1 of 6 , Feb 1 9:01 AM
    • 0 Attachment
      I have just taken a small plunge into just this (ASP work, test first).
      I am using HTTPUnit to test the pages and its working OK with just a few
      gotchas.

      - To use HTTPUnit, you will need Ant, JTidy, and JUnit. Then you are
      cooking... It took me longer to set up than I would have liked but
      perhaps that is because I've been a non-coding tech lead for a while and
      some of my skills are rusty.
      - HTTPUnit builds an XML DOM tree out of the page and then you have to
      navigate through that tree to find what you want. This gets kinda large
      for complicated pages especially if, like me, you are unfamiliar with
      DOM model. HTTPUnit does provide some shortcuts to let you find links
      and table elements but many times I find myself resorting to
      resp.toString().indexOf() to make sure a chunk of text exists. Its hard
      to tell if the smell is in the test or in my ASP code :-).
      - I have not figured out a way to unit test Application Scope routines
      and, as a result, I wind up with debug code sprinkled around. I try to
      keep it to a dull roar (small smell) and find that I can still work in
      small chunks which is the *only* way to fly.

      Joe

      bruce.zweifel@... wrote:
      >
      > I'm writing a fairly simple web application using ASP and I don't
      > know where to begin with my unit testing. How do I test an ASP page?
      >
      > Can I use Junit to do the testing?
      >
      > To Post a message, send it to: extremeprogramming@...
      >
      > To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...
      >
      > Ad-free courtesy of objectmentor.com
    • Joe Tatem
      ... I forgot, you will also need and XML parser. I am the one from Sun: jaxp-1.1ea2 Joe
      Message 2 of 6 , Feb 1 9:16 AM
      • 0 Attachment
        I wrote:
        > - To use HTTPUnit, you will need Ant, JTidy, and JUnit. Then you are
        > cooking... It took me longer to set up than I would have liked but
        > perhaps that is because I've been a non-coding tech lead for a while and
        > some of my skills are rusty.

        I forgot, you will also need and XML parser. I am the one from Sun:
        jaxp-1.1ea2

        Joe
      • emeade@geekfarm.org
        ... are ... while and ... I wrote up something about this, I ve got it up at: http://www.geekfarm.org/emeade/junit/AutomatingJUnitTestingWithAnt.htm I imagine
        Message 3 of 6 , Feb 1 7:18 PM
        • 0 Attachment
          --- In extremeprogramming@y..., "Joe Tatem" <jtatem@a...> wrote:
          > I wrote:
          > > - To use HTTPUnit, you will need Ant, JTidy, and JUnit. Then you
          are
          > > cooking... It took me longer to set up than I would have liked but
          > > perhaps that is because I've been a non-coding tech lead for a
          while and
          > > some of my skills are rusty.
          >
          > I forgot, you will also need and XML parser. I am the one from Sun:
          > jaxp-1.1ea2
          >
          > Joe

          I wrote up something about this, I've got it up at:
          http://www.geekfarm.org/emeade/junit/AutomatingJUnitTestingWithAnt.htm
          I imagine it will move over to Object Mentors pubs at some point.
          I didn't d/l a XML parser, I believe I used the one that comes with
          Ant.

          --
          Erik Meade emeade@...
          Senior Consultant Object Mentor, Inc.
          http://www.junit.org
        • Torben Wölm
          I have written a very small ASP testing framework. It requires IE5 to be the client browser to do the testing from (because it uses MSXML). Is there somewhere
          Message 4 of 6 , Feb 1 11:38 PM
          • 0 Attachment
            I have written a very small ASP testing framework. It requires IE5 to be the
            client browser to do the testing from (because it uses MSXML).

            Is there somewhere I can post it? Or just send me a mail, and I will mail it
            directly to anyone who is interested.

            Regards,
            Torben
          • LANGE,MANFRED (HP-Germany,ex1)
            ... IE5 is not necessary. Microsoft s XML Parser is also available separately: a) click on the following link
            Message 5 of 6 , Feb 2 12:03 AM
            • 0 Attachment
              > -----Original Message-----
              > From: Torben Wölm [mailto:torben.wolm@...]
              > Sent: Friday, February 02, 2001 8:38 AM
              > To: 'extremeprogramming@yahoogroups.com'
              > Subject: RE: [XP] ASP and Unit Testing
              >
              >
              > I have written a very small ASP testing framework. It
              > requires IE5 to be the
              > client browser to do the testing from (because it uses MSXML).

              IE5 is not necessary. Microsoft's XML Parser is also available separately:

              a) click on the following link
              http://msdn.microsoft.com/downloads/default.asp?URL=/code/topic.asp?URL=/msd
              n-files/028/000/072/topic.xml

              - OR (if the link does not work) -

              b) http://msdn.microsoft.com then
              - on the right, in "Key Topics" select "XML"
              - then on the next page, on the left select "XML Downloads"
              - then on the next page, on the left select "MSXML Parser 3.0 Release"

              BTW: For those using the Windows Installer: There is also a Merge Module
              available for that parser.

              >
              > Is there somewhere I can post it? Or just send me a mail, and
              > I will mail it
              > directly to anyone who is interested.
              [...]

              Cheers,
              Manfred.
              - - -
              Manfred Lange, Member of R&D Staff, Network Support Lab, Hewlett-Packard
              Schickardstr. 25, 71034 Boeblingen, Germany
              Tel: +49-7031-14-2795, Fax: +49-7031-14-4987
              Mail: Manfred_Lange@...

              "Only the paranoid survive!" (Andy S. Grove)
            • Torben Wölm
              Well, it probably isn t. It was the simplest way, I could think of, to explain that the html-page that executes the tests, uses XMLHTTP to connect to the pages
              Message 6 of 6 , Feb 2 12:10 AM
              • 0 Attachment
                Well, it probably isn't.

                It was the simplest way, I could think of, to explain that the html-page
                that executes the tests, uses XMLHTTP to connect to the pages where the
                ASP-code runs.

                So the requirements are: you need a browser that allows creation of the
                microsoft.XMLHTTP ActiveX object (from javascript), and a version of MSXML
                that includes the XMLHTTP-object.

                Regards,
                Torben

                > -----Original Message-----
                > From: LANGE,MANFRED (HP-Germany,ex1) [SMTP:manfred_lange@...]
                > Sent: Friday, February 02, 2001 9:04 AM
                > To: extremeprogramming@yahoogroups.com; torben.wolm@...
                > Subject: RE: [XP] ASP and Unit Testing
                >
                > > I have written a very small ASP testing framework. It
                > > requires IE5 to be the
                > > client browser to do the testing from (because it uses MSXML).
                >
                > IE5 is not necessary. Microsoft's XML Parser is also available separately:
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.