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

[XP] Re: EJB and junit

Expand Messages
  • Gareth Reeves
    Is this really Unit testing or is it Functional testing? ... From: Michael T. Nygard [mailto:michaeln@javelintech.com] Sent: Wednesday, March 01, 2000 12:21 PM
    Message 1 of 13 , Mar 1, 2000
      Is this really Unit testing or is it Functional testing?

      -----Original Message-----
      From: Michael T. Nygard [mailto:michaeln@...]
      Sent: Wednesday, March 01, 2000 12:21 PM
      To: extremeprogramming@egroups.com
      Subject: [XP] Re: EJB and junit


      I've written a test runner that is a servlet. It can invoke EJBs "in-place"
      on the server. Coupled with a quick deployment and a local server, unit
      testing them becomes easy.

      If there is interest, I will post the code.

      --Michael T. Nygard


      ----- Original Message -----
      From: "Mike Morris" <mike.morris@...>
      To: <extremeprogramming@egroups.com>
      Sent: Monday, February 28, 2000 8:23 AM
      Subject: [XP] Re: EJB and junit


      > Gerd Boerrigter wrote:
      > >
      > > Hi,
      > >
      > > we are using WebLogic server to build Enterprise JavaBeans. I want to
      > > use junit to do unit tests of the beans. I am new to EJB and can not
      > > think about an easy way to test the beans in the container.
      > >
      > > It looks like I need to write a Remote-Interface for the tests to be
      > > able to run them on the server. This looks like too much work to do.
      > > Is there an easy way to run junit on the server? How do other people
      > > do it?
      >
      > The same problem crops up in writing Jini services and clients -- how do
      > you test the remote stuff in short times (which is probably where stuff
      > is most likely to break).
      >
      > I am presently experimenting with testing the server locally first,
      > which ensure that at least it sets itself up properly (Jini being
      > somewhat finicky about setup issues), and I'll take figure out the next
      > step when I get to it.
      >
      > Has anyone else more experience with unit-testing distributed apps?
      > Tips, traps, tricks?
      > --
      > Mike Morris cOcO Technologies cc
      >
      > Java & OO training, consulting and software.
      >
      > mike.morris@...
      > Ph: Intl +27-44-388-4635 Local (044)388-4635
      > P O Box 34, Rheenendal, 6576, South Africa
      >
      > -- A day without chillies is a day wasted --



      ------------------------------------------------------------------------
      To Post a message, send it to: extremeprogramming@...
      To Unsubscribe, send a blank message to:
      extremeprogramming-unsubscribe@...
      Ad-free courtesy of objectmentor.com

      ------------------------------------------------------------------------
      -- Check out your group's private Chat room
      -- http://www.egroups.com/ChatPage?listName=extremeprogramming&m=1
    • Eric Rizzo
      ... Yes, please do! -- Eric Nicholas Rizzo eric.rizzo@trcinc.com The Technical Resource Connection, Inc. Perot Systems ... I embrace my personality
      Message 2 of 13 , Mar 1, 2000
        "Michael T. Nygard" wrote:
        >
        > I've written a test runner that is a servlet. It can invoke EJBs "in-place"
        > on the server. Coupled with a quick deployment and a local server, unit
        > testing them becomes easy.
        >
        > If there is interest, I will post the code.

        Yes, please do!

        --
        Eric Nicholas Rizzo
        eric.rizzo@...
        The Technical Resource Connection, Inc. Perot Systems
        ---------------------------------------------------------------
        I embrace my personality flaws, for without them I might not
        have any personality at all.
      • Michael T. Nygard
        Here s the code for the servlet itself. I have additional resources for deploying this as a web component in the Sun J2EE reference implementation, which are
        Message 3 of 13 , Mar 1, 2000
          Here's the code for the servlet itself. I have additional resources for
          deploying this as a web component in the Sun J2EE reference implementation,
          which are not attached, but are easy to recreate.

          This is part of an article for which I am seeking a publisher.

          Feedback would be wonderful. I wrote this at home, with no pair [/me hangs
          head in shame].

          Cheers,
          --Michael T. Nygard
        • Michael T. Nygard
          I believe it is really unit testing, for two reasons: 1. It s running JUnit test cases. 2. I write the same tests to be invoked this way as with any
          Message 4 of 13 , Mar 1, 2000
            I believe it is really unit testing, for two reasons:

            1. It's running JUnit test cases. <grin>

            2. I write the same tests to be invoked this way as with any other unit
            tests. The only difference is the "test harness".

            I've seen proposals to create a test harness that accurately duplicates the
            behavior of a servlet engine, or an EJB container. First of all, that is
            exceedingly difficult. Second, any test harness sufficiently accurate will
            be equivalent to the application server itself. (And, of course, that means
            the test harness is complex enough to have its own set of defects.)

            (If one truly wants to employ a "test harness" that accurates duplicates the
            application server's environment, one could turn to the Apache-Sun
            collaboration, Tomcat.)

            Cheers,
            --Michael T. Nygard

            ----- Original Message -----
            From: "Gareth Reeves" <reevesy@...>
            To: <extremeprogramming@egroups.com>
            Sent: Wednesday, March 01, 2000 12:51 PM
            Subject: [XP] Re: EJB and junit


            > Is this really Unit testing or is it Functional testing?
            >
            > -----Original Message-----
            > From: Michael T. Nygard [mailto:michaeln@...]
            > Sent: Wednesday, March 01, 2000 12:21 PM
            > To: extremeprogramming@egroups.com
            > Subject: [XP] Re: EJB and junit
            >
            >
            > I've written a test runner that is a servlet. It can invoke EJBs
            "in-place"
            > on the server. Coupled with a quick deployment and a local server, unit
            > testing them becomes easy.
            >
            > If there is interest, I will post the code.
            >
            > --Michael T. Nygard
            >
            >
            > ----- Original Message -----
            > From: "Mike Morris" <mike.morris@...>
            > To: <extremeprogramming@egroups.com>
            > Sent: Monday, February 28, 2000 8:23 AM
            > Subject: [XP] Re: EJB and junit
            >
            >
            > > Gerd Boerrigter wrote:
            > > >
            > > > Hi,
            > > >
            > > > we are using WebLogic server to build Enterprise JavaBeans. I want to
            > > > use junit to do unit tests of the beans. I am new to EJB and can not
            > > > think about an easy way to test the beans in the container.
            > > >
            > > > It looks like I need to write a Remote-Interface for the tests to be
            > > > able to run them on the server. This looks like too much work to do.
            > > > Is there an easy way to run junit on the server? How do other people
            > > > do it?
            > >
            > > The same problem crops up in writing Jini services and clients -- how do
            > > you test the remote stuff in short times (which is probably where stuff
            > > is most likely to break).
            > >
            > > I am presently experimenting with testing the server locally first,
            > > which ensure that at least it sets itself up properly (Jini being
            > > somewhat finicky about setup issues), and I'll take figure out the next
            > > step when I get to it.
            > >
            > > Has anyone else more experience with unit-testing distributed apps?
            > > Tips, traps, tricks?
            > > --
            > > Mike Morris cOcO Technologies cc
            > >
            > > Java & OO training, consulting and software.
            > >
            > > mike.morris@...
            > > Ph: Intl +27-44-388-4635 Local (044)388-4635
            > > P O Box 34, Rheenendal, 6576, South Africa
            > >
            > > -- A day without chillies is a day wasted --
            >
            >
            >
            > ------------------------------------------------------------------------
            > To Post a message, send it to: extremeprogramming@...
            > To Unsubscribe, send a blank message to:
            > extremeprogramming-unsubscribe@...
            > Ad-free courtesy of objectmentor.com
            >
            > ------------------------------------------------------------------------
            > -- Check out your group's private Chat room
            > -- http://www.egroups.com/ChatPage?listName=extremeprogramming&m=1
            >
            >
            >
            > ------------------------------------------------------------------------
            > To Post a message, send it to: extremeprogramming@...
            > To Unsubscribe, send a blank message to:
            extremeprogramming-unsubscribe@...
            > Ad-free courtesy of objectmentor.com
            >
            > ------------------------------------------------------------------------
            > -- Create a poll/survey for your group!
            > -- http://www.egroups.com/vote?listname=extremeprogramming&m=1
            >
            >
          • James W Grenning
            ... First get confidence in local execution, then move toward distributed execution. The client side of an interface can be tested using a server stub that
            Message 5 of 13 , Mar 2, 2000
              > Has anyone else more experience with unit-testing distributed apps?
              > Tips, traps, tricks?

              First get confidence in local execution, then move toward distributed
              execution. The client side of an interface can be tested using a server
              stub that has the same interface and asynchronous behavior as the real
              server, but produces consistent/canned/repeatable results. Once the local
              asynchronous tests are running, move your server stub to a distributed
              machine. Run those same tests comparing the consistent/canned/repeatable
              results as before. Adding the asynchronous behavior makes the tests more
              complicated.

              The strategy can be reversed for testing the server to client interactions.

              We're using this strategy in a c++ environment using CppUnit. I had to
              extend CppUnit to have overall Initialize and Finalize functions for system
              setup and tear down that is used over all the tests run.

              James
              -------------------------------------------------------------
              James Grenning High Point Software Technology Company
              Design Consulting 10 High Point Drive (847) 438-9942
              Project Management Hawthorn Woods, IL
              OO Training 60047
              jgrenning@... www.HighPointSoftware.com
              --------------------------------------------------------------
            • Greg Kapfhammer
              ... If you are doing distributed computing development with Jini, JavaSpaces and Java, then you should look to reading some of the short articles that Ken
              Message 6 of 13 , Mar 3, 2000
                On Thu, 2 Mar 2000, James W Grenning wrote:

                > > Has anyone else more experience with unit-testing distributed apps?
                > > Tips, traps, tricks?
                >
                > First get confidence in local execution, then move toward distributed
                > execution. The client side of an interface can be tested using a server

                If you are doing distributed computing development with Jini, JavaSpaces
                and Java, then you should look to reading some of the short articles that
                Ken Edwards wrote about designing and testing distributed applications.
                He makes some good practical reccomendations about the best way to to set
                up your Jini environment so that you do not make common mistakes when you
                are testing in a "local execution" framework.

                Check out the article at:

                http://www.kedwards.com/jini/develop.html

                Other helpful hints can be found at:

                http://www.kedwards.com/jini/

                Anyone out there using Jini to do distributing computing development in a
                commercial application?

                greg

                +----------------------------+----------------------------+
                | Gregory M. Kapfhammer | RST Corporation |
                | Research Associate | 21351 Ridgetop Circle |
                | gkapfham@... | Dulles, VA 20166 |
                | http://www.rstcorp.com | (703) 404-9293 |
              • Brian Wilson
                I m interested!
                Message 7 of 13 , Apr 3, 2000
                  I'm interested!
                Your message has been successfully submitted and would be delivered to recipients shortly.