Re: JUnit 4 Life-Cycle (Intercepts)

"[email protected] [junit]" <[email protected]> 02 Jul 2014 19:48:21 -0700
Newsgroups gmane.comp.java.junit.user
Message-ID <[email protected]>
Let me try a more concrete question.  The following RuleChain is contained in a base class and we want to append additional rules as required in concrete test sub-classes.
 

 Any suggestions on how to append a rule to a RuleChain???
 


 /** This chain of rules is executed in coded order. */
 @Rule
 public TestRule chain = RuleChain
 .outerRule(
 new JptStep000InitializeTestIndicatorRequiredRule(
 setupResourceTM()))
 .around(new JptStep010InitializeInputOutputDirectoryRule())
 .around(new JptStep020InitializeCdiBeanManagerRule())
 .around(new JptStep030InitializeCdiScopesRule())
 .around(new JptStep040InitializeCdiAnnotationsOnTestClassRule(this))
 .around(new JptStep050InitializePluginConfigurationRule(
 setupResourceTM()))
 .around(new JptStep060VerifyRequiredPluginsRule())
 .around(new JptStep070InitializeEmbeddedDatabaseRule())
 .around(new JptStepOptionalInitializeResourcesRule())
 .around(new JptStepOptionalDisplayUnexpectedStackTraceRule())
 .around(new JptStepLastDisplayBeginAndAfterRule());
 

 _Marvin