You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2015/01/18 17:16:34 UTC
[jira] [Resolved] (TOMEE-1494) add a run(Class,String...) utitlity
method to ApplicationComposers
[ https://issues.apache.org/jira/browse/TOMEE-1494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau resolved TOMEE-1494.
---------------------------------------
Resolution: Fixed
> add a run(Class,String...) utitlity method to ApplicationComposers
> ------------------------------------------------------------------
>
> Key: TOMEE-1494
> URL: https://issues.apache.org/jira/browse/TOMEE-1494
> Project: TomEE
> Issue Type: New Feature
> Reporter: Romain Manni-Bucau
> Assignee: Romain Manni-Bucau
> Fix For: 2.0.0-Milestone-1
>
>
> {code}
> ApplicationComposers.run(Application.class, "a", "b");
> {code}
> with Application a normal ApplicationComposer class
> {code}
> @Classes(cdi = true, value = Application.CdiBean.class)
> public class Application {
> private final String[] args;
> public Application(String[] args) {
> this.args = args;
> }
> @AppResource
> private ApplicationComposers composers;
> @Inject
> private CdiBean bean;
> @PostConstruct
> public void init() {
> try {
> assertNotNull(bean);
> assertEquals("run", bean.run());
> assertNotNull(args);
> assertEquals(asList("a", "b"), asList(args));
> ApplicationComposersTest.ok = true;
> } finally {
> try {
> composers.after();
> } catch (final Exception e) {
> // no-op
> }
> }
> }
> public static class CdiBean {
> String run() {
> return "run";
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)