Re: Bug(?) in Theories with non-static @DataPoint method
David Saff <[email protected]> Fri, 23 Jul 2010 15:53:32 -0400
| Newsgroups | gmane.comp.java.junit.devel |
|---|---|
| Message-ID | <[email protected]> |
Johannes, Sorry to be so long in getting back to you. Have you opened a bug on githu= b? David Saff On Sat, Jul 10, 2010 at 7:31 AM, Johannes Schneider <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi guys, > > don't know where to post, so hopefully this list is the right one. > > I run into some problems related to Theories and DataPoints (with 4.8.1): > > > This test is marked as successfull but did *not* run: > > @RunWith( Theories.class ) > public class TheoriesTest { > =A0@Theory > =A0public void aTheory( String arg ) { > =A0 =A0System.out.println( "TheoriesTest.aTheory(" + arg + ")" ); > =A0 =A0assertNotNull( arg ); > =A0} > > =A0@DataPoint > =A0public String getParam() { > =A0 =A0return "daParam"; > =A0} > } > > > I think the problem lies in Theories:126. > statement.evaluate() catches exceptions silently > (org.junit.experimental.theories.Theories.TheoryAnchor#methodCompletesWit= hParameters:158). > > Therefore "handleDataPointSuccess" is called even when an exception has > been thrown.... > > > > So I think there are at least two things missing: > - - Proper exception handling... > - - Checking the DataPoint(s) methods for the static keyword > > > By the way: Why isn't it allowed to return Iterables or at least Lists > in @DataPoints methods? > > > > Thanks, > > Johannes > > - -- > Johannes Schneider - blog.cedarsoft.com > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQEcBAEBAgAGBQJMOFomAAoJEAytD9R7Qv6dOjoH/2Lde0wr10KtWyUDK2Xf+fB+ > Fy8tBXmNvQiJAjdeA0zI+yt1SPg0dcWkrDOqLvP+3BBh+3uis1J4ZW0/1zU8zQhX > 1tzeZ0S+gYopRnxxgc5Zmpc1ErD5kwNykwz0JbjGxFe6VccOvnjQp6BYRyoaKHOh > tXzoGKFCSjKU8N+xSzLouoVQmjfp4KsOTHYRpHeiPcvf9X33WlJ8/fIAlxYW6mvu > Fg8AoQ93BEQk4Qp6S1PeupRuconKOIViM8+E2a2lz9C8MKqo8WL9V+23J5fe7qvi > Y2OktebVLu54Vz48sfdhfDz+YhXRJegxDfbmXNx8+Sbn44yvLIpbk2mKW68aWrw=3D > =3DzW6R > -----END PGP SIGNATURE----- > > -------------------------------------------------------------------------= ----- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Junit-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/junit-devel > ---------------------------------------------------------------------------= --- This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first