com.ibm.broker.config.appdev.test

Class TestcaseUtilities

  • java.lang.Object
    • com.ibm.broker.config.appdev.test.TestcaseUtilities


  • public class TestcaseUtilities
    extends java.lang.Object
    Utility methods for loading and saving a testcase
    Author:
    nortonp
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void addTestDataToDatapool(java.lang.String dataPoolLocation, java.util.List<TestData> testDataList, boolean isOverwrite)
      Add test data to a data pool
      static void addTestDataToTestcase(java.lang.String testcaseLocation, java.util.List<TestData> testDataList)
      Add test data to a test cases data pool
      static void createNewDataPool(java.lang.String dataPoolLocation, java.util.List<TestData> testDataList)
      Creates a new data pool file containing the list of test data
      static void createNewTestCase(java.lang.String shlib, java.lang.String testcaseName, java.lang.String datapool, java.lang.String msgFlow, java.lang.String desc)
      Create a new .testcase file
      static TestData getTestData(TestDataType testDataType)
      Get a TestData object suitable for injection into a flow from an unmarshalled TestDataType
      static TestDataType getTestDataType(TestData testData)
      Get a TestDataType object for marshalling from a TestData object retrieved from captured test data
      static DataPoolType loadDataPoolFile(java.lang.String dataPoolLocation)
      load an existing data pool xml file
      static TestcaseType loadTestcaseFile(java.lang.String testcaseLocation)
      load an existing .testcase file
      static void saveDataPool(java.lang.String dataPoolLocation, DataPoolType dataPool)
      Saves an existing data pool to file
      static void saveTestcase(java.lang.String testcaseLocation, TestcaseType testcase)
      Saves an existing testcase to file
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestcaseUtilities

        public TestcaseUtilities()
    • Method Detail

      • loadTestcaseFile

        public static TestcaseType loadTestcaseFile(java.lang.String testcaseLocation)
                                             throws java.io.IOException,
                                                    javax.xml.bind.JAXBException
        load an existing .testcase file
        Parameters:
        testcaseLocation - - the full path to the testcase file
        Returns:
        an unmarshalled testcase
        Throws:
        javax.xml.bind.JAXBException
        java.io.IOException
      • loadDataPoolFile

        public static DataPoolType loadDataPoolFile(java.lang.String dataPoolLocation)
                                             throws javax.xml.bind.JAXBException,
                                                    java.io.IOException
        load an existing data pool xml file
        Parameters:
        dataPoolLocation - - the full path of the data pool file
        Returns:
        an unmarshalled data pool
        Throws:
        javax.xml.bind.JAXBException
        java.io.IOException
      • createNewTestCase

        public static void createNewTestCase(java.lang.String shlib,
                                             java.lang.String testcaseName,
                                             java.lang.String datapool,
                                             java.lang.String msgFlow,
                                             java.lang.String desc)
                                      throws javax.xml.bind.JAXBException,
                                             java.io.IOException
        Create a new .testcase file
        Parameters:
        shlib - - the full destination folder
        testcaseName - - the name of the testcase
        datapool - - the full path to the associated datapool file
        msgFlow - - the message flow required by this testcase
        desc - - A description of the testcase
        Throws:
        javax.xml.bind.JAXBException
        java.io.IOException
      • createNewDataPool

        public static void createNewDataPool(java.lang.String dataPoolLocation,
                                             java.util.List<TestData> testDataList)
                                      throws javax.xml.bind.JAXBException,
                                             java.io.IOException
        Creates a new data pool file containing the list of test data
        Parameters:
        dataPoolLocation - - the full path of the data pool xml file
        testDataList - - list of test data to add to data pool
        Throws:
        javax.xml.bind.JAXBException
        java.io.IOException
      • saveTestcase

        public static void saveTestcase(java.lang.String testcaseLocation,
                                        TestcaseType testcase)
                                 throws java.io.IOException,
                                        javax.xml.bind.JAXBException
        Saves an existing testcase to file
        Parameters:
        testcaseLocation - - the full path of the destination file
        testcase - - the testcase to save
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • saveDataPool

        public static void saveDataPool(java.lang.String dataPoolLocation,
                                        DataPoolType dataPool)
                                 throws javax.xml.bind.JAXBException,
                                        java.io.IOException
        Saves an existing data pool to file
        Parameters:
        dataPoolLocation - - the full path to the data pool file
        dataPool - - The data pool to save
        Throws:
        javax.xml.bind.JAXBException
        java.io.IOException
      • addTestDataToTestcase

        public static void addTestDataToTestcase(java.lang.String testcaseLocation,
                                                 java.util.List<TestData> testDataList)
                                          throws java.io.IOException,
                                                 javax.xml.bind.JAXBException
        Add test data to a test cases data pool
        Parameters:
        testcaseLocation - - the full path of the testcase file
        testDataList - - a list of test data to add
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • addTestDataToDatapool

        public static void addTestDataToDatapool(java.lang.String dataPoolLocation,
                                                 java.util.List<TestData> testDataList,
                                                 boolean isOverwrite)
                                          throws java.io.IOException,
                                                 javax.xml.bind.JAXBException
        Add test data to a data pool
        Parameters:
        dataPoolLocation - - the full path of the data pool file
        testDataList - - a list of test data to add
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • getTestDataType

        public static TestDataType getTestDataType(TestData testData)
        Get a TestDataType object for marshalling from a TestData object retrieved from captured test data
        Parameters:
        testData - - test data from captured test data
        Returns:
        test data in format required to marshall
      • getTestData

        public static TestData getTestData(TestDataType testDataType)
        Get a TestData object suitable for injection into a flow from an unmarshalled TestDataType
        Parameters:
        testDataType - - unmarshalled test data
        Returns:
        test data in a format suitable for injection into a flow