I believe this is already handled if the annotation for the method has update=true, but I need to check. This requirement came to light when a test was run, and the xunit report failed to get generated. This is because the XUnitReporter.getPropertiesFromMethod() compares the number of arguments from the mapping.json file for a particular method, and the number of arguments from the IResult.getParameters() method call. If the size is different, it throws an error. This can be caused when a method is refactored and the number of parameters that the method takes changes.
For one, this kind of error could be detected at compile time, rather than fail at runtime. When the annotation processor is running, have it look at the number of arguments via reflection for that method, and compare to how many are in the mapping.json file.
Secondly, the current code doesn't tell you what method had an incorrect number of arguments. So change the debugging log info to get the name of the method that is failing.
Third, test the scenario where a method's number of arguments changes. Make sure during compilation that the mapping.json gets the updated parameters, and also that an Import Request should be made. The Import Request is required, because the way that iterations in Polarion works is that the number of elements of:
In this case, the XML has 3 parameter elements, so in Polarion, the TestSteps will have 3 args. When the xunit is generated, the mapping.json file must also contain 3 elements:
I believe this is already handled if the annotation for the method has update=true, but I need to check. This requirement came to light when a test was run, and the xunit report failed to get generated. This is because the XUnitReporter.getPropertiesFromMethod() compares the number of arguments from the mapping.json file for a particular method, and the number of arguments from the IResult.getParameters() method call. If the size is different, it throws an error. This can be caused when a method is refactored and the number of parameters that the method takes changes.
For one, this kind of error could be detected at compile time, rather than fail at runtime. When the annotation processor is running, have it look at the number of arguments via reflection for that method, and compare to how many are in the mapping.json file.
Secondly, the current code doesn't tell you what method had an incorrect number of arguments. So change the debugging log info to get the name of the method that is failing.
Third, test the scenario where a method's number of arguments changes. Make sure during compilation that the mapping.json gets the updated parameters, and also that an Import Request should be made. The Import Request is required, because the way that iterations in Polarion works is that the number of elements of:
Under at must match how many are in the TestStep of the TestCase (which in the XML file is the number of elements) eg:
In this case, the XML has 3 parameter elements, so in Polarion, the TestSteps will have 3 args. When the xunit is generated, the mapping.json file must also contain 3 elements: