Results 1 to 3 of 3

Thread: Testing the a full pipeline

  1. #1
    Join Date
    May 2011
    Posts
    4

    Default Testing the a full pipeline

    Hello,

    I have a spring context file that builds a file processing pipe:

    file:inbound-channel-adapter (to receive the file)
    integration:transformer (to transform the file)
    integration:transformer (secondary transformer)
    file:outbound-channel-adapter (to move file to a 'done' directory)

    The output of the transformation is handled outside of this 'context', I have multiple file processing pipes which all provide the same output format, the idea of having them in separate context files allows me to 'hook' them up to some other input channel elsewhere in a parent context.

    So, for a single file processing pipe, I want to:
    • Place file into input directory

    • Listen on output channel of final transformer for result

    • Assert result, based on original file content


    I am aware that I can use @ContextConfiguration to import the context, however I wish to 'override' certain parts of the config with test specific data, for example:
    • Replace the 'directory' of the inbound channel adapter to a temporary test directory

    • Replace the 'directory' of the outbound channel adapter to a temporary test directory


    I can't see a way of doing this in the XML configuration. My only thinking up to this point is to @Autowire the channel adapters in the test, then use reflection to set the private directory field, I've not tried this idea as I don't really like is.

    Any ideas

    Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    This is a typical case for Spring's PropertyPlaceholders http://static.springsource.org/sprin...postprocessors, where each environment is bootstrapped with a property file or system property specific to the environment.

  3. #3
    Join Date
    May 2011
    Posts
    4

    Default

    Ahh yes, next time I'll RTFM

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •