A classe PrintArgs imprime seus argumentos de entrada no arquivo
C:\arguments.out. Essa classe poderia ser utilizada, por exemplo, para imprimir uma
resposta retornada pelo servidor.
package customcode;
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;
import java.io.*;
/**
* The PrintArgs class prints its input arguments to the file
* C:\arguments.out. This example could be used to print a response
* returned by the server.
*/
/**
* @author IBM Custom Code Samples
*/
public class PrintArgs implements
com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {
/**
* Instances of this will be created using the no-arg constructor.
*/
public PrintArgs() {
}
public String exec(ITestExecutionServices tes, String[] args) {
try {
FileWriter outFile = new FileWriter("C:\\arguments.out");
for (int i = 0; i < args.length; i++)
outFile.write("Argument " + i + " is: " + args[i] + "\n");
outFile.close();
} catch (IOException e) {
tes.getTestLogManager().reportMessage(
"Unable to write to C:\\arguments.out");
}
return null;
}
}