Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5320

ModelTestKernelServices do not provide BootErrorCollector info

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 19.0.0.Beta10, 19.0.0.Final
    • None
    • None
    • None

      Currently, when using ModelTestKernelServices you can only check if isSuccessfulBoot() and get a Throwable via getBootError().

      However, if the boot is not successful and there is no boot error, you're in the dark as to what occurred when booting the server.

      The only way I got to be able to view what was going on when working on a transformer test case for WFLY-14476 was via debugging. Then I noticed that there is a BootErrorCollector object that shows the error that occurred when trying to boot. There must be a faster way of getting that message other than debugging (I couldn't find any output in the target dir), a way of printing that message directly in the test failure itself.
      Something like:

      if (!mainServices.isSuccessfulBoot()) {

         if (mainServices.getBootError() != null)
             throw mainServices.getBootError();
         else
             fail (mainServices.getBootErrorCollectorMessage());

      }

      The later method, getBootErrorCollectorMessage(), is the one that we are currently missing.

      Furthermore, ideally we are looking for a cleaner solution, we could, for example, provide a method that would return the boot error issue regardless whether there is a non-null boot error or an error message in boot error collector, allowing us to do something along the following lines in the test case:

      assertTrue(mainServices.getBootErrorDescription(), mainServices.isSuccessfulBoot());

      That method above, that I called {{getBootErrorDescription()}}in the example, would provide both BootErrorCollector info, if any, and BootError printed stack trace if there is a boot error. With something like this we would have the missing information, and we would be able to write a more concise test case.

              kathermanova Katarína Hermanová
              flaviarnn Flavia Rainone
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: