以下に示すのは、同期ポイントの結果を評価するための開始点として使用可能な、カスタム・コード・クラスの例です。 実行するテストにとって、イメージ同期やウィンドウとイベントの同期が有用でない場合には、このテンプレートを使用して、同期を実行するクラスを作成できます。
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;
import org.eclipse.hyades.test.common.event.VerdictEvent;
import com.ibm.rational.test.lt.execution.citrix.customcode.CitrixCustomCodeImpl2;
import com.ibm.rational.test.lt.execution.citrix.customcode.ICitrixCustomCode2;
public String exec(ITestExecutionServices tes, String[] args) {
ICitrixCustomCode2 thisCode = new CitrixCustomCodeImpl2(tes);
// to get the last VP status
int verdict = thisCode.getLastVerificationPointVerdict();
if (verdict != VerdictEvent.VERDICT_PASS) {
// this example reports a message but must be adapted to your specific needs
tes.getTestLogManager().reportMessage("last VP status: " + thisCode.verdictEventToString(verdict));
}
return null;
}
以下の例は、再生中にデバッグ目的で画面キャプチャーを記録する方法を示しています。 画面キャプチャーはテスト・ログに記録され、「Citrix イメージ同期」ビューで表示することができます。
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;
import com.ibm.rational.test.lt.execution.citrix.customcode.*;
public String exec(ITestExecutionServices tes, String[] args) {
ICitrixCustomCode2 thisCode = new CitrixCustomCodeImpl2(tes);
// To capture and log the full screen:
thisCode.logFullScreenCapture();
// To capture and log a part of the screen:
// thisCode.logPartialScreenCapture(x, y, width, height);
// To capture and log a part of the screen to a file:
// thisCode.savePartialScreenCapture(filename, x, y, width, height);
return null;
}