Hi all: I did some enhancement to utilize dbunit in the BaseXXXTestCase as the patch in http://www.nabble.com/file/p18275899/src.zip attachement . With this patch, we could select and run specified unittest case in IDEs, like Eclipse, IDEA, etc.
Usage: 1. Overwirte the source file inside the http://www.nabble.com/file/p18275899/src.zip attachement . If you have done some modification, make sure you backup them before you do the overwirting. 2. Modify the "jdbc.properties". Copy the particular value from the "pom.xml" and replace the variable in the "jdbc.properties". Add "dbunit.dataSetUrl=sample-data.xml", "dbunit.enabled=true" these two properties and set the appropriate value. 3. Now the dbunit is enabled for each unittest by default. If you want to disable it (e.g. unittest for util class), you can set the protected attribute "dbUnitEnabled" to false. 4. In Eclipse, select the unittest that you wanna to run, select "Run as(Debug as)->Junit Test" from the right click menu. You just can do the same thing with other IDE or test runner. 5. You can also use the ole "Run as->mvn test" approach to run all the unit test. Because in the current project I am only using Appfuse core artifact for now, so I only did the modification to the BaseDaoTestCase and BaseManagerTestCase. I would take look into the web tier BaseXXXTestCase to see whether we can use the same way. Wish it could bring some convenience to you development:) PS: Actually I met a problem when I switched to Eclipse to run my unit test. I cannot pass "UserManagerTest->testSaveUser()". I also look into the source code and I though it looks like a bad test. It should haven't passed the test anyway by comparing the origin text and encrypted text. But it do pass when the test is harnessed by maven. Who can tell the reason why.... -- View this message in context: http://www.nabble.com/Unit-test-enhancement-for-Eclipse-tp18275899s2369p18275899.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
