Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1494

add a run(Class,String...) utitlity method to ApplicationComposers

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0-M1
    • None
    • None

    Description

      ApplicationComposers.run(Application.class, "a", "b");
      

      with Application a normal ApplicationComposer class

      @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";
              }
          }
      
      }
      

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            romain.manni-bucau Romain Manni-Bucau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: