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

Find a way to capture TransformerLogger log messages for use in resource transformation testing

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Management
    • None

      The way resource transformation works is on the DC side any resource transformation problems are just logged on the DC, with the problematic resource then going to the legacy host. This makes it hard to test resource transformation as any evidence of the resource transformer doing anything is lost.

      If there was a reasonably convenient way to pass a Consumer<String> into the TransformerLogger, in flushLogger it could pass its message to the consumer in addition to logging it. Tests could then perform assertions against the message.

      Note: there's no point doing the wiring to pass in the Consumer if there's no good utility code to make it easy to do something with the captured message. Probably this could be done by overloading KernelServices.readTransformedModel with a variant that takes the Consumer.

      Perhaps TransformationTarget could add a defaulted method to expose the Consumer, and TransformerLogger could use it if present. org.jboss.as.subsystem.test.ReadTransformedResourceOperation creates the TransformationTarget so it could pass it in. That's a bit ugly because we'd be adding what's essentially a test utility object to TransformationTarget, which is a production code interface. The getter also wouldn't really fit with TransformationTarget's API. A better API fit would be the ResourceTransformer the TransformationTarget provides from its resolveTransformer method.

              Unassigned Unassigned
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: