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

Re: [XP] Unit tests & Databases

Expand Messages
  • Phlip
    ... Just some brief observations: Everyone studying TDD vs databases should learn how Ruby on Rails and ActiveRecord do it. Next, I bet everyone could connect
    Message 1 of 2 , Sep 4, 2007
    • 0 Attachment
      Lauren Berry wrote:

      > Each developer has their own schema which they connect to. There has been
      > some effort to separate out a UnitTestDataSource (unfortunately there
      > isn't
      > just one of these, and some tests make their own connection to the test
      > database anyway). The test data source(s) gets a connection by looking up
      > a
      > JNDI resource from a properties file (again more than one) and then
      > connects
      > to the database and runs the tests.

      Just some brief observations: Everyone studying TDD vs databases should
      learn how Ruby on Rails and ActiveRecord do it.

      Next, I bet everyone could connect to the same database and run all their
      tests efficiently if each test case setUp() simply started a transaction
      before preppings its "fixture" resources, and then discarded this
      transaction in a tearDown().

      --
      Phlip
      http://www.oreilly.com/catalog/9780596510657/
      "Test Driven Ajax (on Rails)"
      assert_xpath, assert_javascript, & assert_ajax
    • Rob Park
      So I think I get how RoR AR works, but is there a standard TDD approach for it? Or how do you do that? My concern with AR is overcomplicating test classes
      Message 2 of 2 , Sep 4, 2007
      • 0 Attachment
        So I think I get how RoR AR works, but is there a standard TDD
        approach for it? Or how do you do that? My concern with AR is
        overcomplicating test classes due to my class having 2
        responsibilities: manage itself (biz logic) and its persistence.

        .rob.

        P.S. Sorry I hadn't seen your part 2 before my last post.

        --- In extremeprogramming@yahoogroups.com, "Phlip" <phlip2005@...>
        wrote:
        >
        > Just some brief observations: Everyone studying TDD vs databases
        should
        > learn how Ruby on Rails and ActiveRecord do it.
        >
        > Next, I bet everyone could connect to the same database and run all
        their
        > tests efficiently if each test case setUp() simply started a
        transaction
        > before preppings its "fixture" resources, and then discarded this
        > transaction in a tearDown().
        >
        > --
        > Phlip
        > http://www.oreilly.com/catalog/9780596510657/
        > "Test Driven Ajax (on Rails)"
        > assert_xpath, assert_javascript, & assert_ajax
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.