Received: by 10.50.76.166 with SMTP id l6mr106141igw.2.1330033103875; Thu, 23 Feb 2012 13:38:23 -0800 (PST) X-BeenThere: testng-users@googlegroups.com Received: by 10.50.114.3 with SMTP id jc3ls4538246igb.0.gmail; Thu, 23 Feb 2012 13:38:16 -0800 (PST) Received: by 10.50.203.99 with SMTP id kp3mr112463igc.0.1330033096687; Thu, 23 Feb 2012 13:38:16 -0800 (PST) Received: by 10.50.209.5 with SMTP id mi5msigc; Thu, 23 Feb 2012 13:36:15 -0800 (PST) Received: by 10.52.22.3 with SMTP id z3mr586887vde.2.1330032975059; Thu, 23 Feb 2012 13:36:15 -0800 (PST) Date: Thu, 23 Feb 2012 13:36:14 -0800 (PST) From: Jeroen van Erp To: testng-users@googlegroups.com Message-ID: <11080334.7499.1330032974251.JavaMail.geo-discussion-forums@vbai14> Subject: Assume NG MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_7497_23129911.1330032974250" ------=_Part_7497_23129911.1330032974250 Content-Type: multipart/alternative; boundary="----=_Part_7498_16325678.1330032974250" ------=_Part_7498_16325678.1330032974250 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cedric, Folks, In an attempt to get a similar behavior to JUnit's Assume.assumeThat, I've created "Assume NG"[1]. Using assumption annotations it is possible to conditionally skip certain methods, which is especially useful in @Factory and @DataProvider generated test(suites). Design Rationale: I've hooked into the IInvokedMedhodListener to check whether the method is annotated and check the assumptions for the test. In order to optionally skip the test however, I need(ed) to do a classpath override on the org.testng.internal.Invoker. This means that assumeng needs to go on the classpath before TestNG. I've looked at using IHookable instead, but then the test didn't register as skipped, which I think looks nicer than it not showing up at all. I'm curious as to what you think, how it can be improved, and whether this makes for a nice addition to TestNG. Best regards, Jeroen van Erp http://www.github.com/hierynomus [1] Source at: http://www.github.com/hierynomus/assumeng ------=_Part_7498_16325678.1330032974250 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cedric, Folks,

In an attempt to get a similar behavior t= o JUnit's Assume.assumeThat, I've created "Assume NG"[1]. Using assumption = annotations it is possible to conditionally skip certain methods, which is = especially useful in @Factory and @DataProvider generated test(suites).

Design Rationale:
I've hooked into the IInv= okedMedhodListener to check whether the method is annotated and check the a= ssumptions for the test. In order to optionally skip the test however, I ne= ed(ed) to do a classpath override on the org.testng.internal.Invoker. This = means that assumeng needs to go on the classpath before TestNG. I've looked= at using IHookable instead, but then the test didn't register as skipped, = which I think looks nicer than it not showing up at all.

I'm curious as to what you think, how it can be improved, and whethe= r this makes for a nice addition to TestNG.

Best r= egards,

Jeroen van Erp
http://www.github= .com/hierynomus

[1] Source at: http://www.github.c= om/hierynomus/assumeng
------=_Part_7498_16325678.1330032974250-- ------=_Part_7497_23129911.1330032974250--