この例では、呼び出しテストからのカスタム・コードの入力が欠落している場合、FAIL 判断をログに記録します。予期したとおりの入力があれば、入力が実行ヒストリーに書き込まれ、PASS 判断がログに記録されます。太字は、テンプレートに追加された行を示します。
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 { /** * no-arg コンストラクターを使用して、これのインスタンスを作成します。 */ 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; } }