Try OpenEdge Now
skip to main content
Online Help
Overview of ABLUnit testing framework : Tasks : Running test cases and test suites : Running test cases from the command prompt
 
Running test cases from the command prompt
You can also run test cases and the test suites from the proenv command prompt. Run the ABLUnitCore.p driver program by passing the test case, the test suite, or the folder containing test cases and the test suites as a parameter.
You have the following options:
*Run multiple test cases by providing the test cases as parameters separated by commas (,...,...).
*Run only the test method or test procedure in a specific test case by providing the name of the test method or test procedure separated by # with the test case name.
The following command shows you how to use the ABLUnitCore.p driver program:
prowin32 -p (Driver Program) -param <parameters>
The following examples show you how to run a test class, a test procedure, a test suite, or a test folder:
prowin32 -p ABLUnitCore.p -param testpackage.testclass
prowin32 -p ABLUnitCore.p -param testprocedure.p
prowin32 -p ABLUnitCore.p -param testSuite.cls
prowin32 -p ABLUnitCore.p -param testSuite.p
prowin32 -p ABLUnitCore.p -param C:\tests
Note: You must provide the qualified name of the test class and the full path or the relative path of the test procedure.
To run the test classes, the classes must be available in the PROPATH.
The following is an example that passes multiple test cases:
prowin32 -p ABLUnitCore.p -param testclass1.cls
prowin32 -p ABLUnitCore.p -param testclass1#testmethod
prowin32 -p ABLUnitCore.p -param testclass1.cls,testclass2.cls
prowin32 -p ABLUnitCore.p -param testclass1#testM1,testclass2#testM2
prowin32 -p ABLUnitCore.p -param testProcedure1.p,testProcedure2.p
prowin32 -p ABLUnitCore.p -param testProcedure1.p#testP,testProcedure2.p prowin32 -p ABLUnitCore.p -param testSuite.cls
prowin32 -p ABLUnitCore.p -param testSuite.p prowin32 -p ABLUnitCore.p -param "C:\testFolder"
prowin32 -p ABLUnitCore.p -param testclass1.testclass
prowin32 -p ABLUnitCore.p -param testclass1.testclass#testmethod
prowin32 -p ABLUnitCore.p -param testclass1.testclass,testclass2.testclass
prowin32 -p ABLUnitCore.p -param testclass1.testclass#testM1,testclass2.testclass#testM2
prowin32 -p ABLUnitCore.p -param testProcedure1.p,testProcedure2.p
prowin32 -p ABLUnitCore.p -param testProcedure1.p#testP,testProcedure2.p prowin32 -p ABLUnitCore.p -param testSuite.cls
prowin32 -p ABLUnitCore.p -param testSuite.p prowin32 -p ABLUnitCore.p -param "C:\testFolder"
Note: Currently, we do not support running multiple tests from single test procedure or test class.
*Pass the configuration file as a parameter as shown below:
prowin32 -p ABLUnitCore.p -param "CFG=C:\ABLUnit\tests\ablunit.json"
Here is a sample configuration (in JSON format) that displays all the valid options.
{
"options": {
"output": {
"location": "C:/ABLUnit/results",
"format": "xml"
},
"quitOnEnd": true,
"writeLog": true,
"showErrorMessage": true,
"throwError": true
},
"tests": [
{
"test": "C:/ABLUnit/tests/MyTestClass.cls"
},
{
"test": "C:/ABLUnit/tests/MyTestProcedure.p"
},
{
"folder": "C:/ABLUnit/tests/test-folder"
},
{
"test": "C:/ABLUnit/tests/MyTestClass1.cls",
"cases": [
"testItAgain"
]
}
]
}
The options of the file are as follows:
*options specifies additional data for the run time framework.
*output specifies the location of the output directory to write the test results. If all the tests run successfully, an XML file that contains the results, results.xml, is created in the specified location (if output location is not specified, results.xml file is generated under the current working directory). You can change the location of results.xml by using the following command:
prowin32 -p ABLUnitCore.p -param "TestCaseClass.cls -outputLocation <path>"
Only xml results are supported and the only valid value for format is xml.
*The values for quitOnEnd, writeLog, showErrorMessage, throwError can be true or false only. If quitOnEnd is true then the application closes. It can be set to false, if another application uses the ABLUnit as a library. For example, if writeLog is true then a log file, ablunit.log is created in the current working directory and writes error messages to that log file. If showErrorMessage is set to true then the error messages is displayed in a new window. If ABLUnit is used as a library inside another program, set throwError to true, the framework displays the errors occurred.
*tests lets you add the tests that you want to run and each test can be configured using test.
*folder specifies the location that contain the tests, it is equivalent to using test, however the reverse is not true.