3 Replies Latest reply on Sep 28, 2007 8:52 AM by tobysaville

    Smooks Unit Test

    tobysaville

      Hello,

      I am trying to run a smooks unit test (based on the class SmooksTransformerUnitTest supplied with the distribution). I have tried two different resource-config setups. The following works:

      <resource-config selector="Order">
       <resource>org.milyn.cdres.trans.RenameElementTU</resource>
       <param name="replacementElement">DSLCheckRequest</param>
      </resource-config>
      


      but the following doesnt
      <resource-config selector="Order">
       <resource type="xsl">
       <![CDATA[<DSLCheckRequest/>]]>
       </resource>
       <param name="is-xslt-templatelet">true</param>
      </resource-config>
      


      any ideas why this might be?

      Previously, the org.milyn.cdres.trans.RenameElementTU wasnt working because i didnt have smooks-misc on my classpath, so i thought this might be an issue with my classpath. I have everything from the lib\smooks.esb folder on my classpath (as well as Xalan). Is there anything else thats needed?

      thanks,
      - Toby

        • 1. Re: Smooks Unit Test
          tobysaville

          posted too soon, seems I needed the file: smooks-base-configs\creators.xml

          Is there any chance of putting this file in the jbossesb-smooks.jar?

          Is it worth logging that this file cant be found? The logs only contain the following:

          [DEBUG] org.jboss.soa.esb.actions.converters.SmooksTransformer:245 - smooks-base-configs: [creators.xml]
          [INFO] org.jboss.soa.esb.actions.converters.SmooksTransformer:231 - Smooks configurations are now loaded.
          


          im not totally clear on how this stuff works, so i could be on the wrong path.

          cheers,
          Toby


          • 2. Re: Smooks Unit Test
            tfennelly

             

            "tobysaville" wrote:
            posted too soon, seems I needed the file: smooks-base-configs\creators.xml

            Is there any chance of putting this file in the jbossesb-smooks.jar?

            The reason it's not stuffed into a jar is to allow it to be modified.

            "tobysaville" wrote:
            Is it worth logging that this file cant be found?


            Sure, we should be INFO logging that. Can you log a JIRA against me please Toby?

            "tobysaville" wrote:
            im not totally clear on how this stuff works, so i could be on the wrong path.


            You're on the right path alright. What that file does is to tell Smooks how to handle different types of resources (java, xsl, groovy, freemarker etc). It just tells it the handler for each type of resource. It's not defined statically because it should be possible to remove and add support for old and new technologies. See this FAQ re how to extend Smooks to support new technologies.

            The next version of Smooks will load this stuff automatically, based on a scan of the classpath + annotations on the relevant classes. Basically, we won't need this config anymore.

            • 3. Re: Smooks Unit Test
              tobysaville

              Hi Tom,

              thanks for the clarification, i thought that might have been the case regarding jar-ing the creators.xml file.

              a ticket has been raised: http://jira.jboss.org/jira/browse/JBESB-1099

              thanks,
              tobes