다음 예제는 동기점의 결과를 평가하기 위한 시작점으로 사용할 수 있는 사용자 정의 코드 클래스입니다. 이 템플리트를 사용하여 이미지 동기화 및 창 이벤트 동기화가 사용자의 테스트에 실용적이지 않은 경우 동기화를 수행하는 클래스를 작성할 수 있습니다.
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;
}