You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Xavier Dury (JIRA)" <ji...@apache.org> on 2014/04/16 10:46:15 UTC
[jira] [Commented] (OPENEJB-2089) Provide ApplicationComposer
feature as a JUnit @Rule
[ https://issues.apache.org/jira/browse/OPENEJB-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13970582#comment-13970582 ]
Xavier Dury commented on OPENEJB-2089:
--------------------------------------
Do you think it would be possible to have a constructor for {{ApplicationComposerRule}} like this:
{code}
ApplicationComposerRule(Object testInstance, Object... additionalModules)
{code}
That way, it would be possible to actually have reusable modules:
{code}
public MyPersistenceModule {
@Module
public PersistenceUnit persistence() {...}
}
public MyTest {
@Rule
ApplicationComposerRule rule = new ApplicationComposerRule(this, new MyPersistenceModule());
@Module
public Class<?> beans() {...}
@Test
public void myTest() {...}
}
{code}
> Provide ApplicationComposer feature as a JUnit @Rule
> ----------------------------------------------------
>
> Key: OPENEJB-2089
> URL: https://issues.apache.org/jira/browse/OPENEJB-2089
> Project: OpenEJB
> Issue Type: Improvement
> Components: tests
> Reporter: Xavier Dury
> Assignee: Romain Manni-Bucau
> Attachments: OPENEJB-2089.patch
>
>
> Currently, ApplicationComposer uses the only one shot we have at specifying which Runner a JUnit test should use.
> This can easily be circumvented by exposing the same functionality through a JUnit @Rule (TestRule).
> By doing this, we could use ApplicationComposer with an other Runner (like Parameterized) and/or other @Rules.
--
This message was sent by Atlassian JIRA
(v6.2#6252)