[hibernate-dev] HHH-6677 skip @BeforeClassOnce / @AfterClassOnce if test is ignored

Steve Ebersole steve at hibernate.org
Mon Sep 26 11:47:39 EDT 2011


Essentially you want to skip processing @BeforeClassOnce / 
@AfterClassOnce if there are no test methods to execute for said class 
being processed.


I think you should be able to call 
org.hibernate.testing.junit4.CustomRunner#computeTestMethods to 
accomplish this.  If computeTestMethods returns no methods, there are 
no test methods to be performed.


On Mon 26 Sep 2011 09:41:07 AM CDT, Strong Liu wrote:
> https://hibernate.onjira.com/browse/HHH-6677
>
> I don't find a elegant way to fix this….
> one option is in org.hibernate.testing.junit4.CustomRunner#withBeforeClasses, we check if the test class has @Skip (and @RequiresDialect etc.), and if it does, then return super.withBeforeClasses directly (i know this is not a good way to do that)
>
> any suggestions?
>
> -----------
> Strong Liu<stliu at hibernate.org>
> http://hibernate.org
> http://github.com/stliu
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-- 
steve at hibernate.org
http://hibernate.org



More information about the hibernate-dev mailing list