• User's guide
  • API
Search Results for

    Show / Hide Table of Contents
    • Concepts
    • Installation
    • Configuration
      • Overview
      • License
      • Datasources
      • Configuration
      • Plug-Ins
      • Codepages
      • Environment Variables
      • Include files
      • Example
    • Jobs
      • Jobs
      • Include
      • Multi-Threaded Jobs
      • Tracking Jobs
    • Tasks
      • Overview
      • Copy Check
      • Excel
      • File Compare
      • File Copy
      • File Dump
      • File Edit
      • File Format
      • Foreach
      • Generate
      • IMS/DB Data Conversion
      • JCL Submit
      • Listcat
      • Log
      • Powershell
      • Set Environment Variable
      • Sql
      • Stored Procedure Compare
      • Table Compare
      • Table Copy
      • Table Load
      • Table Scan
      • Table Unload
      • User Script
    • Layouts
      • Overview
      • XML Definition
      • COBOL Definition
      • Field data Types
    • Extensibility
      • Extending Ianus
      • Column Comparators
      • Column Converters
      • Record Comparators
      • File Editors
      • User Script
      • Record Layout Match Class
      • Column Layout Match Class
      • User Fields
      • Codepages
      • Resources
    • Usage
      • Command Line
      • Monitors
      • Programmatically
      • Unit Testing
    • Known Issues
    • Disclaimers

    Unit Testing with Ianus

    Ianus can be easily used with Visual Studio Unit Test projects, allowing the verification of application components performing massive data processing while leveraging the powerful unit test management capabilities provided by Visual Studio.

    Visual Studio Unit Test with Ianus

    Although unorthodox, this approach may result being very proficient with procedural components such as, for example, migrated legacy application, where a single run unit (i.e. a COBOL program or more often a single JCL) may perform thousands of read and write operations on databases and files.

    The unit test method will have to include:

    1. Code to activate the procedural component (optional). For example the C# method could invoke a PowerShell script submitting the job to the desired JES-like server (i.e. MFES for .NET JES)
    2. Code to execute the Ianus code to verify the outcome for code being tested
    3. Assertions to validate the test  
            [TestMethod]
            public void TestJob_JJACME01()
            {
                // executes the job JJACME01
                JobUtils.SubmitAndWait("JJACME01");
    
                // runs the Ianus job and checks the final job status
                HPE.Ianus.Environment env = 
                              new HPE.Ianus.Environment(Assembly.GetExecutingAssembly(), 
                                                              "UnitTest.Environment.xml");
                Job job = new Job(env, Assembly.GetExecutingAssembly(), 
                                       "UnitTest.JJACME01.xml");
                job.Start();
                job.Execute("TBLCMP01");
                job.End();
    
                // Validates the test
                Assert.AreEqual(Ianus.Job.JobStatus.Success, job.Status);
            }
    
    In This Article
    Back to top Copyright 2021 - Hewlett-Packard Enterprise