Skip to content

Return Parameters

itaiag edited this page Aug 9, 2016 · 1 revision

Return Parameters

JSystem Automation Framework supports tests that include return parameters, these "return Parameters" are return to the scenario, and are used as the input for the rest of the test or scenario execution.

In order to add a return parameter the user should add the following elements to the code:

  • import jsystem.framework.TestProperties;
  • @TestProperties annotation for each of the tests, with a list of "returnParam" strings.
  • Setter and getter methods for each of the return parameters, starting with "set" and "get"/"is" respectively.

The following example shows a test that includes a return parameter.

 package com.aqua.sanity;
 
 import jsystem.framework.TestProperties;
 import com.aqua.general.JSysTestCase;
 
 public class FlowControlFunctionality extends JSysTestCase {
     private int NumberOfFiles = 42;
     private int ExpectedNumberOfFiles = 3;

     @TestProperties( returnParam = {"ExpectedNumberOfFiles" ,"NumberOfFiles" })
     public void testNumberOfFiles(){
         assertEquals(getNumberOfFiles(), getExpectedNumberOfFiles());
     }
         
     public int getNumberOfFiles() {
         return NumberOfFiles;
     }
 
     public int getExpectedNumberOfFiles() {
         return ExpectedNumberOfFiles;
     }
 
     public void setExpectedNumberOfFiles(int expectedNumberOfFiles) {
         ExpectedNumberOfFiles = expectedNumberOfFiles;
     }
 
     public void setNumberOfFiles(int numberOfFiles) {
         NumberOfFiles = numberOfFiles;
     }
 }

Table 7: Flow Control Code Example

Clone this wiki locally