Details
Description
I have been thinking about writing a lot more unit level tests for things and
I've been debating where these tests should live. I have come to the conclusion
these tests will live in a newly creating directory structure beneath src/tests
following the stand package hierarchy:
src/test/org/exolab/castor/jdo/conf
src/test/org/exolab/castor/jdo/drivers
src/test/org/exolab/castor/jdo/engine
src/test/org/exolab/castor/jdo/oql
src/test/org/exolab/castor/jdo/transactionmanager
src/test/org/exolab/castor/jdo/transactionmanager/spi
src/test/org/exolab/castor/persist/
src/test/org/exolab/castor/persist/cache
src/test/org/exolab/castor/persist/spi
I'm not sure what to do with the tests in src/tests/jdo yet. I think I'll just
leave them there and continue to place functional tests there. If anyone has any
suggestions, please speak up. I really like the TestHarness and the ability to
run a functional test by specifying castor.postgresql.TC01. But the TestHarness
is not necessary for unit level tests. Unit level tests should be able to run
within a matter of seconds, should not require a database and should be run from
within the Ant build. This is where mock objects come into play. Unit level
tests should only test and verify the Castor functionality, not the database
functionality and this is what differentiates a unit test from a functional test.
Activity
| Field | Original Value | New Value |
|---|---|---|
| issue.field.bugzillaimportkey | 1613 | 23062 |
| Assignee | Werner Guttmann [ wguttmn ] | Ralf Joachim [ rjoachim ] |
| Attachment | patch-C755-1.txt [ 15191 ] |
| Fix Version/s | 0.9.9 [ 11661 ] | |
| Environment |
Operating System: Linux Platform: PC |
Operating System: Linux Platform: PC |
| Summary | All unit tests for JDO should be placed in a new src/tests/org/exolab/castor/ tree | All unit tests for JDO should be placed in a new src/tests/utf/org/exolab/castor/ tree |
| Bugzilla Id | 1613 | |
| Description |
I have been thinking about writing a lot more unit level tests for things and I've been debating where these tests should live. I have come to the conclusion these tests will live in a newly creating directory structure beneath src/tests following the stand package hierarchy: src/test/org/exolab/castor/jdo/conf src/test/org/exolab/castor/jdo/drivers src/test/org/exolab/castor/jdo/engine src/test/org/exolab/castor/jdo/oql src/test/org/exolab/castor/jdo/transactionmanager src/test/org/exolab/castor/jdo/transactionmanager/spi src/test/org/exolab/castor/persist/ src/test/org/exolab/castor/persist/cache src/test/org/exolab/castor/persist/spi I'm not sure what to do with the tests in src/tests/jdo yet. I think I'll just leave them there and continue to place functional tests there. If anyone has any suggestions, please speak up. I really like the TestHarness and the ability to run a functional test by specifying castor.postgresql.TC01. But the TestHarness is not necessary for unit level tests. Unit level tests should be able to run within a matter of seconds, should not require a database and should be run from within the Ant build. This is where mock objects come into play. Unit level tests should only test and verify the Castor functionality, not the database functionality and this is what differentiates a unit test from a functional test. |
I have been thinking about writing a lot more unit level tests for things and I've been debating where these tests should live. I have come to the conclusion these tests will live in a newly creating directory structure beneath src/tests following the stand package hierarchy: src/test/org/exolab/castor/jdo/conf src/test/org/exolab/castor/jdo/drivers src/test/org/exolab/castor/jdo/engine src/test/org/exolab/castor/jdo/oql src/test/org/exolab/castor/jdo/transactionmanager src/test/org/exolab/castor/jdo/transactionmanager/spi src/test/org/exolab/castor/persist/ src/test/org/exolab/castor/persist/cache src/test/org/exolab/castor/persist/spi I'm not sure what to do with the tests in src/tests/jdo yet. I think I'll just leave them there and continue to place functional tests there. If anyone has any suggestions, please speak up. I really like the TestHarness and the ability to run a functional test by specifying castor.postgresql.TC01. But the TestHarness is not necessary for unit level tests. Unit level tests should be able to run within a matter of seconds, should not require a database and should be run from within the Ant build. This is where mock objects come into play. Unit level tests should only test and verify the Castor functionality, not the database functionality and this is what differentiates a unit test from a functional test. |
| Attachment | patch-C755-20050731.txt [ 16076 ] |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |