The MSPro Boomi Collection
About
ScriptEase For Boomi
ScriptEase For Boomi
  • ScriptEase
    • ScriptEase Development Environment
    • What AI says!
      • The limits of AI ...
  • Software Installation
    • Install a local Atom
  • Project Setup
    • IntelliJ Configuration
    • Verify Project Setup
  • Concepts
    • Use Test Data
  • Examples
    • 1 - Debug an existing process script
    • 9 - Aggregate Prices Example
  • Test Contexts
    • The Process Call Chain
  • Download
  • 💤Appendix
    • Script Templates
    • Java thoughts and recommendations
      • Chose newer JVM for local development
    • Boomi documentation and links
    • Initialize IntelliJ Templates
    • Script Contexts
  • Troubleshoot
    • Java the weed
    • ClassNotFoundException - GroovyStarter
    • Invalid VCS root mapping
    • An illegal reflective access operation has occurred
    • UnauthorizedAccess Error
  • Licensing
    • License Activation
    • Privacy Policy
Powered by GitBook
On this page
  • Get test data
  • Use test data when testing
  • Share local test data with Boomi Integration
  1. Concepts

Use Test Data

Good practices for the use of test data

Last updated 6 months ago

The first question that might come up is: "Where can I get test data?" that is needed to debug and test my script? The answer is simple as that: run your process, and grab the documents that hit the - not yet developed - Data-Process Shape which is going to host the script.

Get test data

Imaging, you have a process that executes a Business-Rule and you want to serializes the Business-Rule XML results into a plain string. You want to develop a script for that XML conversion purpose, and you need test data.

  • Temporarily add a Stop-Shape where you want to insert the script.

  • Run your process.

  • Copy and paste as many documents as you need from the Stop-Shape,

    • and save each document as a file in your script's testDatafolder, in you project directory.

Use test data when testing

In your Test class read the documents from file:

Note: The _testfiles object has been created on the class level, and it point to testFiles directory, relative to the Test file location.

final TestFilesHelper _testFiles = 
    new TestFilesHelper( "testData", _sourceUri)

Share local test data with Boomi Integration

If you test on a local machine, using your local ATOM, you can use the testData directly from your ATOM. Copy the testData's full-path, which is probably: %UserProfile%\Documents\GroovyTraining.

  1. Setup a generic (empty) Disk v2 connector:

  2. Create a generic query Disk v2 operation:

  3. Amend your Test-Process to read test data from disk:

The SetProperties Shape sets the testData directory and it defines DDP_FileFilter = *.json

The dynamic document property is then used in the Disk v2 operation: matchWildcard parameter.

That is it! Your Boomi test process and your local test script share the same test data.

IMPORTANT: It is important that you execute the process on your local ATOM, please. A cloud or a customer ATOM normally does not have access to your local disk drive and folder!

❗
Copy & Paste documents from a test execution.
Four files containing test data pasted from a Boomi execution.
Reading test data from file.
Test data full-path.
Generic Disk v2 operation
Directory: Fix project path + relative testData directory for this process.
Use DDP_FileFilter in the operation's parameters.
Process execution with the same four files from local disk.