Este exemplo registrará um veredito com falha se a entrada do código personalizado do teste de chamada estiver ausente. Se a entrada esperada estiver presente, ela será gravada no histórico de execução e será registrado um veredito transmitido. Negrito indica linhas incluídas no gabarito.
package custom; import com.ibm.rational.test.lt.kernel.logging.IKLog; import org.eclipse.hyades.test.common.event.* /** * @author unknown */ public class LogVerdictExample implements com.ibm.rational.test.lt.kernel.custom.ICustomCode { /** * Instances of this will be created using the no-arg constructor. */ public LogVerdictExample() { } /** * @see com.ibm.rational.test.lt.kernel.custom.ICustomCode#exec(IKLog, java.lang.String[]) */ public String exec(IKLog log, String[] args) { if (args == null) { log.reportVerificationPoint("Failure",VerdictEvent.VERDICT_FAIL,"No input values found.",VerdictEvent.REASON_SEE_DESCRIPTION); } else { String s = ""; for (int i=0; i < args.length; i++) { s = s + args[i]; } log.reportMessage("Input argument to this custom code is: " + s); log.reportVerificationPoint("Success",VerdictEvent.VERDICT_PASS,"The response included your country code."); } return null; } }