Hi,
Over the last few days I have been having a look at
o.j.c.l.JDBCCacheLoaderPerfTest and I have come to the conclusion that it needs
changing.
Currently there're 3 tests, testPut(), testGet() and testRemove(). I
tried running it and I realised that testPut() would do its job but the other
two would never find anything in the database.
This could be controlled via setting drop table to false, but this
would still not work as cache.remove("/") is called on teardown().
These three tests are quite linked to each other as you expect puts to
go first, then gets and lastly removes. When running unit tests, you're not
guaranteed order and taking in account the relationship between the tests, I
think the code inside these tests should be joined into just one test.
Of couse, you'd need to evict the cache in between puts/gets and
gets/removes so that you can actually exercise the code fully right up to the
cache loader.
Any thoughts?
Galder Zamarreņo
Sr. Software Maintenance Engineer
JBoss, a division of Red Hat
IT executives: Red Hat still #1 for value
http://www.redhat.com/promo/vendor/