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

RE: [junit] Digest Number 17

Expand Messages
  • Robert C. Martin
    ... I have created java interfaces that encapsulate the queries I need to make. The normal implementation of those interfaces is the code that knows about
    Message 1 of 2 , Dec 1, 2000
    View Source
    • 0 Attachment
      > From: "Jim Jackl-Mochel" <jmochel@...>
      > Subject: Unit Testing JDBC database code.
      >
      > In trying to make my unit tests very self contained I have
      > come up against a
      > small
      > headache. In the case of those classes that read or
      > manipulate a database
      > via JDBC I
      > would ideally like to create the database, manipulate it, and
      > then remove
      > the database.
      >
      > How have everybody else handled this sort of unit test ?
      >

      I have created java interfaces that encapsulate the queries I need to make.
      The normal implementation of those interfaces is the code that knows about
      JDBC, the schema, etc. My unit tests also implement those interfaces and
      pretend to act like the database. They supply and accept the necessary data
      and verify that the database is handled correctly. This also allows me to
      mimic database errors.

      See the "MockObject" threads on extremeprogramming@egroups.com. Also see
      the book "Extreme Programming In Practice" by Jim Newkirk and Robert C.
      Martin.


      Robert C. Martin | "Uncle Bob" | Software Consultants
      Object Mentor Inc. | rmartin@... | We'll help you get
      PO Box 5757 | Tel: (800) 338-6716 | your projects done.
      565 Lakeview Pkwy | Fax: (847) 573-1658 | www.objectmentor.com
      Suite 135 | | www.XProgramming.com
      Vernon Hills, IL, | Training and Mentoring | www.junit.org
      60061 | OO, XP, Java, C++, Python|

      "One of the great commandments of science is:
      'Mistrust arguments from authority.'" -- Carl Sagan
    • Chad Fowler
      ... Also see ... Robert C. ... Where might one see the book ? I can t find any information on it. Thanks, Chad
      Message 2 of 2 , Dec 2, 2000
      View Source
      • 0 Attachment
        > See the "MockObject" threads on extremeprogramming@egroups.com
        Also see
        > the book "Extreme Programming In Practice" by Jim Newkirk and
        Robert C.
        > Martin.
        >

        Where might one "see the book"? I can't find any information on it.

        Thanks,
        Chad
      Your message has been successfully submitted and would be delivered to recipients shortly.