이벤트 순서 작성
이벤트 순서에서 테스트 이벤트 세트를 정의합니다. 생성하는 이벤트는 이벤트 순서 파일에서 정의한 순서대로 서버로 전송됩니다.
시작하기 전에
이 태스크 정보
이벤트 순서 파일의 모든 이벤트(.eseq)는 emit <event> 구성이나 emit <event>, time-stamped <date & time> 구성을 사용하여 정의해야 합니다. .eseq 파일에 지정된 이벤트 순서로 처리 순서를 판별합니다. 이벤트 시간소인은 이벤트가 발생하는 시간을 표시합니다. 예를 들어, .eseq 파일에 다음 세 개의 이벤트가 있는 경우:
- event1의 시간소인 3/24/2015
- event2의 시간소인 3/25/2015
- event3의 시간소인 3/22/2015
처리되는 이벤트 순서는 해당 시간소인과 관계 없이 event1, event2, event3입니다. event3에는 event2 및 event1보다 빠른 시간소인이 있으므로 이동 시 이벤트가 지연되어 순서대로 도착하지 못한 것으로 해석할 수 있습니다. 테스트는 이벤트 순서의 첫 번째 시간소인에서 시작하며 이 시간은 절대 시간이어야 합니다. 이후 이벤트에는 첫 번째 시간소인에 대해 상대적으로 이전(과거) 또는 이후(미래)인 시간소인이 포함될 수 있습니다. 그러나 이벤트를 처리하는 순서는 이벤트 순서에 따른 순서입니다. 다시 말해, 모든 이벤트는 발생 시간과 관계 없이 처리됩니다.
또는 상대적 시간소인으로 이벤트 순서를 작성하려는 경우, 생성하는 첫 번째 이벤트 다음에 time-stamped by the test scenario 생성을 사용할 수 있습니다. 첫 번째 이벤트에서 이 생성을 사용하는 경우, 후속 이벤트 모두는 순서에서 이들 바로 앞에 오는 이벤트와 비교하여 시간소인이 지정됩니다. 그런 다음 여러 시간소인에 같은 순서를 생성하여 테스트 시나리오의 이벤트 순서를 다시 사용할 수 있습니다.
프로시저
예
- 이벤트 속성
-
이벤트에는 시간소인이 있는 이벤트 속성이 포함될 수 있습니다. 다음 예에서는 request event 속성에 시간소인이 있습니다.
emit a new response event where the in response to is ( a new request event where the timestamp is 1/1/2015 ) , time-stamped 1/2/2015 ;다음 예제에서 new customer registration 이벤트의 address 속성은 emit 구성 안에 작성됩니다. where 구성은 a new <item> 구성 안에서 사용됩니다.
emit a new customer registration where the address is ( a new address where the street is "221B Baker Street" , the city is "London" , the country is "UK" ) , time-stamped 3/25/2015 ; - 상대 시간소인이 있는 이벤트 순서
- 다음 예제에서 구매 이벤트는 테스트 시나리오에서 지정한 시간에 고객 Fred가 생성합니다.
두 번째 및 세 번째 구매는 첫 번째 구매 이벤트 이후 3일 및 5일 후에 생성됩니다.
emit a new purchase where the customer is the customer "Fred", the amount is 100.0, time-stamped by the test scenario ; emit a new purchase where the customer is the customer "Fred", the amount is 50, time-stamped 3 days later ; emit a new purchase where the customer is the customer "Fred", the amount is 250, time-stamped 2 days later ; - 별도의 개념 정의가 있는 이벤트 순서
- 다음 예에서는 이벤트 순서가 customer registration
이벤트 및 purchase 이벤트의 두 개 이벤트로
구성되며 이들 이벤트는 두 개의 변수인 the
customer 및 purchase1에 연관되어 있습니다.
이러한 변수는 emit 문 외부의
define 문에 정의되어 있습니다.
괄호는 선택적입니다.
define 'the customer' as the customer identified by "John"; emit ( a new customer registration where the customer is 'the customer' , the first name is "John" , the last name is "Watson" ) , time-stamped 3/25/2015 ; define 'purchase1' as a new purchase where the customer is 'the customer'; emit purchase1 , time-stamped 5 minutes later; - 인라인 개념 정의가 있는 이벤트 순서
- 다음 예에서는 이벤트 순서가 customer registration
이벤트 및 purchase 이벤트의 두 개 이벤트로
구성되며 이들 이벤트는 두 개의 변수인 the
customer 및 purchase1에 연관되어 있습니다.
the customer의 주소 속성에 대한 변수는
customer registration 이벤트의
emit 정의 내부에 정의됩니다.
주소 인스턴스는 관계를 설정하는 데 사용하므로 new customer
registration 이벤트는 ID가 아닌 주소 개념 유형에 대한 속성 값을 포함하지 않습니다.
괄호는 선택적입니다.
define 'the customer' as the customer identified by "John"; emit a new customer registration where the customer is 'the customer' , the first name is "John" , the last name is "Watson" , the address is ( a new address where the address id is "123" the street is "221B Baker Street" , the city is "London" , the country is "UK" ) , time-stamped 3/25/2015 ; define 'purchase1' as a new purchase where the customer is 'the customer'; emit purchase1 , time-stamped 5 minutes later; - 두 개의 이벤트에서 같은 변수를 사용하는 이벤트 순서
- 다음 예에서 변수 paddington은
특정 customer를 참조하기 위해 각 이벤트에서 재사용합니다.
define 'paddington' as the customer identified by "paddington@example.com" emit a new customer registration where the customer is paddington , time-stamped 4/07/2015 ; emit a new purchase where the customer is paddington , the price is 25 , time-stamped 10 minutes later ; emit a new purchase where the customer is paddington , the price is 62 , time-stamped 3 days later ; - 다른 유형의 시간소인을 사용하는 이벤트가 있는 이벤트 순서
- 다음 예에서 첫 번째 purchase 이벤트에는
customer registration 이벤트보다 10분 후인
시간소인이 있습니다. 시퀀스의 세 번째 이벤트는 이전 이벤트의 3일 후에 발생하며
이 예에서는 customer registration 이벤트입니다.
이러한 이벤트에서는 순서에 따라 처리되지 않은 이벤트 순서를 시뮬레이션하는 방법을
예로 보여줍니다.
define 'paddington' as the customer identified by "paddington@example.com" emit a new purchase where the customer is paddington , the price is 25 , time-stamped 4/07/2015 ; emit a new customer registration where the customer is paddington , time-stamped 10 minutes earlier ; emit a new purchase where the customer is paddington , the price is 62 , time-stamped 3 days later ;