Sorry, word mistake There is a opinion that unit test should be just independent from anything,
2008/9/27 陈思淼 <[EMAIL PROTECTED]> > For example, my project is In a SOA environment, my test case depends on > another outer Service. should I put this kind of test into Unit test?or my > test should connection to database do some CRUD, should I put it in the Unit > Test phase. > > There is a opinion that unit test just dependent from anything, if you > dependence on outer resource, you should mock it,and test the > real function In a integration-test phase, before package-phase all the > enviroment-variable for example the database connection url have been > replace by profile. So the integration Test should connection to the real > server to test. > > Is that true? > > > 2008/9/27 Stephen Connolly <[EMAIL PROTECTED]> > > The first one works as designed, the second one doesn't >> >> ;-) >> >> Seriously, The test phase works well and is designed for unit tests. >> >> There are known issues with the integration-test phase that lead many >> people >> to do their integration testing in a different pom... although some people >> have managed to work around the issues... >> >> The main issue is that you want to start something before the integration >> tests and stop it afterwards... starting before hand is easy... just >> attach >> to the pre-integration-test phase... stoping looks easy, i.e. attach to >> the >> post-integration-test phase... but that will never get executed if >> _either_ >> the integration-test phase fails _or_ the developer just typed "mvn >> integration-test"... the developer needs to keep typing "mvn >> post-integration-test"... and in reality you need to check the results of >> the integration tests after post-integration-test... so they should go >> "mvn >> verify" and verify is where the integration-test results should be >> checked.... of course current plugins for testing are not well implemented >> to do this >> >> -Stephen >> >> 2008/9/27 陈思淼 <[EMAIL PROTECTED]> >> >> > Maven lifecycle have explicit define two phase: unit-test and >> > integration-test.can anybody tell me the big difference about the two >> life >> > phase? >> > >> > >
