|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
|
|
|
Re: Fwd: I want this test to failHi mathias and thank you for your answer,
My issue is resolved now. The exception was not thrown in the test but in my business code. I am not really sure why it was reporting me that there were no error but now everything works greatly...
Sorry for the noise. Regards, Valentin Jacquemin On Wed, Oct 21, 2009 at 10:31 PM, Matthias Gommeringer <Matthias.Gommeringer@...> wrote: Hi Valentin, ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: Fwd: I want this test to failValentin Jacquemin wrote:
> Hi mathias and thank you for your answer, > > My issue is resolved now. The exception was not thrown in the test but > in my business code. I am not really sure why it was reporting me that > there were no error but now everything works greatly... Is it possible you have wrote your tests in the wrong way? I found some of my less experienced colleagues were writing negative tests this way: public void myTestMethod() { try { // failing test here } catch (Exception e) { // logging statement here } } this way tests never fail. > > Sorry for the noise. > > Regards, > > Valentin Jacquemin > > > On Wed, Oct 21, 2009 at 10:31 PM, Matthias Gommeringer > <Matthias.Gommeringer@... <mailto:Matthias.Gommeringer@...>> wrote: > > Hi Valentin, > > could you please provide some more information about your prob > (test code, hibernate version, full stack trace)? I guess if the > stacktrace you sent is from the "debug" log message then it is > definitely not the one that should cause the test to fail. Are you > sure your checked exception is really thrown by your > "UserService.setUserAsCBR" method in your testcase? > > rgds, > matthias > > > > -----Ursprüngliche Nachricht----- > > Von: "Valentin Jacquemin" <jacqueminv@... > <mailto:jacqueminv@...>> > > Gesendet: 21.10.09 11:30:52 > > An: dbunit-user@... > <mailto:dbunit-user@...> > > Betreff: [dbunit-user] Fwd: I want this test to fail > > Hi all, > > > > I set up a test that should be reported as failed but it successed. > > Concretely I have a method that throws a checked exception which > > appears in console actually but in the end, db unit says: > > > > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 > > > > Although a few lines above: > > > > 2047 [main] DEBUG org.hibernate.jdbc.ConnectionManager - > aggressively > > releasing > > JDBC connection > > at aero.sita.billing.services.UserService.setUserAsCBR(UserService. > > java: > > 19) > > at aero.sita.billing.persistance.UserDAOTest.testSetUserCBR( > > UserDAOTest. > > java:25) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp > > l. > > java:39) > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc > > es > > sorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at junit.framework.TestCase.runTest(TestCase.java:168) > > at junit.framework.TestCase.runBare(TestCase.java:134) > > at junit.framework.TestResult$1.protect(TestResult.java:110) > > at junit.framework.TestResult.runProtected(TestResult.java:128) > > at junit.framework.TestResult.run(TestResult.java:113) > > at junit.framework.TestCase.run(TestCase.java:124) > > at junit.framework.TestSuite.runTest(TestSuite.java:232) > > at junit.framework.TestSuite.run(TestSuite.java:227) > > at > org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunne > > r. > > java:83) > > at > org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSe > > t. > > java:62) > > at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite. > > executeTes > > tSet(AbstractDirectoryTestSuite.java:140) > > at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite. > > execute(Ab > > stractDirectoryTestSuite.java:127) > > at org.apache.maven.surefire.Surefire.run(Surefire.java:177) > > > > Is it cause of Hibernate that catch the exception maybe? Has anyone > > encountered the same issue? How can I state to db unit that this > test > > actually failed?? > > > > Valentin Jacquemin > > > > > ---------------------------------------------------------------------- > > -------- Come build with us! The BlackBerry(R) Developer Conference > > in SF, CA is the only developer event you need to attend this year. > > Jumpstart your developing skills, take BlackBerry mobile > applications > > to market and stay ahead of the curve. Join us from November 9 - 12, > > 2009. Register now! > http://p.sf.net/sfu/devconference_________________ > > ______________________________ dbunit-user mailing list dbunit-user@ > > lists.sourceforge.net <http://lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/ > > > > dbunit-user > > > _______________________________________________________________ > Neu: WEB.DE <http://WEB.DE> DSL bis 50.000 kBit/s und 200,- Euro > Startguthaben! > http://produkte.web.de/go/02/ > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. > Jumpstart your > developing skills, take BlackBerry mobile applications to market > and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > <mailto:dbunit-user@...> > https://lists.sourceforge.net/lists/listinfo/dbunit-user > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > -- Roberto Lo Giacco Chief Technical Officer SmartLab s.r.l. via Spagna, snc - 87036 Rende (CS) - Italy Mobile: +39 392 8765657 Email: rlogiacco@... Skype: longisland-75 Web: http://www.smartlab.it ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
| Free embeddable forum powered by Nabble | Forum Help |